@bluedot-innovation/models 2.0.0-alpha.8 → 2.0.0-alpha1

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.
Files changed (109) hide show
  1. package/Models.js +8 -8
  2. package/__tests__/zone/checkActions.js +64 -0
  3. package/__tests__/zone/checkAppId.js +41 -0
  4. package/__tests__/zone/checkBeacon.js +46 -0
  5. package/__tests__/zone/checkBearingFitler.js +48 -0
  6. package/__tests__/zone/checkBoundingBox.js +44 -0
  7. package/__tests__/zone/checkCalendarDateRangeFilterFitler.js +48 -0
  8. package/__tests__/zone/checkCircle.js +41 -0
  9. package/__tests__/zone/checkMRT.js +46 -0
  10. package/__tests__/zone/checkPercentageCrossedFitler.js +48 -0
  11. package/__tests__/zone/checkPolygon.js +78 -0
  12. package/__tests__/zone/checkPolyline.js +78 -0
  13. package/__tests__/zone/checkSpeedFitler.js +48 -0
  14. package/__tests__/zone/checkTimeOfDayRangeFitler.js +48 -0
  15. package/models/AdminPortalUser.js +11 -10
  16. package/models/AdminUser.js +5 -6
  17. package/models/Application.js +30 -31
  18. package/models/Beacon.js +78 -89
  19. package/models/BeaconFilter.js +12 -30
  20. package/models/BearingFilter.js +23 -45
  21. package/models/BoundingBox.js +20 -35
  22. package/models/CalendarDateRangeFilter.js +19 -33
  23. package/models/Circle.js +18 -32
  24. package/models/Contract.js +38 -37
  25. package/models/Customer.js +31 -31
  26. package/models/CustomerLogin.js +10 -9
  27. package/models/DBEvent.js +14 -13
  28. package/models/DeviceRulesRequest.js +28 -27
  29. package/models/Fence.js +13 -12
  30. package/models/GeoFence.js +14 -12
  31. package/models/Geofeature.js +18 -18
  32. package/models/MessageAction.js +16 -30
  33. package/models/NotificationLogEntry.js +8 -7
  34. package/models/POILocation.js +7 -6
  35. package/models/POILookup.js +9 -8
  36. package/models/POIResult.js +8 -7
  37. package/models/PartnerCustomer.js +13 -12
  38. package/models/PartnerPasswordReset.js +9 -8
  39. package/models/PartnerUser.js +11 -10
  40. package/models/Partners.js +12 -11
  41. package/models/PercentageCrossedFilter.js +15 -29
  42. package/models/Polygon.js +19 -33
  43. package/models/Polyline.js +19 -34
  44. package/models/RuleRequestAggregation.js +15 -14
  45. package/models/SimpleCheckInZone.js +21 -21
  46. package/models/SingleUseToken.js +8 -7
  47. package/models/SpeedFilter.js +19 -38
  48. package/models/TestDevice.js +12 -11
  49. package/models/TestDeviceCluster.js +10 -9
  50. package/models/TestInstance.js +10 -9
  51. package/models/TestScenario.js +10 -9
  52. package/models/TimeOfDayRange.js +16 -16
  53. package/models/TimeOfDayRangeFilter.js +18 -34
  54. package/models/URLAction.js +34 -0
  55. package/models/Zone.js +274 -84
  56. package/models/ZoneUIState.js +18 -18
  57. package/package.json +7 -20
  58. package/schemas/Point.js +13 -10
  59. package/.eslintrc.js +0 -6
  60. package/.gitlab-ci.yml +0 -43
  61. package/.nyc_output/.gitkeep +0 -0
  62. package/README.MD +0 -36
  63. package/__tests__/action/message/messageAction.data.json +0 -5
  64. package/__tests__/action/message/messageAction.rules.json +0 -3
  65. package/__tests__/action/message/messageAction.spec.js +0 -61
  66. package/__tests__/action/url/urlAction.data.json +0 -4
  67. package/__tests__/action/url/urlAction.rules.json +0 -3
  68. package/__tests__/action/url/urlAction.spec.js +0 -62
  69. package/__tests__/dailyStats/checkDailyStats.js +0 -30
  70. package/__tests__/filter/beacon/beaconFilter.data.json +0 -1
  71. package/__tests__/filter/beacon/beaconFilter.rules.json +0 -3
  72. package/__tests__/filter/beacon/beaconFilter.spec.js +0 -1
  73. package/__tests__/filter/bearing/bearingFilter.data.json +0 -5
  74. package/__tests__/filter/bearing/bearingFilter.rules.json +0 -3
  75. package/__tests__/filter/bearing/bearingFilter.spec.js +0 -95
  76. package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.data.json +0 -5
  77. package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.rules.json +0 -3
  78. package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.spec.js +0 -62
  79. package/__tests__/filter/percentageCrossed/percentageCrossedFilter.data.json +0 -5
  80. package/__tests__/filter/percentageCrossed/percentageCrossedFilter.rules.json +0 -3
  81. package/__tests__/filter/percentageCrossed/percentageCrossedFilter.spec.js +0 -62
  82. package/__tests__/filter/speed/speedFilter.data.json +0 -5
  83. package/__tests__/filter/speed/speedFilter.rules.json +0 -3
  84. package/__tests__/filter/speed/speedFilter.spec.js +0 -73
  85. package/__tests__/filter/timeOfDayRange/timeOfDayRange.data.json +0 -5
  86. package/__tests__/filter/timeOfDayRange/timeOfDayRange.rules.json +0 -3
  87. package/__tests__/filter/timeOfDayRange/timeOfDayRange.spec.js +0 -73
  88. package/__tests__/geofeature/beacon/beacon.data.json +0 -12
  89. package/__tests__/geofeature/beacon/beacon.rules.json +0 -13
  90. package/__tests__/geofeature/beacon/beacon.spec.js +0 -95
  91. package/__tests__/geofeature/boundingBox/boundingBox.data.json +0 -12
  92. package/__tests__/geofeature/boundingBox/boundingBox.rules.json +0 -3
  93. package/__tests__/geofeature/boundingBox/boundingBox.spec.js +0 -61
  94. package/__tests__/geofeature/circle/circle.data.json +0 -9
  95. package/__tests__/geofeature/circle/circle.rules.json +0 -3
  96. package/__tests__/geofeature/circle/circle.spec.js +0 -62
  97. package/__tests__/geofeature/polygon/polygon.data.json +0 -46
  98. package/__tests__/geofeature/polygon/polygon.rules.json +0 -3
  99. package/__tests__/geofeature/polygon/polygon.spec.js +0 -61
  100. package/__tests__/geofeature/polyline/polyline.data.json +0 -46
  101. package/__tests__/geofeature/polyline/polyline.rules.json +0 -3
  102. package/__tests__/geofeature/polyline/polyline.spec.js +0 -61
  103. package/__tests__/zone/zone.action.spec.js +0 -50
  104. package/__tests__/zone/zone.data.json +0 -154
  105. package/__tests__/zone/zone.filter.spec.js +0 -50
  106. package/__tests__/zone/zone.geofeatures.spec.js +0 -74
  107. package/__tests__/zone/zone.spec.js +0 -98
  108. package/models/DailyStats.js +0 -28
  109. package/models/UrlAction.js +0 -51
