import { buildContract } from '@jig-software/trest-core';
import { z } from 'zod';
import { Holiday } from '../schemas';

export const holidayContract = buildContract((c) =>
  c
    .prefix('/holidays')
    .parse((p) => p.error.text(400))
    .endpoints({
      getHolidays: (e) =>
        e.method('GET').parse((p) => p.success.object(200, z.array(Holiday))),
    }),
);
