"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.employementTypesResponseSchema = exports.employementTypeResponseSchema = exports.updateEmployementTypeSchema = exports.createEmployementTypeSchema = 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.createEmployementTypeSchema = zod_1.z.object({
    name: zod_1.z.string().trim().min(2, {
        message: 'Employement type name must be at least 2 characters long',
    }),
    description: optionalString,
    status: statusSchema.optional(),
});
exports.updateEmployementTypeSchema = exports.createEmployementTypeSchema
    .partial()
    .refine((data) => Object.keys(data).length > 0, {
    message: 'At least one field must be provided',
});
exports.employementTypeResponseSchema = 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.employementTypesResponseSchema = zod_1.z.array(exports.employementTypeResponseSchema);
//# sourceMappingURL=employement_types.dto.js.map