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

export interface IBorrowerDataContact {
  name: string;
  title: string;
  email: string;
  phone: string;
}

export interface IBorrowerDataContactDoc extends IBorrowerDataContact, Document {
}

export const BorrowerDataContactSchema = new mongoose.Schema(
  {
    name: {
      type: String,
      required: true,
    },
    title: {
      type: String,
    },
    email: {
      type: String,
    },
    phone: {
      type: String,
    },
  },
  { timestamps: false, versionKey: false },
);

export const BorrowerDataContactModel: mongoose.Model<IBorrowerDataContactDoc> = mongoose.model<IBorrowerDataContactDoc>(MODEL_NAMES.borrowerDataContacts, BorrowerDataContactSchema);
