"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FinancialComplianceBorrowerSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
const mongooseLeanId = require('../plugins/id.plugin');
exports.FinancialComplianceBorrowerSchema = new mongoose_1.default.Schema({
    isDeleted: {
        type: Boolean,
        default: false
    },
    borrower: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.borrowers,
        required: true,
    },
    invoiceSentDate: {
        type: Date,
        required: false,
        default: null,
    },
    dueDate: {
        type: Date,
        required: false,
        default: null,
    },
    stopFundingDate: {
        type: Date,
        required: false,
        default: null,
    },
    lastReminderSentAt: {
        type: Date,
        required: false,
        default: null,
    },
    accountClearedDate: {
        type: Date,
        required: false,
        default: null,
    },
    amountOwed: {
        type: Number,
        required: false,
        default: null,
    },
    addToLoan: {
        type: Boolean,
        required: false,
        default: null,
    },
    willPayIn: {
        type: Boolean,
        required: false,
        default: null,
    },
    transferDone: {
        type: Boolean,
        required: false,
        default: null,
    },
    amountReceived: {
        type: Number,
        required: false,
        default: null,
    },
    balanceOutstanding: {
        type: Number,
        required: false,
        default: null,
    },
    reminderCounter: {
        type: Number,
        required: false,
        default: 0,
    },
    __v: { type: Number, select: false },
});
exports.FinancialComplianceBorrowerSchema.plugin(mongooseLeanId);
exports.default = mongoose_1.default.model(_models_1.MODEL_NAMES.financialComplianceBorrowers, exports.FinancialComplianceBorrowerSchema);
