"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProspectSharepoint = exports.ProspectSharepointSchema = exports.SharepointFolderTypes = exports.ESharepointSyncStatus = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
var ESharepointSyncStatus;
(function (ESharepointSyncStatus) {
    ESharepointSyncStatus["pending"] = "pending";
    ESharepointSyncStatus["synced"] = "synced";
    ESharepointSyncStatus["failed"] = "failed";
})(ESharepointSyncStatus || (exports.ESharepointSyncStatus = ESharepointSyncStatus = {}));
exports.SharepointFolderTypes = {
    main: 'main',
    confidential: 'confidential',
};
exports.ProspectSharepointSchema = new mongoose_1.default.Schema({
    folderType: {
        type: String,
        enum: exports.SharepointFolderTypes,
        required: true,
        index: true,
    },
    isActive: {
        type: Boolean,
        default: true,
    },
    prospectId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.CRMProspects,
        required: true,
        index: true,
    },
    folderId: {
        type: String,
        required: true,
    },
    folderName: {
        type: String,
        required: true,
    },
    webUrl: {
        type: String,
        required: true,
    },
    driveId: {
        type: String,
        required: true,
    },
    syncStatus: {
        type: String,
        enum: Object.values(ESharepointSyncStatus),
        required: true,
    },
    parentId: {
        type: String,
        required: true,
    },
}, {
    timestamps: { createdAt: true, updatedAt: false },
    versionKey: false,
});
exports.ProspectSharepoint = mongoose_1.default.model(_models_1.MODEL_NAMES.CRMProspectSharepoint, exports.ProspectSharepointSchema);