package/models/Circle.js CHANGED
@@ -1,39 +1,25 @@
1
- let mongoose = require('mongoose')
2
- let StateEnum = require('@bluedot-innovation/enums').StateEnum
3
- let Point = require('../schemas/Point')
4
- let uuidv4 = require('uuid/v4')
1
+ let mongoose = require('mongoose');
2
+ let StateEnum = require('@bluedot-innovation/enums').StateEnum;
3
+ let Point = require('../schemas/Point');
4
+ let uuidv1 = require('uuid/v1');
5
5
 
6
- let schema = {
7
- guid: {type: String, default: uuidv4},
8
- name: {type: String, required: [true, 'name is required. ']},
9
- radius: {type: Number, required: [true, 'radius is required. '], min: 5},
10
- center: {type: Point, required: [true, 'center is required. ']},
11
- creationTime: {type: Date, default: Date.now},
12
- lastUpdateTime: {type: Date, default: Date.now},
13
- state: {type: String, default: StateEnum.active, select: false}
14
- }
15
6
 
16
- let CircleSchema = new mongoose.Schema(
17
- schema,
7
+ let CircleSchema = new mongoose.Schema({
8
+ guid : { type: String, default: uuidv1 },
9
+ type : { type: String, default: "MultiLineString" },
10
+ name : { type: String, required: [true, 'name is required. '] },
11
+ radius : { type: Number, required: [true, 'radius is required. '], min: 5 },
12
+ center : { type: Point, required: [true, 'center is required. '] },
13
+ creationTime : { type: Date, default: Date.now },
14
+ lastUpdateTime : { type: Date, default: Date.now },
15
+ state : { type: String, default : StateEnum.active, select: false }
16
+ },
18
17
  {
19
18
  _id: false,
20
19
  __v: false
21
- })
22
-
23
- CircleSchema.add({
24
- type:
25
- {type: String, required: true}
26
- })
27
-
28
- // optional mongoose
29
- module.exports = (mongooseInstance) => {
30
- let Circle
31
- if (mongooseInstance) {
32
- Circle = mongooseInstance.model('Circle', CircleSchema)
33
- } else {
34
- Circle = mongoose.model('Circle', CircleSchema)
35
20
  }
21
+ );
22
+
23
+ let Circle = mongoose.model('Circle', CircleSchema);
36
24
 
37
- return Circle
38
- }
39
- module.exports.circleSchema = schema
25
+ module.exports = Circle;
@@ -3,42 +3,43 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- let mongoose = require('mongoose')
6
+ var mongoose = require('mongoose');
7
7
 
