payservedb 2.4.3 → 2.4.5
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/levy.js +3 -3
- package/src/models/penalty.js +27 -24
- package/src/models/reminder.js +5 -0
package/package.json
CHANGED
package/src/models/levy.js
CHANGED
|
@@ -33,13 +33,13 @@ const levySchema = new mongoose.Schema(
|
|
|
33
33
|
required: true,
|
|
34
34
|
trim: true,
|
|
35
35
|
},
|
|
36
|
-
|
|
37
|
-
type:
|
|
36
|
+
invoiceDay: {
|
|
37
|
+
type: Number,
|
|
38
38
|
required: true,
|
|
39
39
|
},
|
|
40
40
|
disabled: {
|
|
41
41
|
type: Boolean,
|
|
42
|
-
required:
|
|
42
|
+
required: false,
|
|
43
43
|
},
|
|
44
44
|
facilityId: {
|
|
45
45
|
type: mongoose.Schema.Types.ObjectId,
|
package/src/models/penalty.js
CHANGED
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
const mongoose = require(
|
|
1
|
+
const mongoose = require("mongoose");
|
|
2
2
|
|
|
3
3
|
// Define the schema for Penalty
|
|
4
|
-
const penaltySchema = new mongoose.Schema(
|
|
4
|
+
const penaltySchema = new mongoose.Schema(
|
|
5
|
+
{
|
|
5
6
|
name: {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
8
9
|
},
|
|
9
10
|
type: {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
12
13
|
},
|
|
13
14
|
effectDays: {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
type: Number,
|
|
16
|
+
required: true,
|
|
16
17
|
},
|
|
17
18
|
percentage: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
type: Number,
|
|
20
|
+
required: false,
|
|
21
|
+
min: [0, "Percentage must be at least 0"],
|
|
21
22
|
},
|
|
22
23
|
amount: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
type: Number,
|
|
25
|
+
required: true,
|
|
26
|
+
min: [0, "Amount must be a positive number"],
|
|
26
27
|
},
|
|
27
28
|
isActive: {
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true,
|
|
30
31
|
},
|
|
31
32
|
facilityId: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
34
|
+
ref: "Facility",
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
timestamps: true,
|
|
40
|
+
}
|
|
41
|
+
);
|
|
39
42
|
|
|
40
|
-
const Penalty = mongoose.model(
|
|
43
|
+
const Penalty = mongoose.model("Penalty", penaltySchema);
|
|
41
44
|
|
|
42
45
|
module.exports = Penalty;
|
package/src/models/reminder.js
CHANGED