payservedb 7.9.5 → 7.9.7
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 +1 -0
- package/package.json +1 -1
- package/src/models/invoicing_schedule.js +37 -0
package/index.js
CHANGED
|
@@ -94,6 +94,7 @@ const models = {
|
|
|
94
94
|
LevyType: require("./src/models/levytype"),
|
|
95
95
|
LevyContract: require("./src/models/levycontract"),
|
|
96
96
|
Invoice: require("./src/models/invoice"),
|
|
97
|
+
InvoicingSchedule: require("./src/models/invoicing_schedule"),
|
|
97
98
|
Reminder: require("./src/models/reminder"),
|
|
98
99
|
Penalty: require("./src/models/penalty"),
|
|
99
100
|
Notifiaction: require("./src/models/notification"),
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
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
|
+
const InvoicingScheduleSchema = new mongoose.Schema({
|
|
10
|
+
facilityId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
unique: true,
|
|
14
|
+
index: true
|
|
15
|
+
},
|
|
16
|
+
nextInvoiceDate: {
|
|
17
|
+
type: Date,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
createdAt: {
|
|
21
|
+
type: Date,
|
|
22
|
+
default: Date.now
|
|
23
|
+
},
|
|
24
|
+
updatedAt: {
|
|
25
|
+
type: Date,
|
|
26
|
+
default: Date.now
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
InvoicingScheduleSchema.pre('save', function(next) {
|
|
31
|
+
this.updatedAt = Date.now();
|
|
32
|
+
next();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const InvoicingSchedule = mongoose.model('InvoicingSchedule', InvoicingScheduleSchema);
|
|
36
|
+
|
|
37
|
+
module.exports = InvoicingSchedule;
|