Files
calchat/apps/server/src/services/interfaces/EventRepository.ts
Linus Waldowsky 868e1ba68d perf: preload events and CalDAV config to avoid empty screens
Add CaldavConfigStore and preloadAppData() to load events (current month)
and CalDAV config into stores before dismissing the auth loading spinner.
This prevents the brief empty flash when first navigating to Calendar or
Settings tabs. Also applies Prettier formatting across codebase.
2026-02-09 18:59:03 +01:00

21 lines
780 B
TypeScript

import { CalendarEvent, CreateEventDTO, UpdateEventDTO } from "@calchat/shared";
export interface EventRepository {
findById(id: string): Promise<CalendarEvent | null>;
findByUserId(userId: string): Promise<CalendarEvent[]>;
findByDateRange(
userId: string,
startDate: Date,
endDate: Date,
): Promise<CalendarEvent[]>;
findByCaldavUUID(
userId: string,
caldavUUID: string,
): Promise<CalendarEvent | null>;
searchByTitle(userId: string, query: string): Promise<CalendarEvent[]>;
create(userId: string, data: CreateEventDTO): Promise<CalendarEvent>;
update(id: string, data: UpdateEventDTO): Promise<CalendarEvent | null>;
delete(id: string): Promise<boolean>;
addExceptionDate(id: string, date: string): Promise<CalendarEvent | null>;
}