payservedb 1.9.9 → 2.0.1
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 +9 -9
- package/src/models/entry_exit.js +22 -12
- package/src/models/waitlist.js +28 -0
package/package.json
CHANGED
package/src/models/customer.js
CHANGED
|
@@ -59,7 +59,7 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
59
59
|
{
|
|
60
60
|
no: {
|
|
61
61
|
type: Number,
|
|
62
|
-
required:
|
|
62
|
+
required: false
|
|
63
63
|
},
|
|
64
64
|
name: {
|
|
65
65
|
type: String,
|
|
@@ -92,11 +92,11 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
92
92
|
qrUniqueCode:
|
|
93
93
|
{
|
|
94
94
|
type: String,
|
|
95
|
-
unique:
|
|
95
|
+
unique: false
|
|
96
96
|
},
|
|
97
97
|
disabled: {
|
|
98
98
|
type: Boolean,
|
|
99
|
-
required:
|
|
99
|
+
required: false
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
],
|
|
@@ -104,7 +104,7 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
104
104
|
{
|
|
105
105
|
no: {
|
|
106
106
|
type: Number,
|
|
107
|
-
required:
|
|
107
|
+
required: false
|
|
108
108
|
},
|
|
109
109
|
name: {
|
|
110
110
|
type: String,
|
|
@@ -123,11 +123,11 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
123
123
|
required: false
|
|
124
124
|
},
|
|
125
125
|
qrUniqueCode:
|
|
126
|
-
{ type: String, unique:
|
|
126
|
+
{ type: String, unique: false },
|
|
127
127
|
|
|
128
128
|
disabled: {
|
|
129
129
|
type: Boolean,
|
|
130
|
-
required:
|
|
130
|
+
required: false
|
|
131
131
|
},
|
|
132
132
|
|
|
133
133
|
},
|
|
@@ -136,7 +136,7 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
136
136
|
{
|
|
137
137
|
no: {
|
|
138
138
|
type: Number,
|
|
139
|
-
required:
|
|
139
|
+
required: false
|
|
140
140
|
},
|
|
141
141
|
registration: {
|
|
142
142
|
type: String,
|
|
@@ -158,11 +158,11 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
158
158
|
type: Boolean,
|
|
159
159
|
required: false
|
|
160
160
|
},
|
|
161
|
-
qrUniqueCode: { type: String, unique:
|
|
161
|
+
qrUniqueCode: { type: String, unique: false }
|
|
162
162
|
,
|
|
163
163
|
disabled: {
|
|
164
164
|
type: Boolean,
|
|
165
|
-
required:
|
|
165
|
+
required: false
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
168
|
],
|
package/src/models/entry_exit.js
CHANGED
|
@@ -10,22 +10,29 @@ const EntryExitSchema = mongoose.Schema({
|
|
|
10
10
|
required: true,
|
|
11
11
|
},
|
|
12
12
|
gps: {
|
|
13
|
-
|
|
14
|
-
type:
|
|
15
|
-
|
|
13
|
+
type: {
|
|
14
|
+
type: String,
|
|
15
|
+
enum: ['Point'],
|
|
16
|
+
required: true
|
|
16
17
|
},
|
|
17
|
-
|
|
18
|
-
type: Number,
|
|
19
|
-
required: true
|
|
18
|
+
coordinates: {
|
|
19
|
+
type: [Number], // [longitude, latitude] format
|
|
20
|
+
required: true,
|
|
21
|
+
validate: {
|
|
22
|
+
validator: function (value) {
|
|
23
|
+
return value.length === 2;
|
|
24
|
+
},
|
|
25
|
+
message: 'Coordinates must have longitude and latitude'
|
|
26
|
+
}
|
|
20
27
|
}
|
|
21
28
|
},
|
|
22
|
-
range:{
|
|
23
|
-
type:Number,
|
|
24
|
-
required:true
|
|
29
|
+
range: {
|
|
30
|
+
type: Number,
|
|
31
|
+
required: true
|
|
25
32
|
},
|
|
26
|
-
disabled:{
|
|
27
|
-
type:Boolean,
|
|
28
|
-
required:true
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
required: true
|
|
29
36
|
},
|
|
30
37
|
purpose: {
|
|
31
38
|
type: String,
|
|
@@ -38,6 +45,9 @@ const EntryExitSchema = mongoose.Schema({
|
|
|
38
45
|
}
|
|
39
46
|
});
|
|
40
47
|
|
|
48
|
+
// Create a 2dsphere index on the gps field to support geospatial queries
|
|
49
|
+
EntryExitSchema.index({ gps: '2dsphere' });
|
|
50
|
+
|
|
41
51
|
const EntryExit = mongoose.model('EntryExit', EntryExitSchema);
|
|
42
52
|
|
|
43
53
|
module.exports = EntryExit;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
// Define the schema for companies
|
|
4
|
+
const waitListSchema = new mongoose.Schema({
|
|
5
|
+
firstName: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
lastName: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
phoneNumber: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
email: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
}, {
|
|
22
|
+
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const WaitList = mongoose.model('WaitList', waitListSchema);
|
|
27
|
+
|
|
28
|
+
module.exports = WaitList;
|