payservedb 1.5.9 → 1.6.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/package.json +1 -1
- package/src/models/contract.js +5 -9
- package/src/models/reminder.js +43 -0
package/package.json
CHANGED
package/src/models/contract.js
CHANGED
|
@@ -5,15 +5,6 @@ const contractSchema = new mongoose.Schema({
|
|
|
5
5
|
type: String,
|
|
6
6
|
required: true
|
|
7
7
|
},
|
|
8
|
-
contractPhoneNumber: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
idNumber: {
|
|
13
|
-
type: Number,
|
|
14
|
-
required: true
|
|
15
|
-
|
|
16
|
-
},
|
|
17
8
|
contractStart: {
|
|
18
9
|
type: Date,
|
|
19
10
|
required: true
|
|
@@ -22,6 +13,11 @@ const contractSchema = new mongoose.Schema({
|
|
|
22
13
|
type: Date,
|
|
23
14
|
required: true
|
|
24
15
|
},
|
|
16
|
+
levy: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
units: [],
|
|
25
21
|
facilityId: {
|
|
26
22
|
type: mongoose.Schema.Types.ObjectId,
|
|
27
23
|
ref: 'Facility',
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
// Define the schema for companies
|
|
4
|
+
const reminderSchema = new mongoose.Schema({
|
|
5
|
+
title: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
module: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
type: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
time: {
|
|
18
|
+
type: Timestamp,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
day: {
|
|
22
|
+
type: Number,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
isActive: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
facilityId: {
|
|
30
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
31
|
+
ref: 'Facility',
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Indexes for improved performance
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
// Compile the model from the schema
|
|
41
|
+
const Reminder = mongoose.model('Reminder', reminderSchema);
|
|
42
|
+
|
|
43
|
+
module.exports = Reminder;
|