payservedb 3.4.7 → 3.4.9
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
|
@@ -69,7 +69,15 @@ const leaseAgreementSchema = new mongoose.Schema({
|
|
|
69
69
|
billingCycle: {
|
|
70
70
|
frequency: { type: String, enum: ['Monthly', 'Quarterly', 'Annually'], required: true },
|
|
71
71
|
nextInvoiceDate: { type: Date },
|
|
72
|
-
autoSend: { type: Boolean, default: false }
|
|
72
|
+
autoSend: { type: Boolean, default: false },
|
|
73
|
+
overdue: {
|
|
74
|
+
reminderDays: {
|
|
75
|
+
type: Number,
|
|
76
|
+
default: 7,
|
|
77
|
+
min: 0,
|
|
78
|
+
max: 30 // Reasonable limit for overdue reminders
|
|
79
|
+
}
|
|
80
|
+
}
|
|
73
81
|
},
|
|
74
82
|
invoices: [
|
|
75
83
|
{ type: mongoose.Schema.Types.ObjectId, ref: 'Invoice' }
|
|
@@ -101,11 +109,11 @@ const leaseAgreementSchema = new mongoose.Schema({
|
|
|
101
109
|
payments: [
|
|
102
110
|
{
|
|
103
111
|
invoiceId: { type: mongoose.Schema.Types.ObjectId, ref: 'Invoice', required: true },
|
|
104
|
-
method: {
|
|
105
|
-
type: {
|
|
106
|
-
type: String,
|
|
107
|
-
enum: ['Bank Transfer', 'Mobile Money', 'Cash', 'Cheque'],
|
|
108
|
-
required: true
|
|
112
|
+
method: {
|
|
113
|
+
type: {
|
|
114
|
+
type: String,
|
|
115
|
+
enum: ['Bank Transfer', 'Mobile Money', 'Cash', 'Cheque'],
|
|
116
|
+
required: true
|
|
109
117
|
},
|
|
110
118
|
details: {
|
|
111
119
|
// Capture specific details of the payment method used
|
|
@@ -41,8 +41,8 @@ const meterSchema = new mongoose.Schema({
|
|
|
41
41
|
status: {
|
|
42
42
|
type: String,
|
|
43
43
|
required: true,
|
|
44
|
-
enum: ['
|
|
45
|
-
default: '
|
|
44
|
+
enum: ['open', 'closed', 'maintenance', 'faulty'],
|
|
45
|
+
default: 'closed',
|
|
46
46
|
},
|
|
47
47
|
initialReading: {
|
|
48
48
|
type: Number,
|
package/src/models/tickets.js
CHANGED
|
@@ -10,6 +10,10 @@ const ticketSchema = new mongoose.Schema({
|
|
|
10
10
|
type: String,
|
|
11
11
|
required: true,
|
|
12
12
|
},
|
|
13
|
+
userId: {
|
|
14
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
15
|
+
ref: 'User',
|
|
16
|
+
},
|
|
13
17
|
subject: {
|
|
14
18
|
type: String,
|
|
15
19
|
},
|
|
@@ -65,8 +69,8 @@ const ticketSchema = new mongoose.Schema({
|
|
|
65
69
|
},
|
|
66
70
|
closingReason: {
|
|
67
71
|
type: String,
|
|
68
|
-
required:
|
|
69
|
-
|
|
72
|
+
required: false,
|
|
73
|
+
},
|
|
70
74
|
reviewText: {
|
|
71
75
|
type: String,
|
|
72
76
|
required: false,
|
|
@@ -103,4 +107,4 @@ const ticketSchema = new mongoose.Schema({
|
|
|
103
107
|
timestamps: true,
|
|
104
108
|
});
|
|
105
109
|
|
|
106
|
-
module.exports = mongoose.model('Ticket',
|
|
110
|
+
module.exports = mongoose.model('Ticket', ticketSchema);
|