payservedb 8.6.5 → 8.6.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "8.6.5",
3
+ "version": "8.6.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -135,6 +135,10 @@ const bookingPropertySchema = new mongoose.Schema({
135
135
  },
136
136
  notes: {
137
137
  type: String
138
+ },
139
+ reservationId: {
140
+ type: mongoose.Schema.Types.ObjectId,
141
+ ref: 'BookingReservation'
138
142
  }
139
143
  }],
140
144
  // For seasonal pricing or custom date ranges
@@ -171,4 +175,5 @@ const bookingPropertySchema = new mongoose.Schema({
171
175
  // Create model from schema
172
176
  const BookingProperty = mongoose.model('BookingProperty', bookingPropertySchema);
173
177
 
174
- module.exports = BookingProperty;
178
+ module.exports = BookingProperty;
179
+
@@ -41,6 +41,11 @@ const bookingReservationSchema = new mongoose.Schema({
41
41
  checkoutDate: {
42
42
  type: Date
43
43
  },
44
+ // Flag to indicate checkout is pending finance approval
45
+ checkoutPending: {
46
+ type: Boolean,
47
+ default: false
48
+ },
44
49
  facilityId: {
45
50
  type: mongoose.Schema.Types.ObjectId,
46
51
  ref: 'Facility',
@@ -207,4 +212,5 @@ const bookingReservationSchema = new mongoose.Schema({
207
212
  // Create model from schema
208
213
  const BookingReservation = mongoose.model('BookingReservation', bookingReservationSchema);
209
214
 
210
- module.exports = BookingReservation;
215
+ module.exports = BookingReservation;
216
+
@@ -5,6 +5,7 @@ const cashPaymentSchema = new mongoose.Schema(
5
5
  paymentReference: {
6
6
  type: String,
7
7
  required: true,
8
+ unique: true,
8
9
  trim: true
9
10
  },
10
11
  receiptNumber: {
@@ -27,6 +28,10 @@ const cashPaymentSchema = new mongoose.Schema(
27
28
  accountNumber: {
28
29
  type: String,
29
30
  trim: true
31
+ },
32
+ invoiceType: {
33
+ type: String,
34
+ trim: true
30
35
  }
31
36
  },
32
37
  client: {
@@ -89,7 +94,7 @@ const cashPaymentSchema = new mongoose.Schema(
89
94
  },
90
95
  paymentMethod: {
91
96
  type: String,
92
- enum: ['cash', 'bank-transfer', 'cheque', 'mpesa'],
97
+ enum: ['cash', 'bank-transfer', 'cheque'],
93
98
  default: 'cash'
94
99
  },
95
100
  exchangeRate: {
@@ -261,4 +266,5 @@ cashPaymentSchema.pre('save', function (next) {
261
266
  // Create model (only if not already defined by getModel utility)
262
267
  const CashPayment = mongoose.models.CashPayment || mongoose.model('CashPayment', cashPaymentSchema);
263
268
 
264
- module.exports = CashPayment;
269
+ module.exports = CashPayment;
270
+
@@ -129,6 +129,15 @@ const handoverSchema = new mongoose.Schema({
129
129
  min: 0
130
130
  },
131
131
  description: String,
132
+ currencyId: {
133
+ type: mongoose.Schema.Types.ObjectId,
134
+ ref: 'Currency',
135
+ default: null
136
+ },
137
+ currency: {
138
+ type: mongoose.Schema.Types.Mixed,
139
+ default: null
140
+ },
132
141
  invoiceId: {
133
142
  type: mongoose.Schema.Types.ObjectId,
134
143
  ref: 'Invoice',
@@ -245,4 +254,5 @@ handoverSchema.methods.compareWithMoveIn = async function() {
245
254
  // Create and export the model with the standard pattern
246
255
  const Handover = mongoose.model('Handover', handoverSchema);
247
256
 
248
- module.exports = Handover;
257
+ module.exports = Handover;
258
+