This adds the ability for users to click on any day block in the historical uptime chart to see the specific incidents that occurred on that day. Closes #3972
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
import type { Incident } from "@/domain/incidents/incident.type.js";
|
|
import type { IncidentSummary } from "@/domain/incidents/incident.type.js";
|
|
export interface IIncidentsRepository {
|
|
// create
|
|
create(incident: Partial<Incident>): Promise<Incident>;
|
|
// fetch
|
|
findById(incidentId: string, teamId: string): Promise<Incident>;
|
|
findActiveByIncidentId(incidentId: string, teamId: string): Promise<Incident | null>;
|
|
findActiveByMonitorId(monitorId: string, teamId: string): Promise<Incident | null>;
|
|
findByTeamId(
|
|
teamId: string,
|
|
startDate: Date | undefined,
|
|
page: number,
|
|
rowsPerPage: number,
|
|
sortOrder?: string,
|
|
status?: boolean,
|
|
monitorId?: string,
|
|
resolutionType?: string
|
|
): Promise<Incident[]>;
|
|
findByMonitorIdAndDate(monitorId: string, teamId: string, dateStart: Date, dateEnd: Date): Promise<Incident[]>;
|
|
findSummaryByTeamId(teamId: string, limit?: number): Promise<IncidentSummary>;
|
|
countByTeamId(teamId: string, startDate: Date | undefined, status?: boolean, monitorId?: string, resolutionType?: string): Promise<number>;
|
|
|
|
// update
|
|
updateById(incidentId: string, teamId: string, updateData: Partial<Incident>): Promise<Incident>;
|
|
// delete
|
|
deleteByMonitorId(monitorId: string, teamId: string): Promise<number>;
|
|
deleteByMonitorIdsNotIn(monitorIds: string[]): Promise<number>;
|
|
// other
|
|
}
|