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

export interface IBorrowerDataInsurance {
  type: string;
  coverageAmount: number;
  policyDates: string;
  company: string;
  notes: string;
}

export interface IBorrowerDataInsuranceDoc extends IBorrowerDataInsurance, Document {
}

export const BorrowerDataInsuranceSchema = new mongoose.Schema(
  {
    type: {
      type: String,
      required: true,
    },
    coverageAmount: {
      type: Number,
      required: true,
    },
    policyDates: {
      type: String,
    },
    company: {
      type: String,
    },
    notes: {
      type: String,
    },
  },
  { timestamps: false, versionKey: false },
);

export const BorrowerDataInsuranceModel: mongoose.Model<IBorrowerDataInsuranceDoc> = mongoose.model<IBorrowerDataInsuranceDoc>(MODEL_NAMES.borrowerDataInsurances, BorrowerDataInsuranceSchema);
