import { Schema, Types } from 'mongoose';

export const RentLeadSchema = new Schema({
  propertyCategory: { type: String },
  propertySize: {
    type: Schema.Types.Decimal128,
    get: (v) => (v ? parseFloat(v.toString()) : v),
  },
  furnishingStatus: String,
  propertyBedrooms: { type: String },
  rentAmount: {
    type: Schema.Types.Decimal128,
    get: (v) => (v ? parseFloat(v.toString()) : v),
  },
  securityDeposit: {
    type: Schema.Types.Decimal128,
    get: (v) => (v ? parseFloat(v.toString()) : v),
  },
  availableFrom: Date,
  addressLine1: String,
  addressLine2: String,
  landmark: String,
  state: { type: Types.ObjectId, ref: 'State' },
  propertyCity: { type: Types.ObjectId, ref: 'City' },
  country: { type: Types.ObjectId, ref: 'Country' },
  propertyLocality: { type: Types.ObjectId, ref: 'Area' },
  pincode: Number,
});
