import mongoose, { Document } from 'mongoose';
import { MODEL_NAMES } from './_models';

export interface IBorrowerDataBank {
  name: string;
  accountNumber: string;
  purpose: string;
  DACA: boolean;
  plaid: boolean;
}

export interface IBorrowerDataBankDoc extends IBorrowerDataBank, Document {
}

export const BorrowerDataBankSchema = new mongoose.Schema(
  {
    name: {
      type: String,
      required: true,
    },
    accountNumber: {
      type: String,
      required: true,
    },
    purpose: {
      type: String,
    },
    DACA: {
      type: Boolean,
    },
    plaid: {
      type: Boolean,
    },
  },
  { timestamps: false, versionKey: false },
);

export const BorrowerDataBankModel: mongoose.Model<IBorrowerDataBankDoc> = mongoose.model<IBorrowerDataBankDoc>(MODEL_NAMES.borrowerDataBanks, BorrowerDataBankSchema);
