payservedb 2.4.1 → 2.4.3
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/invoice.js +2 -2
- package/src/models/levy.js +37 -30
package/package.json
CHANGED
package/src/models/invoice.js
CHANGED
|
@@ -74,7 +74,7 @@ const invoiceSchema = new mongoose.Schema(
|
|
|
74
74
|
reminderHistory: [
|
|
75
75
|
{
|
|
76
76
|
sentAt: Date,
|
|
77
|
-
reminderId: Schema.Types.ObjectId,
|
|
77
|
+
reminderId: mongoose.Schema.Types.ObjectId,
|
|
78
78
|
notificationTypes: [String],
|
|
79
79
|
},
|
|
80
80
|
],
|
|
@@ -92,4 +92,4 @@ const invoiceSchema = new mongoose.Schema(
|
|
|
92
92
|
|
|
93
93
|
const Invoice = mongoose.model("Invoice", invoiceSchema);
|
|
94
94
|
|
|
95
|
-
module.exports = Invoice;
|
|
95
|
+
module.exports = Invoice;
|
package/src/models/levy.js
CHANGED
|
@@ -1,51 +1,58 @@
|
|
|
1
|
-
const mongoose = require(
|
|
1
|
+
const mongoose = require("mongoose");
|
|
2
2
|
|
|
3
3
|
// Define the schema for Levy
|
|
4
|
-
const levySchema = new mongoose.Schema(
|
|
4
|
+
const levySchema = new mongoose.Schema(
|
|
5
|
+
{
|
|
5
6
|
levyName: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
trim: true,
|
|
10
|
+
minlength: [1, "Levy name must be at least 1 character long"],
|
|
10
11
|
},
|
|
11
12
|
levyType: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
14
|
+
ref: "LevyType",
|
|
15
|
+
required: true,
|
|
15
16
|
},
|
|
16
17
|
amount: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
type: Number,
|
|
19
|
+
required: true,
|
|
20
|
+
min: [0, "Amount must be a positive number"],
|
|
20
21
|
},
|
|
21
22
|
dueDate: {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
type: Date,
|
|
24
|
+
required: true,
|
|
24
25
|
},
|
|
25
26
|
levyApplicant: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
trim: true,
|
|
29
30
|
},
|
|
30
31
|
collectionFrequency: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
type: String,
|
|
33
|
+
required: true,
|
|
34
|
+
trim: true,
|
|
34
35
|
},
|
|
35
36
|
invoiceDate: {
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
type: Date,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
required: true,
|
|
38
43
|
},
|
|
39
44
|
facilityId: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
46
|
+
ref: "Facility",
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
timestamps: true,
|
|
52
|
+
}
|
|
53
|
+
);
|
|
47
54
|
|
|
48
55
|
// Compile the model from the schema
|
|
49
|
-
const Levy = mongoose.model(
|
|
56
|
+
const Levy = mongoose.model("Levy", levySchema);
|
|
50
57
|
|
|
51
58
|
module.exports = Levy;
|