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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "9.4.9",
3
+ "version": "9.5.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -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
- required: true
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 });
@@ -62,6 +62,13 @@ const concentratorSchema = new mongoose.Schema({
62
62
  },
63
63
  lastUpdated: {
64
64
  type: String
65
+ },
66
+ concentratorId: {
67
+ type: String,
68
+ trim: true
69
+ },
70
+ lastCommunicationTime: {
71
+ type: Date
65
72
  }
66
73
  }, {
67
74
  timestamps: true