payservedb 6.3.6 → 6.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -12,6 +12,10 @@ const bookingPropertySchema = new mongoose.Schema({
|
|
|
12
12
|
ref: 'Unit',
|
|
13
13
|
required: true
|
|
14
14
|
},
|
|
15
|
+
managedByLandlord: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
15
19
|
division: {
|
|
16
20
|
type: String,
|
|
17
21
|
required: false
|
|
@@ -25,12 +29,16 @@ const bookingPropertySchema = new mongoose.Schema({
|
|
|
25
29
|
}],
|
|
26
30
|
basePrice: {
|
|
27
31
|
type: Number,
|
|
28
|
-
required:
|
|
32
|
+
required: function () {
|
|
33
|
+
return !this.managedByLandlord;
|
|
34
|
+
}
|
|
29
35
|
},
|
|
30
36
|
currencyId: {
|
|
31
37
|
type: mongoose.Schema.Types.ObjectId,
|
|
32
38
|
ref: 'Currency',
|
|
33
|
-
required:
|
|
39
|
+
required: function () {
|
|
40
|
+
return !this.managedByLandlord;
|
|
41
|
+
}
|
|
34
42
|
},
|
|
35
43
|
weekendPriceAdjustment: {
|
|
36
44
|
type: Number,
|
|
@@ -59,7 +67,9 @@ const bookingPropertySchema = new mongoose.Schema({
|
|
|
59
67
|
},
|
|
60
68
|
commission: {
|
|
61
69
|
type: Number,
|
|
62
|
-
required:
|
|
70
|
+
required: function () {
|
|
71
|
+
return !this.managedByLandlord;
|
|
72
|
+
},
|
|
63
73
|
default: 10 // Default commission percentage
|
|
64
74
|
},
|
|
65
75
|
blockedDates: [{
|
|
@@ -99,29 +99,29 @@ const bookingReservationSchema = new mongoose.Schema({
|
|
|
99
99
|
},
|
|
100
100
|
basePrice: {
|
|
101
101
|
type: Number,
|
|
102
|
-
required:
|
|
102
|
+
required: false
|
|
103
103
|
},
|
|
104
104
|
totalAmount: {
|
|
105
105
|
type: Number,
|
|
106
|
-
required:
|
|
106
|
+
required: false
|
|
107
107
|
},
|
|
108
108
|
commission: {
|
|
109
109
|
type: Number,
|
|
110
|
-
required:
|
|
110
|
+
required: false
|
|
111
111
|
},
|
|
112
112
|
landlordAmount: {
|
|
113
113
|
type: Number,
|
|
114
|
-
required:
|
|
114
|
+
required: false
|
|
115
115
|
},
|
|
116
116
|
currencyId: {
|
|
117
117
|
type: mongoose.Schema.Types.ObjectId,
|
|
118
118
|
ref: 'Currency',
|
|
119
|
-
required:
|
|
119
|
+
required: false
|
|
120
120
|
},
|
|
121
121
|
paymentMethod: {
|
|
122
122
|
type: String,
|
|
123
123
|
enum: ['Cash', 'Card', 'Bank Transfer', 'Mobile Money', 'Other'],
|
|
124
|
-
required:
|
|
124
|
+
required: false
|
|
125
125
|
},
|
|
126
126
|
paymentTiming: {
|
|
127
127
|
type: String,
|
|
@@ -19,11 +19,11 @@ const masterWorkplanSchema = new mongoose.Schema({
|
|
|
19
19
|
enum: ["Active", "Inactive"],
|
|
20
20
|
default: "Active",
|
|
21
21
|
},
|
|
22
|
-
status: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
22
|
+
// status: {
|
|
23
|
+
// type: String,
|
|
24
|
+
// enum: ["Approved", "Rejected", "Pending"],
|
|
25
|
+
// default: "Approved",
|
|
26
|
+
// },
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const MasterWorkplan = mongoose.model("MasterWorkplan", masterWorkplanSchema);
|
package/src/models/units.js
CHANGED
|
@@ -52,11 +52,15 @@ const unitSchema = new mongoose.Schema({
|
|
|
52
52
|
},
|
|
53
53
|
propertyManagerName: {
|
|
54
54
|
type: String,
|
|
55
|
-
required: function() {
|
|
55
|
+
required: function () {
|
|
56
56
|
return this.isManagedByPropertyManager === true;
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
-
|
|
59
|
+
isListedForBooking: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
|
|
60
64
|
occupants: [
|
|
61
65
|
{
|
|
62
66
|
customerId: { type: mongoose.Schema.Types.ObjectId, ref: 'Customer' },
|
|
@@ -106,6 +110,7 @@ unitSchema.pre('save', function (next) {
|
|
|
106
110
|
// Indexes for improved performance
|
|
107
111
|
unitSchema.index({ name: 1 });
|
|
108
112
|
unitSchema.index({ isManagedByPropertyManager: 1 });
|
|
113
|
+
unitSchema.index({ isListedForBooking: 1 });
|
|
109
114
|
|
|
110
115
|
// Compile the model from the schema
|
|
111
116
|
const Unit = mongoose.model('Unit', unitSchema);
|