"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CRMProspectLink = exports.ProspectLinkSchema = exports.ICRMProspectLinkValidationSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const joi_1 = __importDefault(require("joi"));
const _models_1 = require("./_models");
exports.ICRMProspectLinkValidationSchema = joi_1.default.object({
    _id: joi_1.default.string(),
    prospectId: joi_1.default.string().required(),
    auditorLinkId: joi_1.default.string().required(),
    clientLinkId: joi_1.default.string().required(),
});
exports.ProspectLinkSchema = new mongoose_1.default.Schema({
    prospectId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.CRMProspects,
        required: true,
    },
    auditorLinks: {
        type: Map,
        of: mongoose_1.default.Schema.Types.ObjectId,
        required: true,
    },
    clientLinkId: {
        type: String,
        required: true,
    },
}, {
    timestamps: { createdAt: true, updatedAt: true },
    versionKey: false,
});
exports.CRMProspectLink = mongoose_1.default.model(_models_1.MODEL_NAMES.prospectLinks, exports.ProspectLinkSchema);
