payservedb 3.0.7 → 3.0.9
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/customer.js +117 -0
- package/src/models/water_meter.js +31 -27
package/package.json
CHANGED
package/src/models/customer.js
CHANGED
|
@@ -54,6 +54,123 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
54
54
|
required: false,
|
|
55
55
|
enum: ['Active', 'Inactive']
|
|
56
56
|
},
|
|
57
|
+
|
|
58
|
+
familyMembers: [
|
|
59
|
+
{
|
|
60
|
+
no: {
|
|
61
|
+
type: Number,
|
|
62
|
+
required: false
|
|
63
|
+
},
|
|
64
|
+
name: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: false,
|
|
67
|
+
},
|
|
68
|
+
phoneNumber: {
|
|
69
|
+
type: String,
|
|
70
|
+
required: false,
|
|
71
|
+
},
|
|
72
|
+
email: {
|
|
73
|
+
type: String,
|
|
74
|
+
required: false
|
|
75
|
+
},
|
|
76
|
+
relation: {
|
|
77
|
+
type: String,
|
|
78
|
+
required: false,
|
|
79
|
+
},
|
|
80
|
+
qrCode: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
required: false
|
|
83
|
+
},
|
|
84
|
+
addVisitor: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
required: false
|
|
87
|
+
},
|
|
88
|
+
receiveMessage: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
required: false
|
|
91
|
+
},
|
|
92
|
+
qrUniqueCode:
|
|
93
|
+
{
|
|
94
|
+
type: String,
|
|
95
|
+
unique: false
|
|
96
|
+
},
|
|
97
|
+
disabled: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
required: false
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
staff: [
|
|
104
|
+
{
|
|
105
|
+
no: {
|
|
106
|
+
type: Number,
|
|
107
|
+
required: false
|
|
108
|
+
},
|
|
109
|
+
name: {
|
|
110
|
+
type: String,
|
|
111
|
+
required: false,
|
|
112
|
+
},
|
|
113
|
+
phoneNumber: {
|
|
114
|
+
type: String,
|
|
115
|
+
required: false,
|
|
116
|
+
},
|
|
117
|
+
jobRole: {
|
|
118
|
+
type: String,
|
|
119
|
+
required: false,
|
|
120
|
+
},
|
|
121
|
+
qrCode: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
required: false
|
|
124
|
+
},
|
|
125
|
+
qrUniqueCode:
|
|
126
|
+
{ type: String, unique: false },
|
|
127
|
+
|
|
128
|
+
disabled: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
required: false
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
vehicles: [
|
|
136
|
+
{
|
|
137
|
+
no: {
|
|
138
|
+
type: Number,
|
|
139
|
+
required: false
|
|
140
|
+
},
|
|
141
|
+
registration: {
|
|
142
|
+
type: String,
|
|
143
|
+
required: false
|
|
144
|
+
},
|
|
145
|
+
name: {
|
|
146
|
+
type: String,
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
149
|
+
model: {
|
|
150
|
+
type: String,
|
|
151
|
+
required: false
|
|
152
|
+
},
|
|
153
|
+
color:{
|
|
154
|
+
type:String,
|
|
155
|
+
required:false
|
|
156
|
+
},
|
|
157
|
+
plateNumber: {
|
|
158
|
+
type: String,
|
|
159
|
+
required: false
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
qrCode: {
|
|
163
|
+
type: Boolean,
|
|
164
|
+
required: false
|
|
165
|
+
},
|
|
166
|
+
qrUniqueCode: { type: String, unique: false }
|
|
167
|
+
,
|
|
168
|
+
disabled: {
|
|
169
|
+
type: Boolean,
|
|
170
|
+
required: false
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
],
|
|
57
174
|
});
|
|
58
175
|
|
|
59
176
|
const Customer = mongoose.model('Customer', CustomerSchema);
|
|
@@ -1,50 +1,54 @@
|
|
|
1
1
|
const mongoose = require('mongoose');
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
facilityId: {
|
|
5
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
-
ref: 'Facility',
|
|
7
|
-
},
|
|
3
|
+
const concentratorSchema = new mongoose.Schema({
|
|
8
4
|
serialNumber: {
|
|
9
5
|
type: String,
|
|
10
6
|
required: true,
|
|
11
7
|
trim: true,
|
|
12
|
-
unique: true
|
|
8
|
+
unique: true
|
|
13
9
|
},
|
|
14
10
|
manufacturer: {
|
|
15
11
|
type: String,
|
|
16
12
|
required: true,
|
|
17
|
-
trim: true
|
|
13
|
+
trim: true
|
|
18
14
|
},
|
|
19
|
-
|
|
20
|
-
type:
|
|
15
|
+
range: {
|
|
16
|
+
type: Number,
|
|
21
17
|
required: true,
|
|
22
|
-
|
|
18
|
+
min: 0
|
|
23
19
|
},
|
|
24
|
-
|
|
25
|
-
type:
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
isInstalled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
isFaulty: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
28
|
+
inStock: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
28
31
|
},
|
|
29
32
|
status: {
|
|
30
33
|
type: String,
|
|
31
34
|
required: true,
|
|
32
|
-
enum: ['
|
|
33
|
-
default: '
|
|
34
|
-
},
|
|
35
|
-
value: {
|
|
36
|
-
type: Number,
|
|
37
|
-
required: true,
|
|
38
|
-
min: 0,
|
|
39
|
-
default: 0,
|
|
35
|
+
enum: ['Online', 'Offline', 'Maintenance'],
|
|
36
|
+
default: 'Offline'
|
|
40
37
|
},
|
|
38
|
+
facilityId: {
|
|
39
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
40
|
+
ref: 'Facility',
|
|
41
|
+
required: true
|
|
42
|
+
}
|
|
41
43
|
}, {
|
|
42
|
-
timestamps: true
|
|
44
|
+
timestamps: true
|
|
43
45
|
});
|
|
44
46
|
|
|
45
|
-
// Add
|
|
46
|
-
|
|
47
|
+
// Add indexes for better query performance
|
|
48
|
+
concentratorSchema.index({ serialNumber: 1 });
|
|
49
|
+
concentratorSchema.index({ status: 1 });
|
|
50
|
+
concentratorSchema.index({ manufacturer: 1 });
|
|
47
51
|
|
|
48
|
-
const
|
|
52
|
+
const Concentrator = mongoose.model('Concentrator', concentratorSchema);
|
|
49
53
|
|
|
50
|
-
module.exports =
|
|
54
|
+
module.exports = Concentrator;
|