8
- let Contract = mongoose.model('Contract', new mongoose.Schema(
9
- {
10
- customerId: String,
11
- organisationName: String,
12
- addressLine1: String,
13
- addressLine2: String,
14
- addressCity: String,
15
- addressRegion: String,
16
- addressPostcode: String,
17
- addressCountry: String,
18
- billingFirstName: String,
19
- billingLastName: String,
20
- billingTaxNumber: String,
21
- billingEmail: String,
22
- tradingName: String,
23
- salesforceUrl: String,
24
- startDate: {type: Date, default: Date.now},
25
- endDate: {type: Date, default: Date.now},
26
- frequency: mongoose.Schema.Types.Number,
27
- monthEntries: [],
28
- currency: {type: String, default: 'USD'},
29
- currencyRate: Number,
30
- template: String,
31
- addedBy: String,
32
- lastEditedBy: String,
33
- xeroContactId: String,
34
- state: String,
35
- creationTime: {type: Date, default: Date.now},
36
- lastUpdateTime: {type: Date, default: Date.now},
37
- dataSource: {type: String, select: false, default: 'adminPortal'}
38
- },
39
- {
40
- collection: 'contract'
41
- })
42
- )
8
+ var Contract = mongoose.model('Contract', new mongoose.Schema(
9
+ {
10
+ customerId: String,
11
+ organisationName: String,
12
+ addressLine1: String,
13
+ addressLine2: String,
14
+ addressCity: String,
15
+ addressRegion: String,
16
+ addressPostcode: String,
17
+ addressCountry: String,
18
+ billingFirstName: String,
19
+ billingLastName: String,
20
+ billingTaxNumber: String,
21
+ billingEmail: String,
22
+ tradingName: String,
23
+ salesforceUrl: String,
24
+ startDate : {type: Date, default: Date.now},
25
+ endDate : {type: Date, default: Date.now},
26
+ frequency : mongoose.Schema.Types.Number,
27
+ monthEntries: [],
28
+ currency: {type: String, default: "USD"},
29
+ currencyRate: Number,
30
+ template: String,
31
+ addedBy: String,
32
+ lastEditedBy: String,
33
+ xeroContactId: String,
34
+ state: String,
35
+ creationTime : {type: Date, default: Date.now},
36
+ lastUpdateTime : {type: Date, default: Date.now},
37
+ dataSource : {type:String, select: false, default : 'adminPortal'}
38
+ },
39
+ {
40
+ collection : 'contract'
41
+ }
42
+ )
43
+ );
43
44
 
44
- module.exports = Contract
45
+ module.exports = Contract;
@@ -3,36 +3,36 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- let mongoose = require('mongoose')
7
- let StateEnum = require('@bluedot-innovation/enums').StateEnum
8
- let Schema = mongoose.Schema
6
+ var mongoose = require('mongoose');
7
+ var StateEnum = require('@bluedot-innovation/enums').StateEnum;
9
8
 
