"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BankIntegrationTransaction = exports.BankIntegrationTransactionSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
exports.BankIntegrationTransactionSchema = new mongoose_1.default.Schema({
    accountId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.bankIntegrationAccounts,
    },
    externalTransactionId: {
        type: String,
    },
    amount: {
        type: Number,
    },
    currency: {
        type: String,
    },
    postedAt: {
        type: Date,
    },
    type: {
        type: String,
    },
    status: {
        type: String,
    },
    rawPayload: {
        type: String,
    },
    text: {
        type: String,
    },
    description: {
        type: String,
    },
    syncedAt: {
        type: Date,
    },
}, { timestamps: true });
exports.BankIntegrationTransactionSchema.index({ accountId: 1, externalTransactionId: 1 }, { unique: true });
exports.BankIntegrationTransaction = mongoose_1.default.model(_models_1.MODEL_NAMES.bankIntegrationTransactions, exports.BankIntegrationTransactionSchema);
