Files
Checkmate/server/src/repositories/geo-checks/IGeoChecksRepository.ts
T

30 lines
1008 B
TypeScript
Raw Normal View History

2026-02-23 17:48:53 +00:00
import type { GeoCheck, GroupedGeoCheck } from "@/types/geoCheck.js";
2026-02-24 22:30:28 +00:00
import type { GeoContinent } from "@/types/geoCheck.js";
2026-02-23 17:48:53 +00:00
2026-02-24 23:20:36 +00:00
export interface GeoChecksQueryResult {
geoChecksCount: number;
geoChecks: GeoCheck[];
}
2026-02-23 17:48:53 +00:00
export interface IGeoChecksRepository {
2026-02-24 18:19:51 +00:00
createGeoChecks(geoChecks: Omit<GeoCheck, "id" | "__v" | "createdAt" | "updatedAt">[]): Promise<GeoCheck[]>;
2026-02-24 23:20:36 +00:00
findByMonitorId(
monitorId: string,
sortOrder: string,
dateRange: string,
page: number,
rowsPerPage: number,
2026-02-25 18:43:12 +00:00
continents?: GeoContinent[]
2026-02-24 23:20:36 +00:00
): Promise<GeoChecksQueryResult>;
2026-02-23 17:48:53 +00:00
findByMonitorIdAndDateRange(monitorId: string, startDate: Date, endDate: Date): Promise<GeoCheck[]>;
2026-02-24 22:30:28 +00:00
findGroupedByMonitorIdAndDateRange(
monitorId: string,
startDate: Date,
endDate: Date,
dateFormat: string,
2026-02-25 18:43:12 +00:00
continents?: GeoContinent[]
2026-02-24 22:30:28 +00:00
): Promise<GroupedGeoCheck[]>;
2026-02-23 17:48:53 +00:00
deleteByMonitorId(monitorId: string): Promise<number>;
deleteByTeamId(teamId: string): Promise<number>;
2026-02-24 23:28:27 +00:00
deleteByMonitorIdsNotIn(monitorIds: string[]): Promise<number>;
2026-02-23 17:48:53 +00:00
}