payservedb 7.9.9 → 8.0.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/index.js CHANGED
@@ -216,7 +216,9 @@ const models = {
216
216
  CoreInvoiceSettings: require("./src/models/coreInvoiceSettings"),
217
217
  FacilityInvoice: require("./src/models/facilityInvoice"),
218
218
  CoreBaseSettings: require("./src/models/coreBaseSettings"),
219
- Recipient: require("./src/models/facilityInvoiceRecipient")
219
+ Recipient: require("./src/models/facilityInvoiceRecipient"),
220
+ FacilityBillingPrice: require("./src/models/facilityBillingPrices"),
221
+ FacilityInvoicePayment: require("./src/models/facilityInvoicePayment")
220
222
  };
221
223
 
222
224
  // Function to get models dynamically from a specific database connection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "7.9.9",
3
+ "version": "8.0.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,30 @@
1
+ const mongoose = require("mongoose");
2
+
3
+ const FacilityBillingPriceSchema = new mongoose.Schema({
4
+ facilityId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Facility',
7
+ required: true
8
+ },
9
+ levy: {
10
+ type: Number,
11
+ required: true
12
+ },
13
+ lease: {
14
+ type: Number,
15
+ required: true
16
+ },
17
+ powerMeters: {
18
+ type: Number,
19
+ required: true
20
+ },
21
+ waterMeters: {
22
+ type: Number,
23
+ required: true
24
+ },
25
+
26
+ });
27
+
28
+ const FacilityBillingPrice = mongoose.model('FacilityBillingPrice', FacilityBillingPriceSchema);
29
+
30
+ module.exports = FacilityBillingPrice;
@@ -0,0 +1,47 @@
1
+ const mongoose = require("mongoose");
2
+
3
+ const FacilityInvoicePaymentSchema = new mongoose.Schema({
4
+ facilityId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: "Facility",
7
+ required: true,
8
+ },
9
+ invoiceId: {
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: "FacilityInvoice",
12
+ required: true,
13
+ },
14
+ paymentDate: {
15
+ type: Date,
16
+ required: true,
17
+ },
18
+ amountPaid: {
19
+ type: Number,
20
+ required: true,
21
+ },
22
+ comments: {
23
+ type: String,
24
+ required: false,
25
+ },
26
+ status: {
27
+ type: String,
28
+ enum: ["pending", "paid", "overpaid", "rejected"],
29
+ default: "pending",
30
+ },
31
+ paymentMethod: {
32
+ type: String,
33
+ enum: ["cash", "credit", "debit"],
34
+ default: "cash",
35
+ },
36
+ rejectedReason: {
37
+ type: String,
38
+ required: false,
39
+ },
40
+ });
41
+
42
+ const FacilityInvoicePayment = mongoose.model(
43
+ "FacilityInvoicePayment",
44
+ FacilityInvoicePaymentSchema,
45
+ );
46
+
47
+ module.exports = FacilityInvoicePayment;