"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReceivableAvailabilityManualSummary = exports.ReceivableAvailabilityManualSummarySchema = exports.multipliersSchemeDesc = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const ReceivableAvailability_model_1 = require("./ReceivableAvailability.model");
const _models_1 = require("./_models");
const multipliersFields = ['insuredAvailability', 'uninsuredAvailability'];
exports.multipliersSchemeDesc = Object.entries(ReceivableAvailability_model_1.summarySchemeDesc).reduce((acc, [key, value]) => {
    if (multipliersFields.includes(key)) {
        acc[key] = value;
    }
    return acc;
}, {});
exports.ReceivableAvailabilityManualSummarySchema = new mongoose_1.default.Schema({
    bbcDateId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.BBCDates,
        required: true,
    },
    summary: ReceivableAvailability_model_1.summarySchemeDesc,
    multipliers: exports.multipliersSchemeDesc,
}, { timestamps: true });
exports.ReceivableAvailabilityManualSummary = mongoose_1.default.model(_models_1.MODEL_NAMES.receivableAvailabilityManualSummary, exports.ReceivableAvailabilityManualSummarySchema);
