@bluedot-innovation/models 3.1.1 → 4.0.0

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 (160) hide show
  1. package/Models.js +10 -55
  2. package/models/AdminPortalUser.js +11 -10
  3. package/models/AdminUser.js +10 -0
  4. package/models/Application.js +38 -0
  5. package/models/ApplicationNotificationAction.js +30 -0
  6. package/models/ApplicationUsage.js +11 -0
  7. package/models/Beacon.js +32 -84
  8. package/models/BeaconFilter.js +23 -0
  9. package/models/BearingFilter.js +19 -0
  10. package/models/BoundingBox.js +17 -0
  11. package/models/Circle.js +21 -0
  12. package/models/ConfigurationParameters.js +20 -0
  13. package/models/Contract.js +38 -37
  14. package/models/Customer.js +38 -0
  15. package/models/CustomerLogin.js +10 -9
  16. package/models/DBEvent.js +14 -13
  17. package/models/DailyStats.js +7 -7
  18. package/models/DateRangeFilter.js +20 -0
  19. package/models/DeviceRulesRequest.js +28 -27
  20. package/models/Fence.js +21 -0
  21. package/models/FormattedBeacon.js +16 -0
  22. package/models/FormattedCircle.js +12 -0
  23. package/models/FormattedConditions.js +11 -0
  24. package/models/FormattedDateRange.js +11 -0
  25. package/models/FormattedPercentageCrossed.js +12 -0
  26. package/models/FormattedPoint.js +10 -0
  27. package/models/FormattedPolygon.js +11 -0
  28. package/models/FormattedPolyline.js +11 -0
  29. package/models/FormattedRectangle.js +12 -0
  30. package/models/FormattedTimeActive.js +17 -0
  31. package/models/FormattedZone.js +28 -0
  32. package/models/GeoFence.js +23 -0
  33. package/models/Geofeature.js +26 -0
  34. package/models/MessageAction.js +26 -28
  35. package/models/MonthlyStats.js +19 -35
  36. package/models/NotificationLogEntry.js +8 -7
  37. package/models/POILocation.js +7 -6
  38. package/models/POILookup.js +9 -8
  39. package/models/POIResult.js +8 -7
  40. package/models/PartnerCustomer.js +13 -12
  41. package/models/PartnerPasswordReset.js +9 -8
  42. package/models/PartnerUser.js +11 -10
  43. package/models/Partners.js +12 -11
  44. package/models/PercentageCrossedFilter.js +19 -0
  45. package/models/Point.js +20 -0
  46. package/models/Polygon.js +18 -0
  47. package/models/Polyline.js +18 -0
  48. package/models/PropertyMapping.js +17 -0
  49. package/models/Reference.js +19 -0
  50. package/models/RuleRequestAggregation.js +17 -33
  51. package/models/SequenceFilter.js +18 -0
  52. package/models/SimpleCheckInZone.js +29 -0
  53. package/models/SingleUseToken.js +8 -7
  54. package/models/SoundAction.js +28 -0
  55. package/models/SpeedFilter.js +19 -0
  56. package/models/TestDevice.js +12 -11
  57. package/models/TestDeviceCluster.js +10 -9
  58. package/models/TestInstance.js +10 -9
  59. package/models/TestScenario.js +10 -9
  60. package/models/TimeOfDayRange.js +16 -16
  61. package/models/TimeOfDayRangeFilter.js +19 -0
  62. package/models/URLAction.js +31 -0
  63. package/models/VibrationAction.js +28 -0
  64. package/models/ZoneUIState.js +18 -18
  65. package/models/property.js +25 -0
  66. package/package-lock.json.bak +170 -0
  67. package/package.json +6 -30
  68. package/.eslintrc.js +0 -42
  69. package/.gitlab-ci.yml +0 -43
  70. package/CHANGELOG.md +0 -152
  71. package/README.MD +0 -36
  72. package/__tests__/account/account.data.json +0 -12
  73. package/__tests__/account/account.rules.js +0 -8
  74. package/__tests__/account/account.spec.js +0 -83
  75. package/__tests__/action/message/messageAction.data.json +0 -5
  76. package/__tests__/action/message/messageAction.rules.json +0 -3
  77. package/__tests__/action/message/messageAction.spec.js +0 -61
  78. package/__tests__/action/url/urlAction.data.json +0 -4
  79. package/__tests__/action/url/urlAction.rules.json +0 -3
  80. package/__tests__/action/url/urlAction.spec.js +0 -74
  81. package/__tests__/beacon/beacon.data.json +0 -15
  82. package/__tests__/beacon/beacon.rules.json +0 -13
  83. package/__tests__/beacon/beacon.spec.js +0 -104
  84. package/__tests__/condition/beacon/beaconFilter.data.json +0 -1
  85. package/__tests__/condition/beacon/beaconFilter.rules.json +0 -3
  86. package/__tests__/condition/beacon/beaconFilter.spec.js +0 -1
  87. package/__tests__/condition/dayRange/dayRange.data.json +0 -5
  88. package/__tests__/condition/dayRange/dayRange.rules.json +0 -3
  89. package/__tests__/condition/dayRange/dayRange.spec.js +0 -74
  90. package/__tests__/condition/percentageCrossed/travelPath.data.json +0 -5
  91. package/__tests__/condition/percentageCrossed/travelPath.rules.json +0 -3
  92. package/__tests__/condition/percentageCrossed/travelPath.spec.js +0 -62
  93. package/__tests__/condition/speed/speed.data.json +0 -5
  94. package/__tests__/condition/speed/speed.rules.json +0 -3
  95. package/__tests__/condition/speed/speed.spec.js +0 -73
  96. package/__tests__/condition/timeActive/timeActive.data.json +0 -5
  97. package/__tests__/condition/timeActive/timeActive.rules.json +0 -7
  98. package/__tests__/condition/timeActive/timeActive.spec.js +0 -94
  99. package/__tests__/condition/travelDirection/travelDirection.data.json +0 -5
  100. package/__tests__/condition/travelDirection/travelDirection.rules.json +0 -3
  101. package/__tests__/condition/travelDirection/travelDirection.spec.js +0 -132
  102. package/__tests__/dailyStats/checkDailyStats.js +0 -31
  103. package/__tests__/geofeature/boundingBox/boundingBox.data.json +0 -12
  104. package/__tests__/geofeature/boundingBox/boundingBox.rules.json +0 -3
  105. package/__tests__/geofeature/boundingBox/boundingBox.spec.js +0 -78
  106. package/__tests__/geofeature/circle/circle.data.json +0 -9
  107. package/__tests__/geofeature/circle/circle.rules.json +0 -3
  108. package/__tests__/geofeature/circle/circle.spec.js +0 -71
  109. package/__tests__/geofeature/geoline/geoline.data.json +0 -46
  110. package/__tests__/geofeature/geoline/geoline.rules.json +0 -3
  111. package/__tests__/geofeature/geoline/geoline.spec.js +0 -70
  112. package/__tests__/geofeature/polygon/polygon.data.json +0 -46
  113. package/__tests__/geofeature/polygon/polygon.rules.json +0 -3
  114. package/__tests__/geofeature/polygon/polygon.spec.js +0 -127
  115. package/__tests__/geofeature/zoneBeacon/zoneBeacon.data.json +0 -16
  116. package/__tests__/geofeature/zoneBeacon/zoneBeacon.rules.json +0 -13
  117. package/__tests__/geofeature/zoneBeacon/zoneBeacon.spec.js +0 -62
  118. package/__tests__/monthlyStats/monthlyStats.data.json +0 -29
  119. package/__tests__/monthlyStats/monthlyStats.spec.js +0 -66
  120. package/__tests__/project/project.data.json +0 -18
  121. package/__tests__/project/project.rules.json +0 -9
  122. package/__tests__/project/project.spec.js +0 -81
  123. package/__tests__/ruleRequestAggregation/ruleRequestAggregation.data.json +0 -8
  124. package/__tests__/ruleRequestAggregation/ruleRequestAggregation.spec.js +0 -69
  125. package/__tests__/setup.js +0 -7
  126. package/__tests__/user/user.data.js +0 -19
  127. package/__tests__/user/user.rules.js +0 -8
  128. package/__tests__/user/user.spec.js +0 -130
  129. package/__tests__/utils/utils.spec.js +0 -24
  130. package/__tests__/zone/zone.action.spec.js +0 -50
  131. package/__tests__/zone/zone.condition.spec.js +0 -76
  132. package/__tests__/zone/zone.data.json +0 -157
  133. package/__tests__/zone/zone.geofeatures.spec.js +0 -75
  134. package/__tests__/zone/zone.spec.js +0 -134
  135. package/constants/errorMessages.js +0 -2
  136. package/helpers.js +0 -102
  137. package/models/Account.js +0 -50
  138. package/models/Project.js +0 -55
  139. package/models/UrlAction.js +0 -46
  140. package/models/User.js +0 -61
  141. package/models/Zone.js +0 -123
  142. package/models/conditions/DayRange.js +0 -52
  143. package/models/conditions/Speed.js +0 -42
  144. package/models/conditions/TimeActive.js +0 -50
  145. package/models/conditions/TravelDirection.js +0 -67
  146. package/models/conditions/TravelPath.js +0 -36
  147. package/models/geofeatures/BoundingBox.js +0 -44
  148. package/models/geofeatures/Circle.js +0 -39
  149. package/models/geofeatures/Geoline.js +0 -34
  150. package/models/geofeatures/Polygon.js +0 -45
  151. package/models/geofeatures/ZoneBeacon.js +0 -28
  152. package/schemas/MultiLineStringGeometry.js +0 -14
  153. package/schemas/Point.js +0 -13
  154. package/schemas/PointGeometry.js +0 -14
  155. package/schemas/PolygonGeometry.js +0 -14
  156. package/schemas/ProjectPermission.js +0 -21
  157. package/schemas/Webhook.js +0 -22
  158. package/utils/index.js +0 -39
  159. package/validators/checkDistanceBetweenVertices.js +0 -21
  160. package/yarn.lock +0 -2796
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Created by Arun on 30/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var mongoose = require('mongoose');
7
+ var SchemaTypes = mongoose.Schema.Types;
8
+
9
+ var DateRangeFilter = mongoose.model('DateRangeFilter', mongoose.Schema({
10
+ guid: {type: String},
11
+ _class : {type: String, default:"au.com.bluedot.application.spring.filter.action.DateRangeFilter"},
12
+ startDate: {type: String},
13
+ endDate: {type: String},
14
+ type : {type: String, default:"dateRangeFilter"},
15
+ },
16
+ {
17
+ _id: false
18
+ }
19
+ ));
20
+ module.exports = DateRangeFilter;
@@ -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;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var mongoose = require('mongoose');
7
+ Schema = mongoose.Schema;
8
+
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
+ );
18
+
19
+ var Fence = mongoose.model('Fence', FenceSchema);
20
+
21
+ module.exports = Fence;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedBeacon = function () {
7
+ this.beaconId = null;
8
+ this.name = null;
9
+ this.proximityUUID = null;
10
+ this.longitude = null;
11
+ this.latitude = null;
12
+ this.major = null;
13
+ this.minor = null;
14
+ this.macAddress = null;
15
+ };
16
+ module.exports = FormattedBeacon;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedCircle = function () {
7
+ this.name = null;
8
+ this.color = null;
9
+ this.radius = null;
10
+ this.center = null;
11
+ };
12
+ module.exports = FormattedCircle;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedConditions = function () {
7
+ this.percentageCrossed = [];
8
+ this.dateRange = [];
9
+ this.timeActive = [];
10
+ };
11
+ module.exports = FormattedConditions;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedDateRange = function (id, start, end) {
7
+ this.conditionId = id;
8
+ this.start = start;
9
+ this.end = end;
10
+ };
11
+ module.exports = FormattedDateRange;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+
7
+ var FormattedPercentageCrossed = function (id, percentage, timeout) {
8
+ this.conditionId = id;
9
+ this.percentage = percentage;
10
+ this.timeoutPeriod = timeout;
11
+ };
12
+ module.exports = FormattedPercentageCrossed;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedPoint = function (latitude,longitude) {
7
+ this.latitude = latitude;
8
+ this.longitude = longitude;
9
+ };
10
+ module.exports = FormattedPoint;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedPolygon = function () {
7
+ this.name = null;
8
+ this.color = null;
9
+ this.vertices = [];
10
+ };
11
+ module.exports = FormattedPolygon;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedPolyline = function () {
7
+ this.name = null;
8
+ this.color = null;
9
+ this.vertices = [];
10
+ };
11
+ module.exports = FormattedPolyline;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedRectangle = function () {
7
+ this.name = null;
8
+ this.color = null;
9
+ this.northEast = null;
10
+ this.southWest = null;
11
+ };
12
+ module.exports = FormattedRectangle;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedTimeActive = function (id, fromTime, fromPhase, toTime, toPhase) {
7
+ this.conditionId = id;
8
+ this.from = {
9
+ "time": fromTime,
10
+ "period": fromPhase
11
+ };
12
+ this.to = {
13
+ "time": toTime,
14
+ "period": toPhase
15
+ }
16
+ };
17
+ module.exports = FormattedTimeActive;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var FormattedZone = function () {
7
+ this.zoneName = null;
8
+ this.zoneId = null;
9
+ this.minimumRetriggerTime = null;
10
+ this.timeActive = null;
11
+ this.checkout = null;
12
+ this.actions = {
13
+ soundActions: [],
14
+ customActions: [],
15
+ vibrationActions: [],
16
+ messageActions: [],
17
+ urlActions: []
18
+ };
19
+ this.fences =
20
+ {
21
+ circles: [],
22
+ rectangles: [],
23
+ polygons: [],
24
+ polylines: []
25
+ };
26
+ this.beacons = [];
27
+ };
28
+ module.exports = FormattedZone;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var mongoose = require('mongoose');
7
+ Schema = mongoose.Schema;
8
+
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
17
+ },
18
+ { collection : 'GeoFence' }
19
+ );
20
+
21
+ var GeoFence = mongoose.model('GeoFence', FenceSchema);
22
+
23
+ module.exports = GeoFence;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Created by Andrew on 7/06/2016.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var mongoose = require('mongoose'),
7
+ Schema = mongoose.Schema;
8
+
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
+
24
+ var Geofeature = mongoose.model('Geofeature', GeofeatureSchema);
25
+
26
+ module.exports = Geofeature;
@@ -1,31 +1,29 @@
1
- let mongoose = require('mongoose')
2
- let StateEnum = require('@bluedot-innovation/enums').StateEnum
3
- let uuidv4 = require('uuid/v4')
1
+ /**
2
+ * Created by Arun on 10/09/2014.
3
+ * Copyright : Bluedot Innovations.
4
+ * Owner :
5
+ */
6
+ var mongoose = require('mongoose');
7
+ var StateEnum = require('@bluedot-innovation/enums').StateEnum;
4
8
 
