@bluedot-innovation/models 4.0.0 → 5.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/.eslintrc.js +42 -0
  2. package/.gitlab-ci.yml +43 -0
  3. package/CHANGELOG.md +156 -0
  4. package/Models.js +55 -10
  5. package/README.MD +36 -0
  6. package/__tests__/account/account.data.json +12 -0
  7. package/__tests__/account/account.rules.js +8 -0
  8. package/__tests__/account/account.spec.js +83 -0
  9. package/__tests__/action/message/messageAction.data.json +5 -0
  10. package/__tests__/action/message/messageAction.rules.json +3 -0
  11. package/__tests__/action/message/messageAction.spec.js +61 -0
  12. package/__tests__/action/url/urlAction.data.json +4 -0
  13. package/__tests__/action/url/urlAction.rules.json +3 -0
  14. package/__tests__/action/url/urlAction.spec.js +74 -0
  15. package/__tests__/beacon/beacon.data.json +15 -0
  16. package/__tests__/beacon/beacon.rules.json +13 -0
  17. package/__tests__/beacon/beacon.spec.js +104 -0
  18. package/__tests__/condition/beacon/beaconFilter.data.json +1 -0
  19. package/__tests__/condition/beacon/beaconFilter.rules.json +3 -0
  20. package/__tests__/condition/beacon/beaconFilter.spec.js +1 -0
  21. package/__tests__/condition/dayRange/dayRange.data.json +5 -0
  22. package/__tests__/condition/dayRange/dayRange.rules.json +3 -0
  23. package/__tests__/condition/dayRange/dayRange.spec.js +74 -0
  24. package/__tests__/condition/percentageCrossed/travelPath.data.json +5 -0
  25. package/__tests__/condition/percentageCrossed/travelPath.rules.json +3 -0
  26. package/__tests__/condition/percentageCrossed/travelPath.spec.js +62 -0
  27. package/__tests__/condition/speed/speed.data.json +5 -0
  28. package/__tests__/condition/speed/speed.rules.json +3 -0
  29. package/__tests__/condition/speed/speed.spec.js +73 -0
  30. package/__tests__/condition/timeActive/timeActive.data.json +5 -0
  31. package/__tests__/condition/timeActive/timeActive.rules.json +7 -0
  32. package/__tests__/condition/timeActive/timeActive.spec.js +94 -0
  33. package/__tests__/condition/travelDirection/travelDirection.data.json +5 -0
  34. package/__tests__/condition/travelDirection/travelDirection.rules.json +3 -0
  35. package/__tests__/condition/travelDirection/travelDirection.spec.js +132 -0
  36. package/__tests__/dailyStats/checkDailyStats.js +31 -0
  37. package/__tests__/geofeature/boundingBox/boundingBox.data.json +12 -0
  38. package/__tests__/geofeature/boundingBox/boundingBox.rules.json +3 -0
  39. package/__tests__/geofeature/boundingBox/boundingBox.spec.js +78 -0
  40. package/__tests__/geofeature/circle/circle.data.json +9 -0
  41. package/__tests__/geofeature/circle/circle.rules.json +3 -0
  42. package/__tests__/geofeature/circle/circle.spec.js +71 -0
  43. package/__tests__/geofeature/geoline/geoline.data.json +46 -0
  44. package/__tests__/geofeature/geoline/geoline.rules.json +3 -0
  45. package/__tests__/geofeature/geoline/geoline.spec.js +70 -0
  46. package/__tests__/geofeature/polygon/polygon.data.json +46 -0
  47. package/__tests__/geofeature/polygon/polygon.rules.json +3 -0
  48. package/__tests__/geofeature/polygon/polygon.spec.js +127 -0
  49. package/__tests__/geofeature/zoneBeacon/zoneBeacon.data.json +16 -0
  50. package/__tests__/geofeature/zoneBeacon/zoneBeacon.rules.json +13 -0
  51. package/__tests__/geofeature/zoneBeacon/zoneBeacon.spec.js +62 -0
  52. package/__tests__/monthlyStats/monthlyStats.data.json +29 -0
  53. package/__tests__/monthlyStats/monthlyStats.spec.js +66 -0
  54. package/__tests__/project/project.data.json +18 -0
  55. package/__tests__/project/project.rules.json +9 -0
  56. package/__tests__/project/project.spec.js +92 -0
  57. package/__tests__/ruleRequestAggregation/ruleRequestAggregation.data.json +8 -0
  58. package/__tests__/ruleRequestAggregation/ruleRequestAggregation.spec.js +69 -0
  59. package/__tests__/setup.js +7 -0
  60. package/__tests__/user/user.data.js +19 -0
  61. package/__tests__/user/user.rules.js +8 -0
  62. package/__tests__/user/user.spec.js +130 -0
  63. package/__tests__/utils/utils.spec.js +24 -0
  64. package/__tests__/zone/zone.action.spec.js +50 -0
  65. package/__tests__/zone/zone.condition.spec.js +94 -0
  66. package/__tests__/zone/zone.data.json +157 -0
  67. package/__tests__/zone/zone.geofeatures.spec.js +75 -0
  68. package/__tests__/zone/zone.spec.js +134 -0
  69. package/constants/errorMessages.js +2 -0
  70. package/helpers.js +117 -0
  71. package/models/Account.js +50 -0
  72. package/models/AdminPortalUser.js +10 -11
  73. package/models/Beacon.js +84 -32
  74. package/models/Contract.js +37 -38
  75. package/models/CustomerLogin.js +9 -10
  76. package/models/DBEvent.js +13 -14
  77. package/models/DailyStats.js +7 -7
  78. package/models/DeviceRulesRequest.js +27 -28
  79. package/models/MessageAction.js +28 -26
  80. package/models/MonthlyStats.js +35 -19
  81. package/models/NotificationLogEntry.js +7 -8
  82. package/models/POILocation.js +6 -7
  83. package/models/POILookup.js +8 -9
  84. package/models/POIResult.js +7 -8
  85. package/models/PartnerCustomer.js +12 -13
  86. package/models/PartnerPasswordReset.js +8 -9
  87. package/models/PartnerUser.js +10 -11
  88. package/models/Partners.js +11 -12
  89. package/models/Project.js +55 -0
  90. package/models/RuleRequestAggregation.js +33 -17
  91. package/models/SingleUseToken.js +7 -8
  92. package/models/TestDevice.js +11 -12
  93. package/models/TestDeviceCluster.js +9 -10
  94. package/models/TestInstance.js +9 -10
  95. package/models/TestScenario.js +9 -10
  96. package/models/TimeOfDayRange.js +16 -16
  97. package/models/UrlAction.js +46 -0
  98. package/models/User.js +61 -0
  99. package/models/Zone.js +126 -0
  100. package/models/ZoneUIState.js +18 -18
  101. package/models/conditions/DayRange.js +52 -0
  102. package/models/conditions/Speed.js +42 -0
  103. package/models/conditions/TimeActive.js +50 -0
  104. package/models/conditions/TravelDirection.js +67 -0
  105. package/models/conditions/TravelPath.js +36 -0
  106. package/models/geofeatures/BoundingBox.js +44 -0
  107. package/models/geofeatures/Circle.js +39 -0
  108. package/models/geofeatures/Geoline.js +34 -0
  109. package/models/geofeatures/Polygon.js +45 -0
  110. package/models/geofeatures/ZoneBeacon.js +28 -0
  111. package/package.json +30 -6
  112. package/schemas/MultiLineStringGeometry.js +14 -0
  113. package/schemas/Point.js +13 -0
  114. package/schemas/PointGeometry.js +14 -0
  115. package/schemas/PolygonGeometry.js +14 -0
  116. package/schemas/ProjectPermission.js +21 -0
  117. package/schemas/Webhook.js +27 -0
  118. package/utils/index.js +39 -0
  119. package/validators/checkDistanceBetweenVertices.js +21 -0
  120. package/yarn.lock +2796 -0
  121. package/models/AdminUser.js +0 -10
  122. package/models/Application.js +0 -38
  123. package/models/ApplicationNotificationAction.js +0 -30
  124. package/models/ApplicationUsage.js +0 -11
  125. package/models/BeaconFilter.js +0 -23
  126. package/models/BearingFilter.js +0 -19
  127. package/models/BoundingBox.js +0 -17
  128. package/models/Circle.js +0 -21
  129. package/models/ConfigurationParameters.js +0 -20
  130. package/models/Customer.js +0 -38
  131. package/models/DateRangeFilter.js +0 -20
  132. package/models/Fence.js +0 -21
  133. package/models/FormattedBeacon.js +0 -16
  134. package/models/FormattedCircle.js +0 -12
  135. package/models/FormattedConditions.js +0 -11
  136. package/models/FormattedDateRange.js +0 -11
  137. package/models/FormattedPercentageCrossed.js +0 -12
  138. package/models/FormattedPoint.js +0 -10
  139. package/models/FormattedPolygon.js +0 -11
  140. package/models/FormattedPolyline.js +0 -11
  141. package/models/FormattedRectangle.js +0 -12
  142. package/models/FormattedTimeActive.js +0 -17
  143. package/models/FormattedZone.js +0 -28
  144. package/models/GeoFence.js +0 -23
  145. package/models/Geofeature.js +0 -26
  146. package/models/PercentageCrossedFilter.js +0 -19
  147. package/models/Point.js +0 -20
  148. package/models/Polygon.js +0 -18
  149. package/models/Polyline.js +0 -18
  150. package/models/PropertyMapping.js +0 -17
  151. package/models/Reference.js +0 -19
  152. package/models/SequenceFilter.js +0 -18
  153. package/models/SimpleCheckInZone.js +0 -29
  154. package/models/SoundAction.js +0 -28
  155. package/models/SpeedFilter.js +0 -19
  156. package/models/TimeOfDayRangeFilter.js +0 -19
  157. package/models/URLAction.js +0 -31
  158. package/models/VibrationAction.js +0 -28
  159. package/models/property.js +0 -25
  160. package/package-lock.json.bak +0 -170
