"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LoanStatementTransactionModel = exports.LoanStatementSchema = exports.LOAN_STATEMENT_TRANSACTION_FIELDS = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
exports.LOAN_STATEMENT_TRANSACTION_FIELDS = [
    '_id',
    'date',
    'chargeId',
    'amount',
    'amountPaid',
    'balance',
    'isSystem',
    'memo',
    'userId',
];
exports.LoanStatementSchema = new mongoose_1.default.Schema({
    order: {
        type: Number,
        required: true,
        default: 0,
    },
    date: {
        type: Date,
        required: true,
    },
    chargeId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.loanCharges,
        required: true,
    },
    amount: {
        type: Number,
        required: true,
    },
    amountPaid: {
        type: Number,
        required: false,
    },
    balance: {
        type: Number,
        required: false,
    },
    isSystem: {
        type: Boolean,
        default: true,
    },
    memo: {
        type: String,
    },
    settlementCode: {
        type: String,
    },
    userId: {
        type: String,
        required: false,
    },
    __v: { type: Number, select: false },
}, { timestamps: true });
exports.LoanStatementTransactionModel = mongoose_1.default.model(_models_1.MODEL_NAMES.loanStatements, exports.LoanStatementSchema);