10
- let Customer = mongoose.model('Customer', new mongoose.Schema(
11
- {
12
- _id: String,
13
- customerApiKey: String,
14
- email: String,
15
- password: String,
16
- name: String,
17
- userName: String,
18
- state: {type: String, default: StateEnum.active},
19
- 'creationTime': {type: Date, default: Date.now},
20
- 'lastUpdateTime': {type: Date, default: Date.now},
21
- 'dataSource': {type: String, select: false, default: 'openApi'},
22
- integrations: Schema.Types.Mixed,
23
- firstName: String,
24
- lastName: String,
25
- oldPassword: String,
26
- organisationWebsite: String,
27
- organisationName: String,
28
- phoneNumber: String,
29
- createdBy: String,
30
- poiCredits: {type: Number, default: 0},
31
- address: []
32
- },
33
- {
34
- collection: 'customer'
35
- })
36
- )
9
+ var Customer = mongoose.model('Customer', new mongoose.Schema(
10
+ {
11
+ _id: String,
12
+ customerApiKey: String,
13
+ email: String,
14
+ password: String,
15
+ name: String,
16
+ userName: String,
17
+ state: {type:String, default: StateEnum.active},
18
+ "creationTime" : {type: Date, default: Date.now},
19
+ "lastUpdateTime" : {type: Date, default: Date.now},
20
+ "dataSource" : {type:String, select: false, default : 'openApi'},
21
+ integrations: Schema.Types.Mixed,
22
+ firstName: String,
23
+ lastName: String,
24
+ oldPassword: String,
25
+ organisationWebsite: String,
26
+ organisationName: String,
27
+ phoneNumber: String,
28
+ createdBy: String,
29
+ poiCredits: {type: Number, default: 0},
30
+ address: []
31
+ },
32
+ {
33
+ collection : 'customer'
34
+ }
35
+ )
36
+ );
37
37
 
38
- module.exports = Customer
38
+ module.exports = Customer;
@@ -2,8 +2,8 @@
2
2
  * Created by andrewstirling on 20/6/17.
3
3
  */
4
4
 
5
- var mongoose = require('mongoose')
6
- var StateEnum = require('@bluedot-innovation/enums').StateEnum
5
+ var mongoose = require('mongoose');
6
+ var StateEnum = require('@bluedot-innovation/enums').StateEnum;
7
7
 
8
8
  var CustomerLogin = mongoose.model('CustomerLogin', new mongoose.Schema(
9
9
  {
@@ -19,15 +19,16 @@ var CustomerLogin = mongoose.model('CustomerLogin', new mongoose.Schema(
19
19
  integrations: {},
20
20
  resetToken: String,
21
21
  lastLoginTime: Date,
22
- state: {type: String, default: StateEnum.active},
23
- creationTime: {type: Date, default: Date.now},
24
- lastUpdateTime: {type: Date, default: Date.now},
22
+ state: {type:String, default: StateEnum.active},
23
+ creationTime : {type: Date, default: Date.now},
24
+ lastUpdateTime : {type: Date, default: Date.now},
25
25
  createdBy: String,
26
26
  lastUpdatedBy: String
27
27
  },
28
28
  {
29
- collection: 'customerLogin'
30
- })
31
- )
29
+ collection : 'customerLogin'
30
+ }
31
+ )
32
+ );
32
33
 
33
- module.exports = CustomerLogin
34
+ module.exports = CustomerLogin;
package/models/DBEvent.js CHANGED
@@ -3,18 +3,19 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- let mongoose = require('mongoose')
6
+ var mongoose = require('mongoose');
7
+ Schema = mongoose.Schema;
7
8
 
8
- let DBEventSchema = new mongoose.Schema({
9
- _class: {type: String, default: 'au.com.bluedot.application.spring.DBEvent'},
10
- customerId: String,
11
- customerEmail: String,
12
- actionName: String,
13
- referenceId: String,
14
- creationTime: {type: Date, select: false, default: Date.now}
15
- },
16
- {collection: 'dbevent'}
17
- )
18
- let DBEvent = mongoose.model('DBEvent', DBEventSchema)
9
+ var DBEventSchema = new mongoose.Schema({
10
+ _class : {type: String, default:"au.com.bluedot.application.spring.DBEvent"},
11
+ customerId : String,
12
+ customerEmail : String,
13
+ actionName : String,
14
+ referenceId: String,
15
+ creationTime: {type: Date, select: false, default: Date.now},
16
+ },
17
+ { collection : 'dbevent' }
18
+ );
19
+ var DBEvent = mongoose.model('DBEvent', DBEventSchema);
19
20
 