@@ -1,10 +0,0 @@
1
- /**
2
- * Created by Arun on 10/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- var mongoose = require('mongoose');
7
- var AdminUser = mongoose.model('AdminUser', new mongoose.Schema({},
8
- { collection : 'AdminUser' }
9
- ));
10
- module.exports = AdminUser;
@@ -1,38 +0,0 @@
1
- /**
2
- * Created by Arun on 10/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- var mongoose = require('mongoose');
7
- var Enums = require('@bluedot-innovation/enums');
8
- Schema = mongoose.Schema;
9
-
10
- var ApplicationSchema = new mongoose.Schema({
11
- _id : {type: String},
12
- _class : {type: String, default:"au.com.bluedot.application.model.client.Application"},
13
- state : {type: String, default : Enums.StateEnum.active, select: false},
14
- nextRuleUpdateInterval: {type: Number, select: false},
15
- nextRuleUpdateIntervalFormatted: {type:String, required: true},
16
- lastUpdateTime: {type: Date, select: false},
17
- creationTime: {type: Date, select: false},
18
- "administrator" : {type: String, select: false},
19
- enableDataAnonymisation: {type: Boolean, select: false},
20
- apiKey: String,
21
- dataSource: {type:String, select: false, default : 'openApi'},
22
- name: {type: String},
23
- packageName: {type: String},
24
- customerId : String,
25
- firebaseApiKey: String,
26
- lastPushSync: Date,
27
- webhook : {
28
- url: String,
29
- enabled: Boolean,
30
- params: {}
31
- },
32
- configurationParameters:{type: Schema.Types.Mixed, default: null}
33
- },
34
- { collection : 'application' }
35
- );
36
- var Application = mongoose.model('Application', ApplicationSchema);
37
-
38
- module.exports = Application;
@@ -1,30 +0,0 @@
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;
8
-
9
- var ApplicationNotificationActionSchema = new mongoose.Schema({
10
- guid : {type: String},
11
- creationTime : {type: Date, default: Date.now},
12
- dataSource: {type:String, select: false, default : 'openApi'},
13
- actionName : String,
14
- type: {type: String, default: 'applicationNotification'},
15
- _class: {type: String, default: 'au.com.bluedot.application.spring.action.ApplicationNotificationAction'},
16
- description : String,
17
- lastUpdateTime : Date,
18
- customData : Schema.Types.Mixed,
19
- state: {type: String, default : StateEnum.active, select: false},
20
- filters: []
21
- },
22
- {
23
- _id: false
24
- }
25
- );
26
-
27
- var ApplicationNotificationAction = mongoose.model('ApplicationNotificationAction', ApplicationNotificationActionSchema);
28
-
29
-
30
- module.exports = ApplicationNotificationAction;
@@ -1,11 +0,0 @@
1
- /**
2
- * Created by Arun on 10/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- var mongoose = require('mongoose');
7
-
8
- var ApplicationUsage = mongoose.model('ApplicationUsage', new mongoose.Schema({},
9
- { collection : 'applicationUsage' }
10
- ));
11
- module.exports = ApplicationUsage;
@@ -1,23 +0,0 @@
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 BeaconFilterSchema = new mongoose.Schema(
10
- {
11
- "_class" : {type:String, default : "au.com.bluedot.application.spring.filter.spatial.BeaconFilter"},
12
- "beacon" : {},
13
- "guid" : String,
14
- "type" : {type:String, default: "beacon"}
15
- },
16
- {
17
- _id: false
18
- }
19
- );
20
-
21
- var BeaconFilter = mongoose.model('BeaconFilter', BeaconFilterSchema);
22
-
23
- module.exports = BeaconFilter;
@@ -1,19 +0,0 @@
1
- /**
2
- * Created by Andrew on 30/01/2017.
3
- * Copyright : Bluedot Innovations.
4
- */
5
-
6
- var mongoose = require('mongoose');
7
-
8
- var BearingFilter = mongoose.model('BearingFilter', mongoose.Schema({
9
- guid: {type: String},
10
- _class : {type: String, default:"au.com.bluedot.application.spring.filter.action.BearingFilter"},
11
- fromAngle : Number,
12
- toAngle : Number,
13
- type : {type: String, default:"bearingFilter"}
14
- },
15
- {
16
- _id: false
17
- }
18
- ));
19
- module.exports = BearingFilter;
@@ -1,17 +0,0 @@
1
- /**
2
- * Created by Bluedot01 on 30/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- var mongoose = require('mongoose');
7
- Schema = mongoose.Schema;
8
-
9
- var BoundingBox = mongoose.model('BoundingBox', mongoose.Schema({
10
- type: {type: String, default: "MultiLineString"},
11
- "coordinates" : []
12
- },
13
- {
14
- _id: false
15
- }
16
- ));
17
- module.exports = BoundingBox;
package/models/Circle.js DELETED
@@ -1,21 +0,0 @@
1
- /**
2
- * Created by Bluedot01 on 30/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- /*
7
- Right now mongoose does not support 1-1 relationships.
8
- https://github.com/LearnBoost/mongoose/pull/585.
9
- it can be wrapped around array like polygon.
10
- */
11
- var mongoose = require('mongoose');
12
- Schema = mongoose.Schema;
13
- var Circle = mongoose.model('Circle', mongoose.Schema({
14
- "type": {type: String, default: "MultiLineString"},
15
- "coordinates" : Array
16
- },
17
- {
18
- _id: false
19
- }
20
- ));
21
- module.exports = Circle;
@@ -1,20 +0,0 @@
1
- /**
2
- * Copyright : Bluedot Innovations.
3
- */
4
-
5
- var mongoose = require('mongoose'),
6
- Schema = mongoose.Schema;
7
-
8
- var ConfigurationParameters = mongoose.model('ConfigurationParameters', new Schema(
9
- {
10
- name: String,
11
- iosConfig: {type: Schema.Types.Mixed, default: {}},
12
- androidConfig: {type: Schema.Types.Mixed, default: {}},
13
- },
14
- {
15
- collection : 'configurationParameters'
16
- }
17
- )
18
- );
19
-
20
- module.exports = ConfigurationParameters;
@@ -1,38 +0,0 @@
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;
8
-
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
-
38
- module.exports = Customer;
@@ -1,20 +0,0 @@
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;
package/models/Fence.js DELETED
@@ -1,21 +0,0 @@
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;
@@ -1,16 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,11 +0,0 @@
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;
@@ -1,11 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,10 +0,0 @@
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;
@@ -1,11 +0,0 @@
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;
@@ -1,11 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,17 +0,0 @@
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;
@@ -1,28 +0,0 @@
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;
@@ -1,23 +0,0 @@
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;
@@ -1,26 +0,0 @@
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,19 +0,0 @@
1
- /**
2
- * Created by Arun on 30/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- var mongoose = require('mongoose');
7
-
8
- var PercentageCrossedFilter = mongoose.model('PercentageCrossedFilter', mongoose.Schema({
9
- guid: {type: String},
10
- _class : {type: String, default:"au.com.bluedot.application.spring.filter.action.PercentageCrossedFilter"},
11
- percentage : Number,
12
- timeOutSeconds : Number,
13
- type : {type: String, default:"percentageCrossedFilter"},
14
- },
15
- {
16
- _id: false
17
- }
18
- ));
19
- module.exports = PercentageCrossedFilter;
package/models/Point.js DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * Created by Arun on 30/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
-
7
- var mongoose = require('mongoose');
8
- Schema = mongoose.Schema;
9
-
10
- var Point = mongoose.model('Point', mongoose.Schema(
11
- {
12
- "type" : {type:String, default : "Point"},
13
- "coordinates" : Array
14
- },
15
- {
16
- _id: false
17
- }
18
- ));
19
-
20
- module.exports = Point;
package/models/Polygon.js DELETED
@@ -1,18 +0,0 @@
1
- /**
2
- * Created by Arun on 30/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- var mongoose = require('mongoose');
7
-
8
- Schema = mongoose.Schema;
9
- var Polygon = mongoose.model('Polygon', mongoose.Schema(
10
- {
11
- type: {type: String, default: "MultiLineString"},
12
- "coordinates" : Array
13
- },
14
- {
15
- _id: false
16
- }));
17
-
18
- module.exports = Polygon;
@@ -1,18 +0,0 @@
1
- /**
2
- * Created by Arun on 30/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- var mongoose = require('mongoose');
7
-
8
- Schema = mongoose.Schema;
9
- var Polyline = mongoose.model('Polyline', mongoose.Schema(
10
- {
11
- type: {type: String, default: "LineString"},
12
- "coordinates" : Array
13
- },
14
- {
15
- _id: false
16
- }));
17
-
18
- module.exports = Polyline;
@@ -1,17 +0,0 @@
1
- /**
2
- * Created by Arun on 10/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- var mongoose = require('mongoose');
7
- var PropertyMapping = new mongoose.Schema({
8
- _id : String,
9
- first_property : String,
10
- second_property : String,
11
- frequency : Number,
12
- dateUpdated : Date
13
- }, { collection : 'PropertyMapping' });
14
-
15
- var PropertyMapping = mongoose.model('PropertyMapping', PropertyMapping);
16
-
17
- module.exports = PropertyMapping;
@@ -1,19 +0,0 @@
1
- /**
2
- * Created by Arun on 30/09/2014.
3
- * Copyright : Bluedot Innovations.
4
- * Owner :
5
- */
6
- var mongoose = require('mongoose');
7
- Schema = mongoose.Schema;
8
-
9
- var Reference = mongoose.model('Reference', mongoose.Schema(
10
- {
11
- r: String
12
- },
13
- {
14
- _id: false
15
- }
16
- ));
17
-
18
- module.exports = Reference;
19
-
@@ -1,18 +0,0 @@
1
- /**
2
- * Created by Andrew on 24/01/2017.
3
- * Copyright : Bluedot Innovations.
4
- */
5
- var mongoose = require('mongoose');
6
-
7
- var SequenceFilter = mongoose.model('SequenceFilter', mongoose.Schema({
8
- guid: {type: String},
9
- _class : {type: String, default:"au.com.bluedot.application.spring.filter.action.SequenceFilter"},
10
- percentage : Number,
11
- timeOutSeconds : Number,
12
- type : {type: String, default:"sequenceFilter"},
13
- },
14
- {
15
- _id: false
16
- }
17
- ));
18
- module.exports = SequenceFilter;
@@ -1,29 +0,0 @@
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
- var StateEnum = require('@bluedot-innovation/enums').StateEnum;
9
-
10
- var SimpleCheckInZoneSchema = new Schema({
11
- _id: {type:String},
12
- name: String,
13
- description : {type: String, default: ''},
14
- minimumRetriggerTime : {type: Number},
15
- checkout: {type: Boolean, default : false},
16
- dataSource: {type: String, select: false, default : 'openApi'},
17
- conditionalActions: [],
18
- spatialFilters: [],
19
- creationTime : {type: Date, default: Date.now},
20
- lastUpdateTime : {type: Date, default: Date.now},
21
- activeTimeRange: Schema.Types.Mixed,
22
- applicationId: String,
23
- state: {type: String, default : StateEnum.active, select: false}
24
- },
25
- { collection : 'zone' });
26
-
27
- var SimpleCheckInZone = mongoose.model('SimpleCheckInZone', SimpleCheckInZoneSchema);
28
-
29
- module.exports = SimpleCheckInZone;