@bluedot-innovation/models 2.0.3-alpha.4 → 2.0.4-alpha.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/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 //
|
|
@@ -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
|
+
"version": "2.0.4-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "Models.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"sinon": "^4.1.2"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@bluedot-innovation/enums": "
|
|
30
|
+
"@bluedot-innovation/enums": "2.0.0",
|
|
31
31
|
"mongoose": "^4.13.9",
|
|
32
32
|
"mongoose-error-helper": "0.0.2",
|
|
33
33
|
"mongoose-json-patch": "^1.1.1",
|