"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.profileSchema = void 0;
const translate_1 = require("../../i18n/translate");
const validator_1 = __importDefault(require("validator"));
const zod_1 = __importDefault(require("zod"));
exports.profileSchema = zod_1.default.object({
    id: zod_1.default.string().uuid({
        message: (0, translate_1.translate)('model.profile.id.uuid'),
    }),
    shortId: zod_1.default.number(),
    phoneNumber: zod_1.default
        .string()
        .min(1, {
        message: (0, translate_1.translate)('model.profile.phoneNumber.required'),
    })
        .refine(validator_1.default.isMobilePhone, {
        message: (0, translate_1.translate)('model.profile.phoneNumber.invalid'),
    }),
    secondaryPhoneNumber: zod_1.default
        .string()
        .nullable()
        .refine((value) => {
        if (value === null)
            return true;
        return validator_1.default.isMobilePhone(value);
    }, {
        message: (0, translate_1.translate)('model.profile.secondaryPhoneNumber.invalid'),
    }),
    fullName: zod_1.default.string().min(1, {
        message: (0, translate_1.translate)('model.profile.fullName.required'),
    }),
    firstName: zod_1.default
        .string()
        .min(1, {
        message: (0, translate_1.translate)('model.profile.fullName.required'),
    })
        .nullable(),
    gender: zod_1.default.string().nullable(),
    birthDate: zod_1.default.string().pipe(zod_1.default.coerce.date()).nullable(),
    profilePictureUrl: zod_1.default
        .string()
        .url({
        message: (0, translate_1.translate)('model.profile.profilePictureUrl.invalid'),
    })
        .nullable(),
    instagram: zod_1.default.string().nullable(),
    mail: zod_1.default
        .string()
        .email({
        message: (0, translate_1.translate)('model.profile.mail.invalid'),
    })
        .nullable(),
    dni: zod_1.default.string().nullable(),
    alternativeNames: zod_1.default.array(zod_1.default.string()),
    birthLocationId: zod_1.default.string().uuid().nullable(),
    residenceLocationId: zod_1.default.string().uuid().nullable(),
    isInTrash: zod_1.default.boolean(),
    movedToTrashDate: zod_1.default.coerce.date().nullable(),
    created_at: zod_1.default.date(),
    updated_at: zod_1.default.date(),
});
//# sourceMappingURL=profile.dto.js.map