import { createTRPCRouter, protectedProcedure } from "../trpc.js";
import type { z } from "zod";
import {
  createVacationRequest,
  CreateVacationRequestSchema,
  type CreateVacationRequestInput,
} from "./vacation-create-support.js";
import { vacationManagementProcedures } from "./vacation-management-procedures.js";
import { vacationReadProcedures } from "./vacation-read.js";

export const vacationRouter = createTRPCRouter({
  ...vacationReadProcedures,
  ...vacationManagementProcedures,

  create: protectedProcedure
    .input(CreateVacationRequestSchema as z.ZodType<CreateVacationRequestInput>)
    .mutation(({ ctx, input }) => createVacationRequest(ctx, input)),
});
