2023-08-24 23:41:06 +00:00
|
|
|
import type { IncomingMessage } from "http";
|
|
|
|
|
2023-04-25 22:39:47 +00:00
|
|
|
import type { TGetScheduleInputSchema } from "./getSchedule.schema";
|
2023-08-07 14:00:01 +00:00
|
|
|
import { getAvailableSlots } from "./util";
|
2023-04-25 22:39:47 +00:00
|
|
|
|
2023-08-24 23:41:06 +00:00
|
|
|
export type GetScheduleOptions = {
|
|
|
|
ctx?: ContextForGetSchedule;
|
2023-04-25 22:39:47 +00:00
|
|
|
input: TGetScheduleInputSchema;
|
|
|
|
};
|
|
|
|
|
2023-08-24 23:41:06 +00:00
|
|
|
interface ContextForGetSchedule extends Record<string, unknown> {
|
|
|
|
req?: (IncomingMessage & { cookies: Partial<{ [key: string]: string }> }) | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const getScheduleHandler = async ({ ctx, input }: GetScheduleOptions) => {
|
|
|
|
return await getAvailableSlots({ ctx, input });
|
2023-04-25 22:39:47 +00:00
|
|
|
};
|