const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const BankAccountBalanceSchema = new Schema({
  bankAccountId: {
    type: Schema.Types.ObjectId,
    ref: 'BankAccount', // Reference to the BankAccount model
    required: true
  },
  balance: {
    type: Number,
    required: true,
    default: 0
  }
}, {
  timestamps: true // Enable timestamps for createdAt and updatedAt
});

module.exports = mongoose.model('BankAccountBalance', BankAccountBalanceSchema);
