2024-09-12 08:11:07 +00:00
|
|
|
import mongoose from "mongoose";
|
|
|
|
|
2024-09-24 17:24:12 +00:00
|
|
|
// Schema for property tax information
|
|
|
|
const propertyTaxInfoSchema = mongoose.Schema({
|
|
|
|
propertytaxowned: { type: String },
|
|
|
|
ownedyear: { type: String },
|
|
|
|
taxassessed: { type: String },
|
|
|
|
taxyear: { type: String },
|
|
|
|
});
|
|
|
|
|
|
|
|
// Schema for images
|
|
|
|
const imageSchema = mongoose.Schema({
|
|
|
|
title: { type: String }, // Title of the image
|
|
|
|
file: { type: String }, // Uploaded image URL
|
2024-09-12 08:11:07 +00:00
|
|
|
});
|
|
|
|
|
2024-09-24 17:24:12 +00:00
|
|
|
const propertySchema = mongoose.Schema({
|
|
|
|
address: { type: String, required: true },
|
|
|
|
city: { type: String, required: true },
|
|
|
|
state: { type: String, required: true },
|
|
|
|
county: { type: String, required: true },
|
|
|
|
zip: { type: String, required: true },
|
|
|
|
parcel: { type: String, required: true },
|
|
|
|
subdivision: { type: String, required: true },
|
|
|
|
legal: { type: String, required: true },
|
2024-09-25 11:41:19 +00:00
|
|
|
costpersqft: { type: String, required: true },
|
2024-09-24 17:24:12 +00:00
|
|
|
propertyType: { type: String, required: true },
|
|
|
|
lotacres: { type: String, required: true },
|
|
|
|
yearBuild: { type: String, required: true },
|
|
|
|
totallivingsqft: { type: String, required: true },
|
|
|
|
beds: { type: String, required: true },
|
|
|
|
baths: { type: String, required: true },
|
|
|
|
stories: { type: String, required: true },
|
|
|
|
garage: { type: String, required: true },
|
|
|
|
garagesqft: { type: String, required: true },
|
|
|
|
poolspa: { type: String, required: true },
|
|
|
|
fireplaces: { type: String, required: true },
|
|
|
|
ac: { type: String, required: true },
|
|
|
|
heating: { type: String, required: true },
|
|
|
|
buildingstyle: { type: String, required: true },
|
|
|
|
sitevacant: { type: String, required: true },
|
|
|
|
extwall: { type: String, required: true },
|
|
|
|
roofing: { type: String, required: true },
|
|
|
|
totalSqft: { type: String, required: true },
|
|
|
|
// Remove individual property tax fields and replace with array
|
|
|
|
propertyTaxInfo: [propertyTaxInfoSchema], // Array of tax info objects
|
|
|
|
images: [imageSchema],
|
2024-10-07 07:51:43 +00:00
|
|
|
googleMapLink: { type: String },
|
2024-09-24 17:24:12 +00:00
|
|
|
userfirstname: String,
|
|
|
|
usermiddlename: String,
|
|
|
|
userlastname: String,
|
|
|
|
usertitle: String,
|
|
|
|
creator: String,
|
|
|
|
useremail: String,
|
|
|
|
propertyId: String,
|
|
|
|
userId: String,
|
|
|
|
createdAt: {
|
|
|
|
type: Date,
|
|
|
|
default: new Date(),
|
|
|
|
},
|
|
|
|
publishedAt: {
|
|
|
|
type: Date,
|
|
|
|
default: new Date(),
|
|
|
|
},
|
|
|
|
currentYear: {
|
|
|
|
type: Number,
|
|
|
|
default: new Date().getFullYear(),
|
|
|
|
},
|
2024-10-08 16:52:49 +00:00
|
|
|
closeDateAtoB:{
|
2024-10-08 16:41:27 +00:00
|
|
|
type: Date,
|
|
|
|
required: true,
|
2024-10-08 16:23:59 +00:00
|
|
|
},
|
2024-10-08 16:52:49 +00:00
|
|
|
closeDateBtoC:{
|
2024-10-08 16:41:27 +00:00
|
|
|
type: Date,
|
|
|
|
required: true,
|
2024-10-08 16:23:59 +00:00
|
|
|
},
|
2024-10-09 04:56:53 +00:00
|
|
|
renovationRisk: {
|
2024-10-09 04:37:39 +00:00
|
|
|
type: Number,
|
2024-10-09 04:56:53 +00:00
|
|
|
required: true,
|
2024-10-09 04:37:39 +00:00
|
|
|
},
|
2024-10-06 13:55:53 +00:00
|
|
|
purchaseCost: {
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
costPaidAtoB: [
|
|
|
|
{
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
price: {
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2024-10-09 06:57:21 +00:00
|
|
|
totalPurchaseCosts: {
|
2024-10-06 13:55:53 +00:00
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
credits: [
|
|
|
|
{
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
price: {
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2024-10-07 07:51:43 +00:00
|
|
|
totalcredits: {
|
2024-10-07 06:54:22 +00:00
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
2024-10-09 06:57:21 +00:00
|
|
|
totalPurchaseCostsaftercredits: {
|
2024-10-06 13:55:53 +00:00
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
2024-10-07 12:22:01 +00:00
|
|
|
cashAdjustments: [
|
|
|
|
{
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
price: {
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
totalcashAdjustments:{
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
2024-10-09 06:57:21 +00:00
|
|
|
|
|
|
|
totalcashrequiredonsettlement:{
|
2024-10-07 12:22:01 +00:00
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
2024-10-07 07:51:43 +00:00
|
|
|
incidentalCost: [
|
2024-10-07 06:31:08 +00:00
|
|
|
{
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
price: {
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
totalincidentalCost: {
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
2024-10-07 07:51:43 +00:00
|
|
|
utilMaintenance: [
|
|
|
|
{
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
price: {
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
totalutilMaintenanceCost: {
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
2024-10-07 12:22:01 +00:00
|
|
|
renovationCost: [
|
|
|
|
{
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
price: {
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
totalrenovationCost:{
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
2024-10-07 12:52:13 +00:00
|
|
|
costsAfterPropertyAcquisition:{
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
2024-10-07 14:23:54 +00:00
|
|
|
sellpricebtoc:{
|
|
|
|
type: Number,
|
|
|
|
required: true, // Set to true if this field is mandatory
|
|
|
|
},
|
2024-09-24 17:24:12 +00:00
|
|
|
});
|
2024-09-12 08:11:07 +00:00
|
|
|
|
|
|
|
const PropertyModal = mongoose.model("property", propertySchema);
|
|
|
|
|
2024-10-09 06:57:21 +00:00
|
|
|
export default PropertyModal;
|