payservedb 8.6.6 → 8.6.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "8.6.6",
3
+ "version": "8.6.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -27,6 +27,15 @@ const bookingReservationSchema = new mongoose.Schema({
27
27
  reason: {
28
28
  type: String
29
29
  },
30
+ status: {
31
+ type: String,
32
+ enum: ['Unpaid', 'Partially Paid', 'Paid'],
33
+ default: 'Unpaid'
34
+ },
35
+ paidAmount: {
36
+ type: Number,
37
+ default: 0
38
+ },
30
39
  addedAt: {
31
40
  type: Date,
32
41
  default: Date.now
@@ -195,7 +204,21 @@ const bookingReservationSchema = new mongoose.Schema({
195
204
  cancellationDetails: {
196
205
  date: Date,
197
206
  reason: String,
198
- refundAmount: Number
207
+ refundAmount: Number,
208
+ refundStatus: {
209
+ type: String,
210
+ enum: ["Pending", "Approved", "Rejected"],
211
+ default: "Pending"
212
+ },
213
+ refundPaymentId: {
214
+ type: mongoose.Schema.Types.ObjectId,
215
+ ref: "CashPayment"
216
+ },
217
+ refundReference: String,
218
+ refundRequestedAt: Date,
219
+ refundApprovedAt: Date,
220
+ refundRejectedAt: Date,
221
+ refundRejectionReason: String
199
222
  },
200
223
  createdBy: {
201
224
  type: mongoose.Schema.Types.ObjectId,
@@ -160,6 +160,27 @@ const cashPaymentSchema = new mongoose.Schema(
160
160
  notes: String
161
161
  },
162
162
  paymentNotes: String,
163
+ isRefund: {
164
+ type: Boolean,
165
+ default: false
166
+ },
167
+ refundDetails: {
168
+ reservationId: {
169
+ type: mongoose.Schema.Types.ObjectId,
170
+ ref: "BookingReservation",
171
+ default: null
172
+ },
173
+ bookingReservationId: {
174
+ type: String,
175
+ default: null
176
+ },
177
+ bookingInvoiceId: {
178
+ type: mongoose.Schema.Types.ObjectId,
179
+ ref: "BookingInvoice",
180
+ default: null
181
+ },
182
+ reason: String
183
+ },
163
184
  attachments: [
164
185
  {
165
186
  fileId: mongoose.Schema.Types.ObjectId,
@@ -147,7 +147,7 @@ const combinedInvoiceSchema = new mongoose.Schema(
147
147
  type: {
148
148
  type: String,
149
149
  required: true,
150
- enum: ["levy", "lease", "water", "service", "utility", "other"],
150
+ enum: ["levy", "lease", "water", "service", "utility", "contract"],
151
151
  },
152
152
  description: {
153
153
  type: String,