"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MonthEndData = exports.MonthEndDataSchema = exports.EMonthEndDataType = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
var EMonthEndDataType;
(function (EMonthEndDataType) {
    EMonthEndDataType["BALANCE"] = "BALANCE";
    EMonthEndDataType["FLOATED_BALANCE"] = "FLOATED_BALANCE";
    EMonthEndDataType["STATEMENT_BALANCE"] = "STATEMENT_BALANCE";
})(EMonthEndDataType || (exports.EMonthEndDataType = EMonthEndDataType = {}));
exports.MonthEndDataSchema = new mongoose_1.default.Schema({
    productId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.loanProducts,
        required: true,
    },
    year: {
        type: Number,
        required: true,
    },
    month: {
        type: Number,
        required: true,
    },
    dataType: {
        type: String,
        required: true,
        trim: true,
        enum: Object.values(EMonthEndDataType),
    },
    dataValue: {
        type: Number,
        required: true,
    },
}, {
    timestamps: { createdAt: true, updatedAt: true },
});
exports.MonthEndData = mongoose_1.default.model(_models_1.MODEL_NAMES.monthEndData, exports.MonthEndDataSchema);