20
- module.exports = DBEvent
21
+ module.exports = DBEvent;
@@ -3,34 +3,35 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- var mongoose = require('mongoose')
6
+ var mongoose = require('mongoose');
7
7
 
8
8
  var DeviceRulesRequest = mongoose.model('DeviceRulesRequest', new mongoose.Schema(
9
- {
10
- _id: String,
11
- _class: {type: String, default: 'au.com.bluedot.application.model.client.DeviceRulesRequest'},
12
- currentDeviceLocation: {
13
- 'longitude': Number,
14
- 'latitude': Number,
15
- 'geometryType': String
9
+ {
10
+ _id : String,
11
+ _class : {type: String, default:"au.com.bluedot.application.model.client.DeviceRulesRequest"},
12
+ currentDeviceLocation : {
13
+ "longitude" : Number,
14
+ "latitude" : Number,
15
+ "geometryType" : String
16
+ },
17
+ installationReference : String,
18
+ apiKey : String,
19
+ packageName : String,
20
+ clientEmail : String,
21
+ batteryStatus : String,
22
+ deviceType : String,
23
+ locationMethod : String,
24
+ platform : String,
25
+ sdkVersion : String,
26
+ osVersion : String,
27
+ speed : Number,
28
+ creationTime : { type: Date, default: Date.now },
29
+ lastUpdateTime : { type: Date, default: Date.now }
16
30
  },
17
- installationReference: String,
18
- apiKey: String,
19
- packageName: String,
20
- clientEmail: String,
21
- batteryStatus: String,
22
- deviceType: String,
23
- locationMethod: String,
24
- platform: String,
25
- sdkVersion: String,
26
- osVersion: String,
27
- speed: Number,
28
- creationTime: { type: Date, default: Date.now },
29
- lastUpdateTime: { type: Date, default: Date.now }
30
- },
31
- {
32
- collection: 'deviceRulesRequest'
33
- })
34
- )
31
+ {
32
+ collection: 'deviceRulesRequest'
33
+ }
34
+ )
35
+ );
35
36
 
36
- module.exports = DeviceRulesRequest
37
+ module.exports = DeviceRulesRequest;
package/models/Fence.js CHANGED
@@ -3,18 +3,19 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- let mongoose = require('mongoose')
7
- const Schema = mongoose.Schema
6
+ var mongoose = require('mongoose');
7
+ Schema = mongoose.Schema;
8
8
 
9
- let FenceSchema = new mongoose.Schema({
10
- '_id': {type: String},
11
- 'creationTime': {type: Date, default: Date.now},
12
- 'lastUpdateTime': {type: Date, default: Date.now},
13
- 'type': {type: String, default: 'Feature'},
14
- 'dataSource': {type: String, select: false, default: 'openApi'},
15
- 'geometry': {type: Schema.Types.Mixed, default: {}}
16
- })
9
+ var FenceSchema = new mongoose.Schema({
10
+ "_id" : {type: String},
11
+ "creationTime" : {type: Date, default: Date.now},
12
+ "lastUpdateTime" : {type: Date, default: Date.now},
13
+ "type" : {type:String, default: "Feature"},
14
+ "dataSource" : {type:String, select: false, default : 'openApi'},
15
+ "geometry" : {type: Schema.Types.Mixed, default: {}}
16
+ }
17
+ );
17
18
 
18
- let Fence = mongoose.model('Fence', FenceSchema)
19
+ var Fence = mongoose.model('Fence', FenceSchema);
19
20
 
20
- module.exports = Fence
21
+ module.exports = Fence;
@@ -3,19 +3,21 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- let mongoose = require('mongoose')
6
+ var mongoose = require('mongoose');
7
+ Schema = mongoose.Schema;
7
8
 
