payservedb 6.3.0 → 6.3.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 +1 -1
- package/src/models/water_invoice.js +39 -1
package/package.json
CHANGED
|
@@ -36,6 +36,44 @@ const waterInvoiceSchema = new mongoose.Schema(
|
|
|
36
36
|
type: Number,
|
|
37
37
|
default: 0
|
|
38
38
|
},
|
|
39
|
+
|
|
40
|
+
// Biller Address Information (added from WaterMeterSettings)
|
|
41
|
+
billerAddress: {
|
|
42
|
+
name: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: [true, "Biller name is required"],
|
|
45
|
+
trim: true,
|
|
46
|
+
minlength: [1, "Biller name must be at least 1 character long"],
|
|
47
|
+
},
|
|
48
|
+
email: {
|
|
49
|
+
type: String,
|
|
50
|
+
required: [true, "Biller email is required"],
|
|
51
|
+
trim: true,
|
|
52
|
+
lowercase: true,
|
|
53
|
+
validate: {
|
|
54
|
+
validator: function (v) {
|
|
55
|
+
return /^\w+([\.-]?\w+)@\w+([\.-]?\w+)(\.\w{2,3})+$/.test(v);
|
|
56
|
+
},
|
|
57
|
+
message: "Please enter a valid email address"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
phone: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: [true, "Biller phone is required"],
|
|
63
|
+
trim: true,
|
|
64
|
+
},
|
|
65
|
+
address: {
|
|
66
|
+
type: String,
|
|
67
|
+
required: [true, "Biller address is required"],
|
|
68
|
+
trim: true,
|
|
69
|
+
},
|
|
70
|
+
city: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: [true, "Biller city is required"],
|
|
73
|
+
trim: true,
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
|
|
39
77
|
// Dates
|
|
40
78
|
dateIssued: {
|
|
41
79
|
type: Date,
|
|
@@ -190,4 +228,4 @@ waterInvoiceSchema.pre('save', function (next) {
|
|
|
190
228
|
|
|
191
229
|
const WaterInvoice = mongoose.model('WaterInvoice', waterInvoiceSchema);
|
|
192
230
|
|
|
193
|
-
module.exports = WaterInvoice;
|
|
231
|
+
module.exports = WaterInvoice;
|