@bluedot-innovation/models 2.0.3 → 2.0.4-alpha.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.0.4
2
+ - customActions no longer an array
3
+ - add accountId to zones
4
+
1
5
  ## 2.0.3-alpha.1
2
6
  - Moved beacon back into geofeatures
3
7
  - Changed all geofeatures guids to id's
package/models/Zone.js CHANGED
@@ -21,6 +21,7 @@ let calendarDateRangeFilterSchema = require('./CalendarDateRangeFilter').calenda
21
21
  let percentageCrossedFilterSchema = require('./PercentageCrossedFilter').percentageCrossedFilterSchema
22
22
  let uuidv4 = require('uuid/v4')
23
23
  let patcher = require('mongoose-json-patch')
24
+ let helpers = require('../helpers')
24
25
 
25
26
  // ////// //
26
27
  // Schema //
@@ -52,7 +53,7 @@ let ZoneSchema = new Schema({
52
53
  type: [filterSchema]
53
54
  },
54
55
  actions: {
55
- type: [actionSchema]
56
+ type: actionSchema
56
57
  },
57
58
  geofeatures: {
58
59
  type: [geofeatureSchema],
@@ -63,7 +64,8 @@ let ZoneSchema = new Schema({
63
64
  creationTime: {type: Date, default: Date.now},
64
65
  lastUpdateTime: {type: Date, default: Date.now},
65
66
  projectId: {type: String, required: [true, 'projectId is required']},
66
- state: {type: String, default: StateEnum.active, select: false}
67
+ state: {type: String, default: StateEnum.active, select: false},
68
+ accountId: {type: String, required: true, validate: {isAsync: false, validator: helpers.validateUUIDv4, msg: 'default error message'}}
67
69
  }, {collection: 'zone'})
68
70
 
69
71
  // TODO: Test patcher and include for other schemas if required
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "2.0.3",
3
+ "version": "2.0.4-alpha.2",
4
4
  "description": "",
5
5
  "main": "Models.js",
6
6
  "scripts": {