@bluedot-innovation/models 6.2.6 → 6.2.8
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
|
@@ -38,6 +38,17 @@ testCase('Project', () => {
|
|
|
38
38
|
done()
|
|
39
39
|
})
|
|
40
40
|
})
|
|
41
|
+
|
|
42
|
+
assertions('should set the value of shouldSync to false when it is not defined', (done) => {
|
|
43
|
+
let project = JSON.parse(JSON.stringify(require('./project.remote.config.json')))
|
|
44
|
+
delete project.shouldSync
|
|
45
|
+
let Project = new ProjectModel(project)
|
|
46
|
+
assert.equal(Project.shouldSync, false, "shouldSync should be set to false")
|
|
47
|
+
Project.validate((err, res) => {
|
|
48
|
+
assert.notExists(err)
|
|
49
|
+
done()
|
|
50
|
+
})
|
|
51
|
+
})
|
|
41
52
|
})
|
|
42
53
|
testCase('Valid Project ', () => {
|
|
43
54
|
assertions('should validate a valid project ', (done) => {
|
package/models/Project.js
CHANGED
|
@@ -38,6 +38,7 @@ let ProjectSchema = new mongoose.Schema({
|
|
|
38
38
|
lastUpdateTime: {type: Date, default: Date.now},
|
|
39
39
|
lastSyncTime: {type: Date, default: Date.now},
|
|
40
40
|
name: {type: String, required: [true, 'name is required']},
|
|
41
|
+
shouldSync: { type: Boolean, default: false },
|
|
41
42
|
accountId: {type: String, required: true, validate: {isAsync: false, validator: helpers.validateUUIDv4, msg: 'default error message'}},
|
|
42
43
|
webhooks: {type:[WebhookSchema], validate: webhooksValidators},
|
|
43
44
|
configurationParameters: {
|
package/package.json
CHANGED