8
- let FenceSchema = new mongoose.Schema({
9
- _id: {type: String},
10
- 'geometry': {
11
- 'type': { type: String, required: true },
12
- 'coordinates': {type: Array, required: true}
9
+ var FenceSchema = new mongoose.Schema({
10
+ _id : {type: String},
11
+ "geometry": {
12
+ "type": { type: String, required: true },
13
+ "coordinates": { type: Array, required: true}
14
+ },
15
+ "fenceId" : String,
16
+ "fenceName" : String
13
17
  },
14
- 'fenceId': String,
15
- 'fenceName': String
16
- },
17
- {collection: 'GeoFence'})
18
+ { collection : 'GeoFence' }
19
+ );
18
20
 
19
- let GeoFence = mongoose.model('GeoFence', FenceSchema)
21
+ var GeoFence = mongoose.model('GeoFence', FenceSchema);
20
22
 
21
- module.exports = GeoFence
23
+ module.exports = GeoFence;
@@ -3,24 +3,24 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- let mongoose = require('mongoose')
7
- let Schema = mongoose.Schema
6
+ var mongoose = require('mongoose'),
7
+ Schema = mongoose.Schema;
8
8
 
9
- let GeofeatureSchema = new Schema({
10
- _id: Schema.Types.ObjectId,
11
- _class: {type: String, default: 'au.com.bluedot.application.spring.GeoFeature'},
12
- geometry: Schema.Types.Mixed,
13
- referenceId: String,
14
- apiKey: String,
15
- zoneId: String,
16
- type: String,
17
- name: String,
18
- beaconType: String,
19
- creationTime: {type: Date, default: Date.now},
20
- lastUpdateTime: {type: Date, default: Date.now}
21
- },
22
- { collection: 'geofeature' })
9
+ var GeofeatureSchema = new Schema({
10
+ _id: Schema.Types.ObjectId,
11
+ _class: {type: String, default: "au.com.bluedot.application.spring.GeoFeature"},
12
+ geometry: Schema.Types.Mixed,
13
+ referenceId: String,
14
+ apiKey: String,
15
+ zoneId: String,
16
+ type: String,
17
+ name: String,
18
+ beaconType: String,
19
+ creationTime : {type: Date, default: Date.now},
20
+ lastUpdateTime : {type: Date, default: Date.now},
21
+ },
22
+ { collection : 'geofeature' });
23
23
 
24
- let Geofeature = mongoose.model('Geofeature', GeofeatureSchema)
24
+ var Geofeature = mongoose.model('Geofeature', GeofeatureSchema);
25
25
 
26
- module.exports = Geofeature
26
+ module.exports = Geofeature;
@@ -1,36 +1,22 @@
1
- let mongoose = require('mongoose')
2
- let StateEnum = require('@bluedot-innovation/enums').StateEnum
3
- let uuidv4 = require('uuid/v4')
1
+ let mongoose = require('mongoose');
2
+ let StateEnum = require('@bluedot-innovation/enums').StateEnum;
3
+ let uuidv1 = require('uuid/v1');
4
4
 
5
- let schema = {
6
- guid: {type: String, default: uuidv4},
7
- title: {type: String, required: [true, 'title is required. ']},
8
- message: {type: String, required: [true, 'message is required. ']},
9
- creationTime: {type: Date, default: Date.now},
10
- lastUpdateTime: {type: Date, default: Date.now},
11
- state: {type: String, default: StateEnum.active, select: false}
12
- }
13
-
14
- let MessageActionSchema = new mongoose.Schema(schema,
5
+ let MessageActionSchema = new mongoose.Schema({
6
+ guid : { type: String, default: uuidv1 },
7
+ type : { type: String },
8
+ title : { type: String, required: [true, 'title is required. '] },
9
+ message : { type: String, required: [true, 'message is required. '] },
10
+ creationTime : { type: Date, default: Date.now },
11
+ lastUpdateTime : { type: Date, default: Date.now },
12
+ state : { type: String, default : StateEnum.active, select: false }
13
+ },
15
14
  {
16
15
  _id: false,
17
16
  __v: false
18
- })
19
-
20
- MessageActionSchema.add({
21
- type:
22
- {type: String, required: true}
23
- })
24
-
25
- // optional mongoose
26
- module.exports = (mongooseInstance) => {
27
- let MessageAction
28
- if (mongooseInstance) {
29
- MessageAction = mongooseInstance.model('MessageAction', MessageActionSchema)
30
- } else {
31
- MessageAction = mongoose.model('MessageAction', MessageActionSchema)
32
17
  }
18
+ );
19
+
20
+ let MessageAction = mongoose.model('MessageAction', MessageActionSchema);
33
21
 
34
- return MessageAction
35
- }
36
- module.exports.messageActionSchema = schema
22
+ module.exports = MessageAction;
@@ -3,16 +3,17 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- let mongoose = require('mongoose')
6
+ var mongoose = require('mongoose');
7
7
 
8
- let NotificationLogEntry = mongoose.model('NotificationLogEntry', new mongoose.Schema(
8
+
9
+ var NotificationLogEntry = mongoose.model('NotificationLogEntry', new mongoose.Schema(
9
10
  {
10
11
  _id: String,
11
- 'notification.zoneId': String,
12
- creationTime: {type: Date}
12
+ "notification.zoneId": String,
13
+ creationTime: {type: Date }
13
14
  },
14
15
  {
15
- collection: 'notificationLogEntry'
16
+ collection : 'notificationLogEntry'
16
17
  }
17
- ))
18
- module.exports = NotificationLogEntry
18
+ ));
19
+ module.exports = NotificationLogEntry;
@@ -3,17 +3,18 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- let mongoose = require('mongoose')
6
+ var mongoose = require('mongoose');
7
7
 
8
- let POILocation = mongoose.model('POILocation', new mongoose.Schema(
8
+ var POILocation = mongoose.model('POILocation', new mongoose.Schema(
9
9
  {
10
10
  type: String,
11
11
  properties: {},
12
12
  geometryId: String
13
13
  },
14
14
  {
15
- collection: 'poiLocation'
16
- })
17
- )
15
+ collection : 'poiLocation'
16
+ }
17
+ )
18
+ );
18
19
 
