@bluedot-innovation/models 2.0.0-alpha.9 → 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.
- package/Models.js +8 -8
- package/__tests__/zone/checkActions.js +64 -0
- package/__tests__/zone/checkAppId.js +41 -0
- package/__tests__/zone/checkBeacon.js +46 -0
- package/__tests__/zone/checkBearingFitler.js +48 -0
- package/__tests__/zone/checkBoundingBox.js +44 -0
- package/__tests__/zone/checkCalendarDateRangeFilterFitler.js +48 -0
- package/__tests__/zone/checkCircle.js +41 -0
- package/__tests__/zone/checkMRT.js +46 -0
- package/__tests__/zone/checkPercentageCrossedFitler.js +48 -0
- package/__tests__/zone/checkPolygon.js +78 -0
- package/__tests__/zone/checkPolyline.js +78 -0
- package/__tests__/zone/checkSpeedFitler.js +48 -0
- package/__tests__/zone/checkTimeOfDayRangeFitler.js +48 -0
- package/models/AdminPortalUser.js +11 -10
- package/models/AdminUser.js +5 -6
- package/models/Application.js +30 -31
- package/models/Beacon.js +78 -91
- package/models/BeaconFilter.js +12 -30
- package/models/BearingFilter.js +23 -45
- package/models/BoundingBox.js +20 -35
- package/models/CalendarDateRangeFilter.js +19 -33
- package/models/Circle.js +18 -32
- package/models/Contract.js +38 -37
- package/models/Customer.js +31 -31
- package/models/CustomerLogin.js +10 -9
- package/models/DBEvent.js +14 -13
- package/models/DeviceRulesRequest.js +28 -27
- package/models/Fence.js +13 -12
- package/models/GeoFence.js +14 -12
- package/models/Geofeature.js +18 -16
- package/models/MessageAction.js +16 -30
- 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 +15 -29
- package/models/Polygon.js +19 -33
- package/models/Polyline.js +19 -34
- package/models/RuleRequestAggregation.js +15 -14
- package/models/SimpleCheckInZone.js +21 -21
- package/models/SingleUseToken.js +8 -7
- package/models/SpeedFilter.js +19 -38
- 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 +18 -34
- package/models/URLAction.js +34 -0
- package/models/Zone.js +274 -84
- package/models/ZoneUIState.js +18 -18
- package/package.json +7 -20
- package/schemas/Point.js +13 -10
- package/.eslintrc.js +0 -6
- package/.gitlab-ci.yml +0 -43
- package/.nyc_output/.gitkeep +0 -0
- package/README.MD +0 -36
- 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 -62
- package/__tests__/dailyStats/checkDailyStats.js +0 -30
- package/__tests__/filter/beacon/beaconFilter.data.json +0 -1
- package/__tests__/filter/beacon/beaconFilter.rules.json +0 -3
- package/__tests__/filter/beacon/beaconFilter.spec.js +0 -1
- package/__tests__/filter/bearing/bearingFilter.data.json +0 -5
- package/__tests__/filter/bearing/bearingFilter.rules.json +0 -3
- package/__tests__/filter/bearing/bearingFilter.spec.js +0 -95
- package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.data.json +0 -5
- package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.rules.json +0 -3
- package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.spec.js +0 -62
- package/__tests__/filter/percentageCrossed/percentageCrossedFilter.data.json +0 -5
- package/__tests__/filter/percentageCrossed/percentageCrossedFilter.rules.json +0 -3
- package/__tests__/filter/percentageCrossed/percentageCrossedFilter.spec.js +0 -62
- package/__tests__/filter/speed/speedFilter.data.json +0 -5
- package/__tests__/filter/speed/speedFilter.rules.json +0 -3
- package/__tests__/filter/speed/speedFilter.spec.js +0 -73
- package/__tests__/filter/timeOfDayRange/timeOfDayRange.data.json +0 -5
- package/__tests__/filter/timeOfDayRange/timeOfDayRange.rules.json +0 -3
- package/__tests__/filter/timeOfDayRange/timeOfDayRange.spec.js +0 -73
- package/__tests__/geofeature/beacon/beacon.data.json +0 -12
- package/__tests__/geofeature/beacon/beacon.rules.json +0 -13
- package/__tests__/geofeature/beacon/beacon.spec.js +0 -95
- 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 -61
- 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 -62
- 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 -61
- package/__tests__/geofeature/polyline/polyline.data.json +0 -46
- package/__tests__/geofeature/polyline/polyline.rules.json +0 -3
- package/__tests__/geofeature/polyline/polyline.spec.js +0 -61
- package/__tests__/zone/zone.action.spec.js +0 -50
- package/__tests__/zone/zone.data.json +0 -154
- package/__tests__/zone/zone.filter.spec.js +0 -50
- package/__tests__/zone/zone.geofeatures.spec.js +0 -74
- package/__tests__/zone/zone.spec.js +0 -98
- package/models/DailyStats.js +0 -28
- package/models/UrlAction.js +0 -51
package/models/Circle.js
CHANGED
|
@@ -1,39 +1,25 @@
|
|
|
1
|
-
let mongoose
|
|
2
|
-
let StateEnum
|
|
3
|
-
let Point
|
|
4
|
-
let
|
|
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
|
-
|
|
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
|
-
|
|
38
|
-
}
|
|
39
|
-
module.exports.circleSchema = schema
|
|
25
|
+
module.exports = Circle;
|
package/models/Contract.js
CHANGED
|
@@ -3,42 +3,43 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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;
|
package/models/Customer.js
CHANGED
|
@@ -3,36 +3,36 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let Schema = mongoose.Schema
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
var StateEnum = require('@bluedot-innovation/enums').StateEnum;
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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;
|
package/models/CustomerLogin.js
CHANGED
|
@@ -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:
|
|
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
|
-
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
Schema = mongoose.Schema;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
{collection: 'dbevent'}
|
|
17
|
-
)
|
|
18
|
-
|
|
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
|
-
|
|
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
CHANGED
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
Schema = mongoose.Schema;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
19
|
+
var Fence = mongoose.model('Fence', FenceSchema);
|
|
19
20
|
|
|
20
|
-
module.exports = Fence
|
|
21
|
+
module.exports = Fence;
|
package/models/GeoFence.js
CHANGED
|
@@ -3,19 +3,21 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
Schema = mongoose.Schema;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
'
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
{collection: 'GeoFence'})
|
|
18
|
+
{ collection : 'GeoFence' }
|
|
19
|
+
);
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
var GeoFence = mongoose.model('GeoFence', FenceSchema);
|
|
20
22
|
|
|
21
|
-
module.exports = GeoFence
|
|
23
|
+
module.exports = GeoFence;
|
package/models/Geofeature.js
CHANGED
|
@@ -3,22 +3,24 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
var mongoose = require('mongoose'),
|
|
7
|
+
Schema = mongoose.Schema;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
{
|
|
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' });
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
var Geofeature = mongoose.model('Geofeature', GeofeatureSchema);
|
|
23
25
|
|
|
24
|
-
module.exports = Geofeature
|
|
26
|
+
module.exports = Geofeature;
|
package/models/MessageAction.js
CHANGED
|
@@ -1,36 +1,22 @@
|
|
|
1
|
-
let mongoose
|
|
2
|
-
let StateEnum
|
|
3
|
-
let
|
|
1
|
+
let mongoose = require('mongoose');
|
|
2
|
+
let StateEnum = require('@bluedot-innovation/enums').StateEnum;
|
|
3
|
+
let uuidv1 = require('uuid/v1');
|
|
4
4
|
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|