"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProspectExternalUpdate = exports.ProspectExternalUpdateSchema = exports.PROSPECT_UPDATE_TYPES = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
exports.PROSPECT_UPDATE_TYPES = ['fields_update', 'files_update'];
exports.ProspectExternalUpdateSchema = new mongoose_1.default.Schema({
    prospectId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.CRMProspects,
        required: true,
        index: true,
    },
    type: {
        type: String,
        enum: exports.PROSPECT_UPDATE_TYPES,
        required: true,
    },
    update: {
        type: mongoose_1.default.Schema.Types.Mixed,
    },
    updatedBy: {
        type: String,
    },
}, {
    timestamps: { createdAt: true, updatedAt: false },
    versionKey: false,
});
exports.ProspectExternalUpdate = mongoose_1.default.model(_models_1.MODEL_NAMES.CRMProspectExternalUpdates, exports.ProspectExternalUpdateSchema);
