payservedb 7.9.9 → 8.0.0

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.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,28 @@
1
+ const FacilityBillingPriceSchema = new mongoose.Schema({
2
+ facilityId: {
3
+ type: mongoose.Schema.Types.ObjectId,
4
+ ref: 'Facility',
5
+ required: true
6
+ },
7
+ levy: {
8
+ type: Number,
9
+ required: true
10
+ },
11
+ lease: {
12
+ type: Number,
13
+ required: true
14
+ },
15
+ powerMeters: {
16
+ type: Number,
17
+ required: true
18
+ },
19
+ waterMeters: {
20
+ type: Number,
21
+ required: true
22
+ },
23
+
24
+ });
25
+
26
+ const FacilityBillingPrice = mongoose.model('FacilityBillingPrice', FacilityBillingPriceSchema);
27
+
28
+ 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;