"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AllocatedBankTransaction = exports.AllocatedBankTransactionSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const CashAllocationProduct_model_1 = require("./CashAllocationProduct.model");
const _models_1 = require("./_models");
exports.AllocatedBankTransactionSchema = new mongoose_1.default.Schema({
    uploadedBankTransactionId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.uploadedBankTransactions,
        required: false,
    },
    order: {
        type: Number,
        required: true,
    },
    date: {
        type: Date,
        required: true,
    },
    accountNumber: {
        type: String,
        required: false,
        trim: true,
    },
    amount: {
        type: Number,
        required: true,
    },
    reference: {
        type: String,
        required: false,
        trim: true,
    },
    class: {
        type: String,
        required: false,
        trim: true,
    },
    location: {
        type: String,
        required: false,
        trim: true,
    },
    cashAllocationReferenceId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.cashAllocationReferences,
        required: false,
    },
    cashAllocationProductId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.cashAllocationProducts,
        required: false,
    },
    splitTransactionId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.cashAllocationReferences,
        required: false,
    },
    memo: {
        type: String,
        required: false,
        trim: true,
    },
    accounts: CashAllocationProduct_model_1.AccountSchema,
}, { timestamps: { createdAt: true, updatedAt: false } });
exports.AllocatedBankTransaction = mongoose_1.default.model(_models_1.MODEL_NAMES.allocatedBankTransactions, exports.AllocatedBankTransactionSchema);
