"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hiringSourcesResponseSchema = exports.hiringSourceResponseSchema = exports.updateHiringSourceSchema = exports.createHiringSourceSchema = void 0;
const zod_1 = require("zod");
const shared_dto_1 = require("../shared/shared.dto");
const optionalString = zod_1.z.preprocess((value) => {
    if (typeof value === 'string' && value.trim() === '')
        return undefined;
    return value;
}, zod_1.z.string().trim().optional());
const statusSchema = zod_1.z.enum(['active', 'inactive', 'deleted']);
exports.createHiringSourceSchema = zod_1.z.object({
    name: zod_1.z.string().trim().min(2, {
        message: 'Hiring source name must be at least 2 characters long',
    }),
    description: optionalString,
    status: statusSchema.optional(),
});
exports.updateHiringSourceSchema = exports.createHiringSourceSchema
    .partial()
    .refine((data) => Object.keys(data).length > 0, {
    message: 'At least one field must be provided',
});
exports.hiringSourceResponseSchema = zod_1.z.object({
    id: zod_1.z.string().uuid().optional(),
    name: zod_1.z.string().optional(),
    description: shared_dto_1.defaultTransformSchema,
    status: statusSchema.optional(),
    created_at: shared_dto_1.dateTransformSchema,
    updated_at: shared_dto_1.dateTransformSchema,
});
exports.hiringSourcesResponseSchema = zod_1.z.array(exports.hiringSourceResponseSchema);
//# sourceMappingURL=hiring_sources.dto.js.map