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

export interface IBorrowerDataInventory {
  description: string;
  advanceRate: number;
}

export interface IBorrowerDataInventoryDoc extends IBorrowerDataInventory, Document {
}

export const BorrowerDataInventorySchema = new mongoose.Schema(
  {
    description: {
      type: String,
      required: true,
    },
    advanceRate: {
      type: Number,
    },
  },
  { timestamps: false, versionKey: false },
);

export const BorrowerDataInventoryModel: mongoose.Model<IBorrowerDataInventoryDoc> = mongoose.model<IBorrowerDataInventoryDoc>(MODEL_NAMES.borrowerDataInventories, BorrowerDataInventorySchema);
