payservedb 3.3.9 → 3.4.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
|
@@ -31,7 +31,26 @@ const leaseAgreementSchema = new mongoose.Schema({
|
|
|
31
31
|
financialTerms: {
|
|
32
32
|
monthlyRent: { type: Number, required: true },
|
|
33
33
|
paymentDueDate: { type: Number, required: true },
|
|
34
|
-
paymentMethod: {
|
|
34
|
+
paymentMethod: {
|
|
35
|
+
type: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: true,
|
|
38
|
+
enum: ['Bank Transfer', 'Mobile Money', 'Cash', 'Cheque']
|
|
39
|
+
},
|
|
40
|
+
details: {
|
|
41
|
+
// For Bank Transfer
|
|
42
|
+
bankName: String,
|
|
43
|
+
accountName: String,
|
|
44
|
+
accountNumber: String,
|
|
45
|
+
branch: String,
|
|
46
|
+
swiftCode: String,
|
|
47
|
+
// For Mobile Money
|
|
48
|
+
phoneNumber: String,
|
|
49
|
+
provider: String,
|
|
50
|
+
accountName: String,
|
|
51
|
+
// For Cash/Cheque, no additional details needed
|
|
52
|
+
}
|
|
53
|
+
},
|
|
35
54
|
securityDeposit: { type: Number, required: true }
|
|
36
55
|
},
|
|
37
56
|
billingCycle: {
|
|
@@ -85,4 +104,4 @@ const leaseAgreementSchema = new mongoose.Schema({
|
|
|
85
104
|
|
|
86
105
|
const LeaseAgreement = mongoose.model('LeaseAgreement', leaseAgreementSchema);
|
|
87
106
|
|
|
88
|
-
module.exports =
|
|
107
|
+
module.exports = LeaseAgreement;
|
|
@@ -14,6 +14,13 @@ const meterSchema = new mongoose.Schema({
|
|
|
14
14
|
required: true,
|
|
15
15
|
trim: true,
|
|
16
16
|
unique: true,
|
|
17
|
+
index: true
|
|
18
|
+
},
|
|
19
|
+
accountNumber: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
trim: true,
|
|
23
|
+
unique: true
|
|
17
24
|
},
|
|
18
25
|
isInstalled: {
|
|
19
26
|
type: Boolean,
|
|
@@ -51,6 +58,8 @@ const meterSchema = new mongoose.Schema({
|
|
|
51
58
|
timestamps: true,
|
|
52
59
|
});
|
|
53
60
|
|
|
61
|
+
meterSchema.index({ serialNumber: 1, status: 1 });
|
|
62
|
+
|
|
54
63
|
const Meter = mongoose.model('Meter', meterSchema);
|
|
55
64
|
|
|
56
65
|
module.exports = Meter;
|