"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateProfileResponseDto = exports.createProfileResponseSchema = exports.CreateProfileDto = exports.createProfileSchema = void 0;
const comment_dto_1 = require("../../comment/dto/comment.dto");
const location_dto_1 = require("../../location/dto/location.dto");
const profile_dto_1 = require("./profile.dto");
const create_zod_dto_without_date_1 = require("../../shared/dto-modification/create-zod-dto-without-date");
const tag_dto_1 = require("../../tag/dto/tag.dto");
const zod_1 = __importDefault(require("zod"));
exports.createProfileSchema = zod_1.default.object({
    profile: profile_dto_1.profileSchema
        .pick({
        alternativeNames: true,
        birthDate: true,
        dni: true,
        fullName: true,
        gender: true,
        instagram: true,
        mail: true,
        phoneNumber: true,
        profilePictureUrl: true,
        secondaryPhoneNumber: true,
    })
        .merge(zod_1.default.object({
        comments: zod_1.default
            .array(comment_dto_1.commentSchema.pick({
            content: true,
            isSolvable: true,
        }))
            .optional(),
        residence: location_dto_1.locationSchema
            .pick({
            city: true,
            country: true,
            latitude: true,
            longitude: true,
            state: true,
        })
            .optional(),
        birth: location_dto_1.locationSchema
            .pick({
            city: true,
            country: true,
            latitude: true,
            longitude: true,
            state: true,
        })
            .optional(),
        tags: zod_1.default.array(tag_dto_1.tagSchema.shape.id).optional(),
    })),
    checkForSimilarity: zod_1.default.boolean().optional(),
});
class CreateProfileDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.createProfileSchema) {
}
exports.CreateProfileDto = CreateProfileDto;
const similarProfileSchema = zod_1.default.object({
    profile: profile_dto_1.profileSchema.pick({
        fullName: true,
        phoneNumber: true,
        id: true,
    }),
    similarityPhoneNumberPercentage: zod_1.default.number(),
    similarityFullNamePercentage: zod_1.default.number(),
});
const similarityProfileSchema = zod_1.default.object({
    similarProfiles: zod_1.default.array(similarProfileSchema),
});
const createdProfileSchema = zod_1.default.object({
    id: profile_dto_1.profileSchema.shape.id,
});
const createProfileResponseSchemaBase = zod_1.default.discriminatedUnion('type', [
    similarityProfileSchema.extend({
        type: zod_1.default.literal('similar'),
    }),
    createdProfileSchema.extend({
        type: zod_1.default.literal('created'),
    }),
]);
exports.createProfileResponseSchema = zod_1.default.object({
    response: createProfileResponseSchemaBase,
});
class CreateProfileResponseDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.createProfileResponseSchema) {
}
exports.CreateProfileResponseDto = CreateProfileResponseDto;
//# sourceMappingURL=create-profile.dto.js.map