19
- module.exports = POILocation
20
+ module.exports = POILocation;
@@ -3,9 +3,9 @@
3
3
  * Copyright : Bluedot Innovations.
4
4
  * Owner :
5
5
  */
6
- let mongoose = require('mongoose')
6
+ var mongoose = require('mongoose');
7
7
 
8
- let POILookup = mongoose.model('POILookup', new mongoose.Schema(
8
+ var POILookup = mongoose.model('POILookup', new mongoose.Schema(
9
9
  {
10
10
  _id: String,
11
11
  customerId: String,
@@ -17,14 +17,15 @@ let POILookup = mongoose.model('POILookup', new mongoose.Schema(
17
17
  type: String,
18
18
  status: String,
19
19
  errorMessage: String,
20
- 'creationTime': {type: Date, default: Date.now},
21
- 'lastUpdateTime': {type: Date, default: Date.now},
20
+ "creationTime" : {type: Date, default: Date.now},
21
+ "lastUpdateTime" : {type: Date, default: Date.now},
22
22
  creditsUsed: {type: Number, default: 0},
23
23
  results: []
24
24
  },
25
25
  {
26
- collection: 'poiLookup'
27
- })
28
- )
26
+ collection : 'poiLookup'
27
+ }
28
+ )
29
+ );
29
30
 
30
- module.exports = POILookup
31
+ module.exports = POILookup;
@@ -1,19 +1,20 @@
1
1
  /**
2
2
  * Created by andrewstirling on 12/4/17.
3
3
  */
4
- let mongoose = require('mongoose')
4
+ var mongoose = require('mongoose');
5
5
 
6
- let POIResult = mongoose.model('POIResult', new mongoose.Schema(
6
+ var POIResult = mongoose.model('POIResult', new mongoose.Schema(
7
7
  {
8
8
  _id: String,
9
9
  lookupId: String,
10
10
  page: Number,
11
- 'lastUpdateTime': {type: Date, default: Date.now},
11
+ "lastUpdateTime" : {type: Date, default: Date.now},
12
12
  results: []
13
13
  },
14
14
  {
15
- collection: 'poiResult'
16
- })
17
- )
15
+ collection : 'poiResult'
16
+ }
17
+ )
18
+ );
18
19
 
19
- module.exports = POIResult
20
+ module.exports = POIResult;