import type { TRPCContext } from "../trpc.js";

export type HolidayReadContext = Pick<TRPCContext, "db" | "dbUser">;

export type HolidayCalendarDb = TRPCContext["db"] & {
  holidayCalendar: {
    findFirst: (args: unknown) => Promise<{ id: string } | null>;
    findMany: (args: unknown) => Promise<any[]>;
    findUnique: (args: unknown) => Promise<any | null>;
    create: (args: unknown) => Promise<any>;
    update: (args: unknown) => Promise<any>;
    delete: (args: unknown) => Promise<any>;
  };
  holidayCalendarEntry: {
    findFirst: (args: unknown) => Promise<{ id: string } | null>;
    findUnique: (args: unknown) => Promise<any | null>;
    create: (args: unknown) => Promise<any>;
    update: (args: unknown) => Promise<any>;
    delete: (args: unknown) => Promise<any>;
  };
};

export function asHolidayCalendarDb(db: TRPCContext["db"]): HolidayCalendarDb {
  return db as unknown as HolidayCalendarDb;
}
