payservedb 9.4.9 → 9.5.1
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
|
@@ -92,9 +92,14 @@ const bookingReservationSchema = new mongoose.Schema({
|
|
|
92
92
|
type: String,
|
|
93
93
|
required: true
|
|
94
94
|
},
|
|
95
|
+
// Not required: guests booking online (external API / widget) often
|
|
96
|
+
// don't have this to hand until check-in, and both create_reservation.js
|
|
97
|
+
// (internal) and create_booking.js (external) already treat it as
|
|
98
|
+
// optional at their own validation layer, defaulting to '' - this
|
|
99
|
+
// schema requirement was rejecting exactly those bookings.
|
|
95
100
|
idNumber: {
|
|
96
101
|
type: String,
|
|
97
|
-
|
|
102
|
+
default: ''
|
|
98
103
|
}
|
|
99
104
|
},
|
|
100
105
|
checkIn: {
|
|
@@ -104,9 +104,11 @@ const propertyManagerRevenueEntrySchema = new mongoose.Schema({
|
|
|
104
104
|
timestamps: true
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
// A source document can only generate one entry per revenue stream
|
|
107
|
+
// A source document can only generate one entry per revenue stream, per
|
|
108
|
+
// unit - a multi-unit management-fee invoice (one source document) now
|
|
109
|
+
// generates one entry per unit it covers, so `unit` is part of the key.
|
|
108
110
|
propertyManagerRevenueEntrySchema.index(
|
|
109
|
-
{ facility: 1, source: 1, 'reference.id': 1 },
|
|
111
|
+
{ facility: 1, source: 1, 'reference.id': 1, unit: 1 },
|
|
110
112
|
{ unique: true }
|
|
111
113
|
);
|
|
112
114
|
propertyManagerRevenueEntrySchema.index({ facility: 1, 'propertyManager.id': 1, source: 1, earnedDate: -1 });
|