@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.
- package/Models.js +10 -55
- package/models/AdminPortalUser.js +11 -10
- package/models/AdminUser.js +10 -0
- package/models/Application.js +38 -0
- package/models/ApplicationNotificationAction.js +30 -0
- package/models/ApplicationUsage.js +11 -0
- package/models/Beacon.js +32 -84
- package/models/BeaconFilter.js +23 -0
- package/models/BearingFilter.js +19 -0
- package/models/BoundingBox.js +17 -0
- package/models/Circle.js +21 -0
- package/models/ConfigurationParameters.js +20 -0
- package/models/Contract.js +38 -37
- package/models/Customer.js +38 -0
- package/models/CustomerLogin.js +10 -9
- package/models/DBEvent.js +14 -13
- package/models/DailyStats.js +7 -7
- package/models/DateRangeFilter.js +20 -0
- package/models/DeviceRulesRequest.js +28 -27
- package/models/Fence.js +21 -0
- package/models/FormattedBeacon.js +16 -0
- package/models/FormattedCircle.js +12 -0
- package/models/FormattedConditions.js +11 -0
- package/models/FormattedDateRange.js +11 -0
- package/models/FormattedPercentageCrossed.js +12 -0
- package/models/FormattedPoint.js +10 -0
- package/models/FormattedPolygon.js +11 -0
- package/models/FormattedPolyline.js +11 -0
- package/models/FormattedRectangle.js +12 -0
- package/models/FormattedTimeActive.js +17 -0
- package/models/FormattedZone.js +28 -0
- package/models/GeoFence.js +23 -0
- package/models/Geofeature.js +26 -0
- package/models/MessageAction.js +26 -28
- package/models/MonthlyStats.js +19 -35
- package/models/NotificationLogEntry.js +8 -7
- package/models/POILocation.js +7 -6
- package/models/POILookup.js +9 -8
- package/models/POIResult.js +8 -7
- package/models/PartnerCustomer.js +13 -12
- package/models/PartnerPasswordReset.js +9 -8
- package/models/PartnerUser.js +11 -10
- package/models/Partners.js +12 -11
- package/models/PercentageCrossedFilter.js +19 -0
- package/models/Point.js +20 -0
- package/models/Polygon.js +18 -0
- package/models/Polyline.js +18 -0
- package/models/PropertyMapping.js +17 -0
- package/models/Reference.js +19 -0
- package/models/RuleRequestAggregation.js +17 -33
- package/models/SequenceFilter.js +18 -0
- package/models/SimpleCheckInZone.js +29 -0
- package/models/SingleUseToken.js +8 -7
- package/models/SoundAction.js +28 -0
- package/models/SpeedFilter.js +19 -0
- package/models/TestDevice.js +12 -11
- package/models/TestDeviceCluster.js +10 -9
- package/models/TestInstance.js +10 -9
- package/models/TestScenario.js +10 -9
- package/models/TimeOfDayRange.js +16 -16
- package/models/TimeOfDayRangeFilter.js +19 -0
- package/models/URLAction.js +31 -0
- package/models/VibrationAction.js +28 -0
- package/models/ZoneUIState.js +18 -18
- package/models/property.js +25 -0
- package/package-lock.json.bak +170 -0
- package/package.json +6 -30
- package/.eslintrc.js +0 -42
- package/.gitlab-ci.yml +0 -43
- package/CHANGELOG.md +0 -152
- package/README.MD +0 -36
- package/__tests__/account/account.data.json +0 -12
- package/__tests__/account/account.rules.js +0 -8
- package/__tests__/account/account.spec.js +0 -83
- package/__tests__/action/message/messageAction.data.json +0 -5
- package/__tests__/action/message/messageAction.rules.json +0 -3
- package/__tests__/action/message/messageAction.spec.js +0 -61
- package/__tests__/action/url/urlAction.data.json +0 -4
- package/__tests__/action/url/urlAction.rules.json +0 -3
- package/__tests__/action/url/urlAction.spec.js +0 -74
- package/__tests__/beacon/beacon.data.json +0 -15
- package/__tests__/beacon/beacon.rules.json +0 -13
- package/__tests__/beacon/beacon.spec.js +0 -104
- package/__tests__/condition/beacon/beaconFilter.data.json +0 -1
- package/__tests__/condition/beacon/beaconFilter.rules.json +0 -3
- package/__tests__/condition/beacon/beaconFilter.spec.js +0 -1
- package/__tests__/condition/dayRange/dayRange.data.json +0 -5
- package/__tests__/condition/dayRange/dayRange.rules.json +0 -3
- package/__tests__/condition/dayRange/dayRange.spec.js +0 -74
- package/__tests__/condition/percentageCrossed/travelPath.data.json +0 -5
- package/__tests__/condition/percentageCrossed/travelPath.rules.json +0 -3
- package/__tests__/condition/percentageCrossed/travelPath.spec.js +0 -62
- package/__tests__/condition/speed/speed.data.json +0 -5
- package/__tests__/condition/speed/speed.rules.json +0 -3
- package/__tests__/condition/speed/speed.spec.js +0 -73
- package/__tests__/condition/timeActive/timeActive.data.json +0 -5
- package/__tests__/condition/timeActive/timeActive.rules.json +0 -7
- package/__tests__/condition/timeActive/timeActive.spec.js +0 -94
- package/__tests__/condition/travelDirection/travelDirection.data.json +0 -5
- package/__tests__/condition/travelDirection/travelDirection.rules.json +0 -3
- package/__tests__/condition/travelDirection/travelDirection.spec.js +0 -132
- package/__tests__/dailyStats/checkDailyStats.js +0 -31
- package/__tests__/geofeature/boundingBox/boundingBox.data.json +0 -12
- package/__tests__/geofeature/boundingBox/boundingBox.rules.json +0 -3
- package/__tests__/geofeature/boundingBox/boundingBox.spec.js +0 -78
- package/__tests__/geofeature/circle/circle.data.json +0 -9
- package/__tests__/geofeature/circle/circle.rules.json +0 -3
- package/__tests__/geofeature/circle/circle.spec.js +0 -71
- package/__tests__/geofeature/geoline/geoline.data.json +0 -46
- package/__tests__/geofeature/geoline/geoline.rules.json +0 -3
- package/__tests__/geofeature/geoline/geoline.spec.js +0 -70
- package/__tests__/geofeature/polygon/polygon.data.json +0 -46
- package/__tests__/geofeature/polygon/polygon.rules.json +0 -3
- package/__tests__/geofeature/polygon/polygon.spec.js +0 -127
- package/__tests__/geofeature/zoneBeacon/zoneBeacon.data.json +0 -16
- package/__tests__/geofeature/zoneBeacon/zoneBeacon.rules.json +0 -13
- package/__tests__/geofeature/zoneBeacon/zoneBeacon.spec.js +0 -62
- package/__tests__/monthlyStats/monthlyStats.data.json +0 -29
- package/__tests__/monthlyStats/monthlyStats.spec.js +0 -66
- package/__tests__/project/project.data.json +0 -18
- package/__tests__/project/project.rules.json +0 -9
- package/__tests__/project/project.spec.js +0 -81
- package/__tests__/ruleRequestAggregation/ruleRequestAggregation.data.json +0 -8
- package/__tests__/ruleRequestAggregation/ruleRequestAggregation.spec.js +0 -69
- package/__tests__/setup.js +0 -7
- package/__tests__/user/user.data.js +0 -19
- package/__tests__/user/user.rules.js +0 -8
- package/__tests__/user/user.spec.js +0 -130
- package/__tests__/utils/utils.spec.js +0 -24
- package/__tests__/zone/zone.action.spec.js +0 -50
- package/__tests__/zone/zone.condition.spec.js +0 -76
- package/__tests__/zone/zone.data.json +0 -157
- package/__tests__/zone/zone.geofeatures.spec.js +0 -75
- package/__tests__/zone/zone.spec.js +0 -134
- package/constants/errorMessages.js +0 -2
- package/helpers.js +0 -102
- package/models/Account.js +0 -50
- package/models/Project.js +0 -55
- package/models/UrlAction.js +0 -46
- package/models/User.js +0 -61
- package/models/Zone.js +0 -123
- package/models/conditions/DayRange.js +0 -52
- package/models/conditions/Speed.js +0 -42
- package/models/conditions/TimeActive.js +0 -50
- package/models/conditions/TravelDirection.js +0 -67
- package/models/conditions/TravelPath.js +0 -36
- package/models/geofeatures/BoundingBox.js +0 -44
- package/models/geofeatures/Circle.js +0 -39
- package/models/geofeatures/Geoline.js +0 -34
- package/models/geofeatures/Polygon.js +0 -45
- package/models/geofeatures/ZoneBeacon.js +0 -28
- package/schemas/MultiLineStringGeometry.js +0 -14
- package/schemas/Point.js +0 -13
- package/schemas/PointGeometry.js +0 -14
- package/schemas/PolygonGeometry.js +0 -14
- package/schemas/ProjectPermission.js +0 -21
- package/schemas/Webhook.js +0 -22
- package/utils/index.js +0 -39
- package/validators/checkDistanceBetweenVertices.js +0 -21
- 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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
ADDED
|
@@ -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,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,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;
|
package/models/MessageAction.js
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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;
|
package/models/MonthlyStats.js
CHANGED
|
@@ -4,41 +4,25 @@
|
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
const mongoose = require('mongoose')
|
|
8
|
-
|
|
9
|
-
const helpers = require('../helpers')
|
|
7
|
+
const mongoose = require('mongoose'),
|
|
8
|
+
Schema = mongoose.Schema;
|
|
10
9
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
var NotificationLogEntry = mongoose.model('NotificationLogEntry', new mongoose.Schema(
|
|
9
10
|
{
|
|
10
11
|
_id: String,
|
|
11
|
-
|
|
12
|
-
|
|
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;
|
package/models/POILocation.js
CHANGED
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
7
|
|
|
8
|
-
|
|
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;
|
package/models/POILookup.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
7
|
|
|
8
|
-
|
|
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
|
-
|
|
21
|
-
|
|
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;
|
package/models/POIResult.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Created by andrewstirling on 12/4/17.
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
var mongoose = require('mongoose');
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
var POIResult = mongoose.model('POIResult', new mongoose.Schema(
|
|
7
7
|
{
|
|
8
8
|
_id: String,
|
|
9
9
|
lookupId: String,
|
|
10
10
|
page: Number,
|
|
11
|
-
|
|
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
|
-
|
|
5
|
-
|
|
4
|
+
var mongoose = require('mongoose');
|
|
5
|
+
var StateEnum = require('@bluedot-innovation/enums').StateEnum;
|
|
6
6
|
|
|
7
|
-
|
|
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:
|
|
24
|
-
state: {type:
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
4
|
+
var mongoose = require('mongoose');
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
var PartnerPasswordReset = mongoose.model('PartnerPasswordReset', new mongoose.Schema(
|
|
7
7
|
{
|
|
8
8
|
emailAddress: String,
|
|
9
9
|
partnerUserId: String,
|
|
10
10
|
token: String,
|
|
11
|
-
|
|
12
|
-
|
|
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;
|