@bluedot-innovation/models 2.0.19-alpha.6 → 2.0.19-alpha.7

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/models/Zone.js CHANGED
@@ -70,10 +70,6 @@ let zoneSchema = new Schema({
70
70
  accountId: {type: String, required: true, validate: {isAsync: false, validator: helpers.validateUUIDv4, msg: 'default error message'}}
71
71
  }, {collection: 'zone'})
72
72
 
73
- // TODO: Test patcher and include for other schemas if required
74
- zoneSchema.plugin(patcher)
75
- zoneSchema.plugin(mongooseHidden)
76
-
77
73
  zoneSchema.path('actions').discriminator('url', new Schema(urlActionSchema))
78
74
  zoneSchema.path('actions').discriminator('message', new Schema(messageActionSchema))
79
75
 
@@ -89,6 +85,10 @@ zoneSchema.path('geofeatures').discriminator('polygon', new Schema(polygonSchema
89
85
  zoneSchema.path('geofeatures').discriminator('polyline', new Schema(polylineSchema))
90
86
  zoneSchema.path('geofeatures').discriminator('boundingBox', new Schema(boundingBoxSchema))
91
87
 
88
+ // TODO: Test patcher and include for other schemas if required
89
+ zoneSchema.plugin(patcher)
90
+ zoneSchema.plugin(mongooseHidden)
91
+
92
92
  // optional mongoose
93
93
  const model = (mongooseInstance) => {
94
94
  let Zone
@@ -8,10 +8,10 @@ const mongooseHidden = require('../../utils/mongooseHidden')
8
8
  const schema = {
9
9
  _id: {type: String, default: uuidv4},
10
10
  geometry: {type: MultiLineStringGeometry},
11
- name: {type: String, required: [true, 'name is required. ']},
12
- vertices: {type: [Point], required: [true, 'vertices is required. ']},
13
- creationTime: {type: Date, default: Date.now, hide: true},
14
- lastUpdateTime: {type: Date, default: Date.now, hide: true},
11
+ name: {type: String, required: [true, 'name is required.']},
12
+ vertices: {type: [Point], required: [true, 'vertices is required.']},
13
+ creationTime: {type: Date, default: Date.now},
14
+ lastUpdateTime: {type: Date, default: Date.now},
15
15
  state: {type: String, default: StateEnum.active, select: false}
16
16
  }
17
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "2.0.19-alpha.6",
3
+ "version": "2.0.19-alpha.7",
4
4
  "description": "",
5
5
  "main": "Models.js",
6
6
  "scripts": {