"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.publicSignupSchema = exports.addSignupSchema = exports.listShiftsSchema = exports.updateShiftSchema = exports.createShiftSchema = void 0;
const zod_1 = require("zod");
const client_1 = require("@prisma/client");
exports.createShiftSchema = zod_1.z.object({
    title: zod_1.z.string().min(1, 'Title is required'),
    description: zod_1.z.string().optional(),
    date: zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'Date must be YYYY-MM-DD'),
    startTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'Start time must be HH:MM'),
    endTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'End time must be HH:MM'),
    location: zod_1.z.string().optional(),
    maxVolunteers: zod_1.z.number().int().min(1, 'Must have at least 1 volunteer spot'),
    isPublic: zod_1.z.boolean().optional().default(false),
    cutId: zod_1.z.string().optional(),
});
exports.updateShiftSchema = zod_1.z.object({
    title: zod_1.z.string().min(1).optional(),
    description: zod_1.z.string().nullable().optional(),
    date: zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'Date must be YYYY-MM-DD').optional(),
    startTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'Start time must be HH:MM').optional(),
    endTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'End time must be HH:MM').optional(),
    location: zod_1.z.string().nullable().optional(),
    maxVolunteers: zod_1.z.number().int().min(1).optional(),
    isPublic: zod_1.z.boolean().optional(),
    status: zod_1.z.nativeEnum(client_1.ShiftStatus).optional(),
    cutId: zod_1.z.string().nullable().optional(),
});
exports.listShiftsSchema = zod_1.z.object({
    page: zod_1.z.coerce.number().int().positive().default(1),
    limit: zod_1.z.coerce.number().int().positive().max(100).default(20),
    search: zod_1.z.string().optional(),
    status: zod_1.z.nativeEnum(client_1.ShiftStatus).optional(),
    upcoming: zod_1.z.coerce.boolean().optional(),
    sortBy: zod_1.z.enum(['date', 'createdAt', 'title']).optional().default('date'),
    sortOrder: zod_1.z.enum(['asc', 'desc']).optional().default('desc'),
});
exports.addSignupSchema = zod_1.z.object({
    userEmail: zod_1.z.string().email('Valid email is required'),
    userName: zod_1.z.string().optional(),
});
exports.publicSignupSchema = zod_1.z.object({
    email: zod_1.z.string().email('Valid email is required'),
    name: zod_1.z.string().min(1, 'Name is required'),
    phone: zod_1.z.string().optional(),
});
//# sourceMappingURL=shifts.schemas.js.map