5
- let schema = {
6
- title: {type: String, required: [true, 'title is required. ']},
7
- message: {type: String, required: [true, 'message is required. ']}
8
- }
9
-
10
- let MessageActionSchema = new mongoose.Schema(schema, {
11
- _id: false,
12
- versionKey: false
13
- })
14
-
15
- MessageActionSchema.add({
16
- type: {type: String, required: true}
17
- })
18
-
19
- // optional mongoose
20
- let model = (mongooseInstance) => {
21
- let MessageAction
22
- if (mongooseInstance) {
23
- MessageAction = mongooseInstance.model('MessageAction', MessageActionSchema)
24
- } else {
25
- MessageAction = mongoose.model('MessageAction', MessageActionSchema)
9
+ var MessageActionSchema = new mongoose.Schema({
10
+ guid : {type: String},
11
+ title : {type: String},
12
+ creationTime : {type: Date, default: Date.now},
13
+ actionName : String,
14
+ type: {type: String, default: 'message'},
15
+ _class: {type: String, default: 'au.com.bluedot.application.spring.action.MessageAction'},
16
+ description : {type: String, default: ''},
17
+ message : String,
18
+ dataSource: {type:String, select: false, default : 'openApi'},
19
+ lastUpdateTime : {type: Date, default: Date.now},
20
+ state: {type: String, default : StateEnum.active, select: false},
21
+ filters: []
22
+ },
23
+ {
24
+ _id: false
26
25
  }
26
+ );
27
+ var MessageAction = mongoose.model('MessageAction', MessageActionSchema);
27
28
 
28
- return MessageAction
29
- }
30
- // Exports Mongoose Model, Mongoose Schema, JSON schema (required locally for discriminators)
31
- module.exports = { Model: model, Schema: MessageActionSchema, messageActionSchema: schema }
29
+ module.exports = MessageAction;
@@ -4,41 +4,25 @@
4
4
  * Owner :
5
5
  */
6
6
 
7
- const mongoose = require('mongoose')
8
- const uuidv4 = require('uuid/v4')
9
- const helpers = require('../helpers')
7
+ const mongoose = require('mongoose'),
8
+ Schema = mongoose.Schema;
10
9
 
11
- const schema = {
12
- _id: { type: String, default: uuidv4 },
13
- customerId: {type: String, required: [true, 'customerId is required'], validate: {isAsync: false, validator: helpers.validateUUIDv4, msg: 'invalid customerId'}},
14
- totalMonthlyUsers: {type: Number, required: [true, 'totalMonthlyUsers is required'], min: 0},
15
- applications: [{
16
- applicationId: {type: String, required: [true, 'applicationId is required'], validate: {isAsync: false, validator: helpers.validateUUIDv4, msg: 'invalid applicationId'}},
17
- monthlyUsers: {type: Number, required: [true, 'monthlyUsers is required'], min: 0}
18
- }],
19
- countMonth: { type: Date, default: Date.now },
20
- creationDate: { type: Date, default: Date.now }
21
- }
22
-
23
- const MonthlyStatsSchema = new mongoose.Schema(
24
- schema,
25
- {
26
- collection: 'monthlyStats',
27
- versionKey: false
28
- }
10
+ const MonthlyStats = mongoose.model(
11
+ 'MonthlyStats',
12
+ new Schema(
13
+ {
14
+ _id: { type: String },
15
+ customerId: String,
16
+ totalMonthlyUsers: Number,
17
+ applications: [],
18
+ countMonth: { type: Date },
19
+ creationDate: { type: Date, default: Date.now }
20
+ },
21
+ {
22
+ collection: 'monthlyStats',
23
+ versionKey: false
24
+ }
25
+ )
29
26
  )
30
27
 
31
- // optional mongoose
32
- let model = (mongooseInstance) => {
33
- let MonthlyStats
34
- if (mongooseInstance) {
35
- MonthlyStats = mongooseInstance.model('MonthlyStat', MonthlyStatsSchema)
36
- } else {
37
- MonthlyStats = mongoose.model('MonthlyStat', MonthlyStats)
38
- }
39
-
40
- return MonthlyStats
41
- }
42
-
43
- // Exports Mongoose Model, Mongoose Schema, JSON schema (required locally for discriminators)
44
- module.exports = { Model: model, Schema: MonthlyStatsSchema }
28
+ module.exports = MonthlyStats;
@@ -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;
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Copyright : Bluedot Innovations.
3
3
  */
4
- let mongoose = require('mongoose')
5
- let StateEnum = require('@bluedot-innovation/enums').StateEnum
4
+ var mongoose = require('mongoose');
5
+ var StateEnum = require('@bluedot-innovation/enums').StateEnum;
6
6
 
7
- let PartnerCustomer = mongoose.model('PartnerCustomer', new mongoose.Schema(
7
+ var PartnerCustomer = mongoose.model('PartnerCustomer', new mongoose.Schema(
8
8
  {
9
- emailAddress: {type: String, unique: true},
9
+ emailAddress: { type : String , unique : true },
10
10
  password: String,
11
11
  firstName: String,
12
12
  lastName: String,
@@ -20,15 +20,16 @@ let PartnerCustomer = mongoose.model('PartnerCustomer', new mongoose.Schema(
20
20
  hasDemonstrated: Boolean,
21
21
  isUsingGeofencing: Boolean,
22
22
  additionalComments: String,
23
- referredBy: mongoose.Schema.Types.ObjectId,
24
- state: {type: String, default: StateEnum.active},
25
- 'creationTime': {type: Date, default: Date.now},
26
- 'dataSource': {type: String, select: false, default: 'PartnerPortal'},
23
+ referredBy:mongoose.Schema.Types.ObjectId,
24
+ state: {type:String, default: StateEnum.active},
25
+ "creationTime" : {type: Date, default: Date.now},
26
+ "dataSource" : {type:String, select: false, default : 'PartnerPortal'},
27
27
  partnerId: String
28
28
  },
29
29
  {
30
- collection: 'partnerCustomer'
31
- })
32
- )
30
+ collection : 'partnerCustomer'
31
+ }
32
+ )
33
+ );
33
34
 
34
- module.exports = PartnerCustomer
35
+ module.exports = PartnerCustomer;
@@ -1,19 +1,20 @@
1
1
  /**
2
2
  * Copyright : Bluedot Innovations.
3
3
  */
4
- let mongoose = require('mongoose')
4
+ var mongoose = require('mongoose');
5
5
 
6
- let PartnerPasswordReset = mongoose.model('PartnerPasswordReset', new mongoose.Schema(
6
+ var PartnerPasswordReset = mongoose.model('PartnerPasswordReset', new mongoose.Schema(
7
7
  {
8
8
  emailAddress: String,
9
9
  partnerUserId: String,
10
10
  token: String,
11
- 'creationTime': {type: Date, default: Date.now},
12
- 'dataSource': {type: String, select: false, default: 'PartnerPortal'}
11
+ "creationTime" : {type: Date, default: Date.now},
12
+ "dataSource" : {type:String, select: false, default : 'PartnerPortal'}
13
13
  },
14
14
  {
15
- collection: 'partnerPasswordReset'
16
- })
17
- )
15
+ collection : 'partnerPasswordReset'
16
+ }
17
+ )
18
+ );
18
19
 
19
- module.exports = PartnerPasswordReset
20
+ module.exports = PartnerPasswordReset;