import type { Prisma, SelectedCalendar } from "@calcom/prisma/client"; export interface ISelectedCalendarRepository { /** * Find selected calendar by id * * @param id */ findById(id: string): Promise; /** * Find selected calendar by channel id * * @param channelId */ findByChannelId(channelId: string): Promise; /** * Find next batch of selected calendars * Will check if syncSubscribedAt is null or channelExpiration is greater than current date * * @param take the number of calendars to take * @param integrations the list of integrations */ findNextSubscriptionBatch({ take, integrations, }: { take: number; integrations?: string[]; }): Promise; /** * Update status of sync for selected calendar * * @param id * @param data */ updateSyncStatus( id: string, data: Pick< Prisma.SelectedCalendarUpdateInput, "syncToken" | "syncedAt" | "syncErrorAt" | "syncErrorCount" > ): Promise; /** * Update subscription status for selected calendar */ updateSubscription( id: string, data: Pick< Prisma.SelectedCalendarUpdateInput, | "channelId" | "channelResourceId" | "channelResourceUri" | "channelKind" | "channelExpiration" | "syncSubscribedAt" > ): Promise; }