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

export interface IBorrowerDataLocation {
  address: string;
  landlordWaiver: boolean;
  keyDetails: string;
}

export interface IBorrowerDataLocationDoc extends IBorrowerDataLocation, Document {
}

export const BorrowerDataLocationSchema = new mongoose.Schema(
  {
    address: {
      type: String,
      required: true,
    },
    landlordWaiver: {
      type: Boolean,
    },
    keyDetails: {
      type: String,
    },
  },
  { timestamps: false, versionKey: false },
);

export const BorrowerDataLocationModel: mongoose.Model<IBorrowerDataLocationDoc> = mongoose.model<IBorrowerDataLocationDoc>(MODEL_NAMES.borrowerDataLocations, BorrowerDataLocationSchema);
