payservedb 2.0.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -10,22 +10,29 @@ const EntryExitSchema = mongoose.Schema({
10
10
  required: true,
11
11
  },
12
12
  gps: {
13
- lat: {
14
- type: Number,
15
- required: true
13
+ type: {
14
+ type: String,
15
+ enum: ['Point'],
16
+ required: true
16
17
  },
17
- lng: {
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;