payservedb 7.9.8 → 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
|
@@ -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;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
const mongoose = require('mongoose');
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @description The schema for tracking invoicing schedules for each facility.
|
|
5
|
-
* This document is stored in the central invoice service database.
|
|
6
|
-
* It contains minimal data required for the service to function,
|
|
7
|
-
* avoiding the complexity of facility-specific data.
|
|
8
|
-
*/
|
|
9
3
|
const InvoicingScheduleSchema = new mongoose.Schema({
|
|
10
4
|
facilityId: {
|
|
11
|
-
type:
|
|
12
|
-
|
|
13
|
-
unique: true,
|
|
14
|
-
index: true
|
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
+
ref: 'Facility',
|
|
15
7
|
},
|
|
16
8
|
nextInvoiceDate: {
|
|
17
9
|
type: Date,
|
|
18
10
|
required: true
|
|
19
11
|
},
|
|
12
|
+
invoiceType: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
20
16
|
createdAt: {
|
|
21
17
|
type: Date,
|
|
22
18
|
default: Date.now
|