@bluedot-innovation/models 1.0.26-alpha → 2.0.0-alpha.10
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/.eslintrc.js +6 -0
- package/.gitlab-ci.yml +43 -0
- package/.nyc_output/.gitkeep +0 -0
- package/Models.js +8 -8
- package/README.MD +36 -0
- package/__tests__/action/message/messageAction.data.json +5 -0
- package/__tests__/action/message/messageAction.rules.json +3 -0
- package/__tests__/action/message/messageAction.spec.js +61 -0
- package/__tests__/action/url/urlAction.data.json +4 -0
- package/__tests__/action/url/urlAction.rules.json +3 -0
- package/__tests__/action/url/urlAction.spec.js +62 -0
- package/__tests__/dailyStats/checkDailyStats.js +30 -0
- package/__tests__/filter/beacon/beaconFilter.data.json +1 -0
- package/__tests__/filter/beacon/beaconFilter.rules.json +3 -0
- package/__tests__/filter/beacon/beaconFilter.spec.js +1 -0
- package/__tests__/filter/bearing/bearingFilter.data.json +5 -0
- package/__tests__/filter/bearing/bearingFilter.rules.json +3 -0
- package/__tests__/filter/bearing/bearingFilter.spec.js +95 -0
- package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.data.json +5 -0
- package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.rules.json +3 -0
- package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.spec.js +62 -0
- package/__tests__/filter/percentageCrossed/percentageCrossedFilter.data.json +5 -0
- package/__tests__/filter/percentageCrossed/percentageCrossedFilter.rules.json +3 -0
- package/__tests__/filter/percentageCrossed/percentageCrossedFilter.spec.js +62 -0
- package/__tests__/filter/speed/speedFilter.data.json +5 -0
- package/__tests__/filter/speed/speedFilter.rules.json +3 -0
- package/__tests__/filter/speed/speedFilter.spec.js +73 -0
- package/__tests__/filter/timeOfDayRange/timeOfDayRange.data.json +5 -0
- package/__tests__/filter/timeOfDayRange/timeOfDayRange.rules.json +3 -0
- package/__tests__/filter/timeOfDayRange/timeOfDayRange.spec.js +73 -0
- package/__tests__/geofeature/beacon/beacon.data.json +12 -0
- package/__tests__/geofeature/beacon/beacon.rules.json +13 -0
- package/__tests__/geofeature/beacon/beacon.spec.js +95 -0
- package/__tests__/geofeature/boundingBox/boundingBox.data.json +12 -0
- package/__tests__/geofeature/boundingBox/boundingBox.rules.json +3 -0
- package/__tests__/geofeature/boundingBox/boundingBox.spec.js +61 -0
- package/__tests__/geofeature/circle/circle.data.json +9 -0
- package/__tests__/geofeature/circle/circle.rules.json +3 -0
- package/__tests__/geofeature/circle/circle.spec.js +62 -0
- package/__tests__/geofeature/polygon/polygon.data.json +46 -0
- package/__tests__/geofeature/polygon/polygon.rules.json +3 -0
- package/__tests__/geofeature/polygon/polygon.spec.js +61 -0
- package/__tests__/geofeature/polyline/polyline.data.json +46 -0
- package/__tests__/geofeature/polyline/polyline.rules.json +3 -0
- package/__tests__/geofeature/polyline/polyline.spec.js +61 -0
- package/__tests__/zone/zone.action.spec.js +50 -0
- package/__tests__/zone/zone.data.json +154 -0
- package/__tests__/zone/zone.filter.spec.js +50 -0
- package/__tests__/zone/zone.geofeatures.spec.js +64 -0
- package/__tests__/zone/zone.spec.js +98 -0
- package/models/AdminPortalUser.js +10 -11
- package/models/AdminUser.js +6 -5
- package/models/Application.js +31 -30
- package/models/Beacon.js +102 -32
- package/models/BeaconFilter.js +30 -12
- package/models/BearingFilter.js +56 -17
- package/models/BoundingBox.js +36 -14
- package/models/CalendarDateRangeFilter.js +41 -0
- package/models/Circle.js +37 -19
- package/models/Contract.js +37 -38
- package/models/Customer.js +31 -31
- package/models/CustomerLogin.js +9 -10
- package/models/DBEvent.js +13 -14
- package/models/DailyStats.js +7 -7
- package/models/DeviceRulesRequest.js +27 -28
- package/models/Fence.js +12 -13
- package/models/GeoFence.js +12 -14
- package/models/Geofeature.js +16 -18
- package/models/MessageAction.js +32 -25
- package/models/NotificationLogEntry.js +7 -8
- package/models/POILocation.js +6 -7
- package/models/POILookup.js +8 -9
- package/models/POIResult.js +7 -8
- package/models/PartnerCustomer.js +12 -13
- package/models/PartnerPasswordReset.js +8 -9
- package/models/PartnerUser.js +10 -11
- package/models/Partners.js +11 -12
- package/models/PercentageCrossedFilter.js +30 -16
- package/models/Polygon.js +34 -15
- package/models/Polyline.js +35 -15
- package/models/RuleRequestAggregation.js +14 -17
- package/models/SimpleCheckInZone.js +21 -21
- package/models/SingleUseToken.js +7 -8
- package/models/SpeedFilter.js +43 -16
- package/models/TestDevice.js +11 -12
- package/models/TestDeviceCluster.js +9 -10
- package/models/TestInstance.js +9 -10
- package/models/TestScenario.js +9 -10
- package/models/TimeOfDayRange.js +16 -16
- package/models/TimeOfDayRangeFilter.js +39 -16
- package/models/UrlAction.js +51 -0
- package/models/Zone.js +97 -0
- package/models/ZoneUIState.js +18 -18
- package/package.json +25 -4
- package/schemas/Point.js +13 -0
- package/NodeModels.iml +0 -9
- package/models/ApplicationNotificationAction.js +0 -30
- package/models/ApplicationUsage.js +0 -11
- package/models/ConfigurationParameters.js +0 -20
- package/models/DateRangeFilter.js +0 -20
- package/models/FormattedBeacon.js +0 -16
- package/models/FormattedCircle.js +0 -12
- package/models/FormattedConditions.js +0 -11
- package/models/FormattedDateRange.js +0 -11
- package/models/FormattedPercentageCrossed.js +0 -12
- package/models/FormattedPoint.js +0 -10
- package/models/FormattedPolygon.js +0 -11
- package/models/FormattedPolyline.js +0 -11
- package/models/FormattedRectangle.js +0 -12
- package/models/FormattedTimeActive.js +0 -17
- package/models/FormattedZone.js +0 -28
- package/models/MonthlyStats.js +0 -28
- package/models/Point.js +0 -20
- package/models/PropertyMapping.js +0 -17
- package/models/Reference.js +0 -19
- package/models/SequenceFilter.js +0 -18
- package/models/SoundAction.js +0 -28
- package/models/URLAction.js +0 -31
- package/models/VibrationAction.js +0 -28
- package/models/property.js +0 -25
package/models/BearingFilter.js
CHANGED
|
@@ -1,19 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
toAngle : Number,
|
|
13
|
-
type : {type: String, default:"bearingFilter"}
|
|
14
|
-
},
|
|
1
|
+
let mongoose = require('mongoose')
|
|
2
|
+
let uuidv4 = require('uuid/v4')
|
|
3
|
+
|
|
4
|
+
const schema = {
|
|
5
|
+
guid: {type: String, default: uuidv4},
|
|
6
|
+
fromAngle: {type: Number, required: [true, 'fromAngle is required. '], min: 0, max: 359},
|
|
7
|
+
toAngle: {type: Number, required: true, min: 0, max: 359, validate: {validator: validateAngles, msg: 'default error message'}}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const BearingFilterSchema = new mongoose.Schema(
|
|
11
|
+
schema,
|
|
15
12
|
{
|
|
16
|
-
_id: false
|
|
13
|
+
_id: false,
|
|
14
|
+
versionKey: false
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
BearingFilterSchema.add({
|
|
18
|
+
type:
|
|
19
|
+
{type: String, required: true}
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
function validateAngles (toAngle, cb) {
|
|
23
|
+
let magicCallback = cb
|
|
24
|
+
let fromAngle = this.fromAngle
|
|
25
|
+
|
|
26
|
+
if (!toAngle && toAngle !== 0) {
|
|
27
|
+
return magicCallback(false, 'toAngle is required')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (toAngle === fromAngle) {
|
|
31
|
+
return magicCallback(false, 'fromAngle and toAngle cannot be the same')
|
|
17
32
|
}
|
|
18
|
-
|
|
19
|
-
|
|
33
|
+
|
|
34
|
+
if (fromAngle > toAngle) {
|
|
35
|
+
if ((fromAngle - toAngle) <= 270) {
|
|
36
|
+
return magicCallback(false, 'From Angle and To Angle must best separated by at least 90 degrees in both directions')
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (toAngle > fromAngle) {
|
|
40
|
+
if (((toAngle - fromAngle) < 90) || (((toAngle - fromAngle) > 270))) {
|
|
41
|
+
return magicCallback(false, 'From Angle and To Angle must best separated by at least 90 degrees in both directions')
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
magicCallback(true)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// optional mongoose
|
|
48
|
+
module.exports = (mongooseInstance) => {
|
|
49
|
+
let BearingFilter
|
|
50
|
+
if (mongooseInstance) {
|
|
51
|
+
BearingFilter = mongooseInstance.model('BearingFilter', BearingFilterSchema)
|
|
52
|
+
} else {
|
|
53
|
+
BearingFilter = mongoose.model('BearingFilter', BearingFilterSchema)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return BearingFilter
|
|
57
|
+
}
|
|
58
|
+
module.exports.bearingFilterSchema = schema
|
package/models/BoundingBox.js
CHANGED
|
@@ -1,17 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
var mongoose = require('mongoose');
|
|
7
|
-
Schema = mongoose.Schema;
|
|
1
|
+
let mongoose = require('mongoose')
|
|
2
|
+
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
3
|
+
let uuidv4 = require('uuid/v4')
|
|
4
|
+
let Point = require('../schemas/Point')
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
6
|
+
const schema = {
|
|
7
|
+
guid: {type: String, default: uuidv4},
|
|
8
|
+
name: {type: String, required: [true, 'name is required. ']},
|
|
9
|
+
northEast: {type: Point, required: [true, 'northEast is required. ']},
|
|
10
|
+
southWest: {type: Point, required: [true, 'southWest 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
|
+
|
|
16
|
+
const BoundingBoxSchema = new mongoose.Schema(
|
|
17
|
+
schema,
|
|
13
18
|
{
|
|
14
|
-
_id: false
|
|
19
|
+
_id: false,
|
|
20
|
+
versionKey: false
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
BoundingBoxSchema.add({
|
|
24
|
+
type:
|
|
25
|
+
{type: String, required: true}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
// optional mongoose
|
|
29
|
+
module.exports = (mongooseInstance) => {
|
|
30
|
+
let BoundingBox
|
|
31
|
+
if (mongooseInstance) {
|
|
32
|
+
BoundingBox = mongooseInstance.model('BoundingBox', BoundingBoxSchema)
|
|
33
|
+
} else {
|
|
34
|
+
BoundingBox = mongoose.model('BoundingBox', BoundingBox)
|
|
15
35
|
}
|
|
16
|
-
|
|
17
|
-
|
|
36
|
+
|
|
37
|
+
return BoundingBox
|
|
38
|
+
}
|
|
39
|
+
module.exports.boundingBoxSchema = schema
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
let mongoose = require('mongoose')
|
|
2
|
+
let uuidv4 = require('uuid/v4')
|
|
3
|
+
|
|
4
|
+
let schema = {
|
|
5
|
+
guid: {type: String, default: uuidv4},
|
|
6
|
+
startDate: {type: Date, required: [true, 'startDate is required. ']},
|
|
7
|
+
endDate: {type: Date, required: [true, 'endDate is required. '], validate: validateDateRange}
|
|
8
|
+
}
|
|
9
|
+
let CalendarDateRangeSchema = new mongoose.Schema(
|
|
10
|
+
schema,
|
|
11
|
+
{
|
|
12
|
+
_id: false,
|
|
13
|
+
versionKey: false
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
CalendarDateRangeSchema.add({
|
|
17
|
+
type:
|
|
18
|
+
{type: String, required: true}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
function validateDateRange (endDate) {
|
|
22
|
+
let startDate = new Date(this.startDate)
|
|
23
|
+
endDate = new Date(endDate)
|
|
24
|
+
|
|
25
|
+
if (endDate < startDate) {
|
|
26
|
+
throw new Error('startDate has to be less than endDate. ')
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// optional mongoose
|
|
31
|
+
module.exports = (mongooseInstance) => {
|
|
32
|
+
let CalendarDateRange
|
|
33
|
+
if (mongooseInstance) {
|
|
34
|
+
CalendarDateRange = mongooseInstance.model('CalendarDateRange', CalendarDateRangeSchema)
|
|
35
|
+
} else {
|
|
36
|
+
CalendarDateRange = mongoose.model('CalendarDateRange', CalendarDateRangeSchema)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return CalendarDateRange
|
|
40
|
+
}
|
|
41
|
+
module.exports.calendarDateRangeSchema = schema
|
package/models/Circle.js
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
let mongoose = require('mongoose')
|
|
2
|
+
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
3
|
+
let Point = require('../schemas/Point')
|
|
4
|
+
let uuidv4 = require('uuid/v4')
|
|
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
|
+
|
|
16
|
+
let CircleSchema = new mongoose.Schema(
|
|
17
|
+
schema,
|
|
17
18
|
{
|
|
18
|
-
_id: false
|
|
19
|
+
_id: false,
|
|
20
|
+
__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)
|
|
19
35
|
}
|
|
20
|
-
|
|
21
|
-
|
|
36
|
+
|
|
37
|
+
return Circle
|
|
38
|
+
}
|
|
39
|
+
module.exports.circleSchema = schema
|
package/models/Contract.js
CHANGED
|
@@ -3,43 +3,42 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
let 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
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
8
|
+
let Contract = mongoose.model('Contract', new mongoose.Schema(
|
|
9
|
+
{
|
|
10
|
+
customerId: String,
|
|
11
|
+
organisationName: String,
|
|
12
|
+
addressLine1: String,
|
|
13
|
+
addressLine2: String,
|
|
14
|
+
addressCity: String,
|
|
15
|
+
addressRegion: String,
|
|
16
|
+
addressPostcode: String,
|
|
17
|
+
addressCountry: String,
|
|
18
|
+
billingFirstName: String,
|
|
19
|
+
billingLastName: String,
|
|
20
|
+
billingTaxNumber: String,
|
|
21
|
+
billingEmail: String,
|
|
22
|
+
tradingName: String,
|
|
23
|
+
salesforceUrl: String,
|
|
24
|
+
startDate: {type: Date, default: Date.now},
|
|
25
|
+
endDate: {type: Date, default: Date.now},
|
|
26
|
+
frequency: mongoose.Schema.Types.Number,
|
|
27
|
+
monthEntries: [],
|
|
28
|
+
currency: {type: String, default: 'USD'},
|
|
29
|
+
currencyRate: Number,
|
|
30
|
+
template: String,
|
|
31
|
+
addedBy: String,
|
|
32
|
+
lastEditedBy: String,
|
|
33
|
+
xeroContactId: String,
|
|
34
|
+
state: String,
|
|
35
|
+
creationTime: {type: Date, default: Date.now},
|
|
36
|
+
lastUpdateTime: {type: Date, default: Date.now},
|
|
37
|
+
dataSource: {type: String, select: false, default: 'adminPortal'}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
collection: 'contract'
|
|
41
|
+
})
|
|
42
|
+
)
|
|
44
43
|
|
|
45
|
-
module.exports = Contract
|
|
44
|
+
module.exports = Contract
|
package/models/Customer.js
CHANGED
|
@@ -3,36 +3,36 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
let mongoose = require('mongoose')
|
|
7
|
+
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
8
|
+
let Schema = mongoose.Schema
|
|
8
9
|
|
|
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
|
-
collection
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
);
|
|
10
|
+
let Customer = mongoose.model('Customer', new mongoose.Schema(
|
|
11
|
+
{
|
|
12
|
+
_id: String,
|
|
13
|
+
customerApiKey: String,
|
|
14
|
+
email: String,
|
|
15
|
+
password: String,
|
|
16
|
+
name: String,
|
|
17
|
+
userName: String,
|
|
18
|
+
state: {type: String, default: StateEnum.active},
|
|
19
|
+
'creationTime': {type: Date, default: Date.now},
|
|
20
|
+
'lastUpdateTime': {type: Date, default: Date.now},
|
|
21
|
+
'dataSource': {type: String, select: false, default: 'openApi'},
|
|
22
|
+
integrations: Schema.Types.Mixed,
|
|
23
|
+
firstName: String,
|
|
24
|
+
lastName: String,
|
|
25
|
+
oldPassword: String,
|
|
26
|
+
organisationWebsite: String,
|
|
27
|
+
organisationName: String,
|
|
28
|
+
phoneNumber: String,
|
|
29
|
+
createdBy: String,
|
|
30
|
+
poiCredits: {type: Number, default: 0},
|
|
31
|
+
address: []
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
collection: 'customer'
|
|
35
|
+
})
|
|
36
|
+
)
|
|
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,16 +19,15 @@ var CustomerLogin = mongoose.model('CustomerLogin', new mongoose.Schema(
|
|
|
19
19
|
integrations: {},
|
|
20
20
|
resetToken: String,
|
|
21
21
|
lastLoginTime: Date,
|
|
22
|
-
state: {type:String, default: StateEnum.active},
|
|
23
|
-
creationTime
|
|
24
|
-
lastUpdateTime
|
|
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
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
);
|
|
29
|
+
collection: 'customerLogin'
|
|
30
|
+
})
|
|
31
|
+
)
|
|
33
32
|
|
|
34
|
-
module.exports = CustomerLogin
|
|
33
|
+
module.exports = CustomerLogin
|
package/models/DBEvent.js
CHANGED
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
Schema = mongoose.Schema;
|
|
6
|
+
let mongoose = require('mongoose')
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
)
|
|
19
|
-
|
|
8
|
+
let DBEventSchema = new mongoose.Schema({
|
|
9
|
+
_class: {type: String, default: 'au.com.bluedot.application.spring.DBEvent'},
|
|
10
|
+
customerId: String,
|
|
11
|
+
customerEmail: String,
|
|
12
|
+
actionName: String,
|
|
13
|
+
referenceId: String,
|
|
14
|
+
creationTime: {type: Date, select: false, default: Date.now}
|
|
15
|
+
},
|
|
16
|
+
{collection: 'dbevent'}
|
|
17
|
+
)
|
|
18
|
+
let DBEvent = mongoose.model('DBEvent', DBEventSchema)
|
|
20
19
|
|
|
21
|
-
module.exports = DBEvent
|
|
20
|
+
module.exports = DBEvent
|
package/models/DailyStats.js
CHANGED
|
@@ -4,25 +4,25 @@
|
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
const mongoose = require('mongoose')
|
|
8
|
-
|
|
7
|
+
const mongoose = require('mongoose')
|
|
8
|
+
const Schema = mongoose.Schema
|
|
9
|
+
const uuidv4 = require('uuid/v4')
|
|
9
10
|
|
|
10
11
|
const DailyStats = mongoose.model(
|
|
11
12
|
'DailyStats',
|
|
12
13
|
new Schema(
|
|
13
14
|
{
|
|
14
|
-
_id: {
|
|
15
|
+
_id: {type: String, default: uuidv4},
|
|
15
16
|
totalEndUsers: Number,
|
|
16
17
|
totalIos: Number,
|
|
17
18
|
totalAndroid: Number,
|
|
18
|
-
|
|
19
|
-
creationTime: { type: Date, default: Date.now }
|
|
19
|
+
creationDate: {type: Date, default: Date.now}
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
collection: 'dailyStats',
|
|
23
23
|
versionKey: false
|
|
24
24
|
}
|
|
25
25
|
)
|
|
26
|
-
)
|
|
26
|
+
)
|
|
27
27
|
|
|
28
|
-
module.exports = DailyStats
|
|
28
|
+
module.exports = DailyStats
|
|
@@ -3,35 +3,34 @@
|
|
|
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
|
-
|
|
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 }
|
|
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
|
|
30
16
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
)
|
|
36
35
|
|
|
37
|
-
module.exports = DeviceRulesRequest
|
|
36
|
+
module.exports = DeviceRulesRequest
|
package/models/Fence.js
CHANGED
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
Schema = mongoose.Schema
|
|
6
|
+
let mongoose = require('mongoose')
|
|
7
|
+
const Schema = mongoose.Schema
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
);
|
|
9
|
+
let FenceSchema = new mongoose.Schema({
|
|
10
|
+
'_id': {type: String},
|
|
11
|
+
'creationTime': {type: Date, default: Date.now},
|
|
12
|
+
'lastUpdateTime': {type: Date, default: Date.now},
|
|
13
|
+
'type': {type: String, default: 'Feature'},
|
|
14
|
+
'dataSource': {type: String, select: false, default: 'openApi'},
|
|
15
|
+
'geometry': {type: Schema.Types.Mixed, default: {}}
|
|
16
|
+
})
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
let Fence = mongoose.model('Fence', FenceSchema)
|
|
20
19
|
|
|
21
|
-
module.exports = Fence
|
|
20
|
+
module.exports = Fence
|
package/models/GeoFence.js
CHANGED
|
@@ -3,21 +3,19 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
Schema = mongoose.Schema;
|
|
6
|
+
let mongoose = require('mongoose')
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
"fenceId" : String,
|
|
16
|
-
"fenceName" : String
|
|
8
|
+
let FenceSchema = new mongoose.Schema({
|
|
9
|
+
_id: {type: String},
|
|
10
|
+
'geometry': {
|
|
11
|
+
'type': { type: String, required: true },
|
|
12
|
+
'coordinates': {type: Array, required: true}
|
|
17
13
|
},
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
'fenceId': String,
|
|
15
|
+
'fenceName': String
|
|
16
|
+
},
|
|
17
|
+
{collection: 'GeoFence'})
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
let GeoFence = mongoose.model('GeoFence', FenceSchema)
|
|
22
20
|
|
|
23
|
-
module.exports = GeoFence
|
|
21
|
+
module.exports = GeoFence
|
package/models/Geofeature.js
CHANGED
|
@@ -3,24 +3,22 @@
|
|
|
3
3
|
* Copyright : Bluedot Innovations.
|
|
4
4
|
* Owner :
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
let mongoose = require('mongoose')
|
|
7
|
+
let Schema = mongoose.Schema
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
{ collection : 'geofeature' });
|
|
9
|
+
let GeofeatureSchema = new Schema({
|
|
10
|
+
geometry: Schema.Types.Mixed,
|
|
11
|
+
referenceId: String,
|
|
12
|
+
apiKey: String,
|
|
13
|
+
zoneId: String,
|
|
14
|
+
type: String,
|
|
15
|
+
name: String,
|
|
16
|
+
beaconType: String,
|
|
17
|
+
creationTime: {type: Date, default: Date.now},
|
|
18
|
+
lastUpdateTime: {type: Date, default: Date.now}
|
|
19
|
+
},
|
|
20
|
+
{ collection: 'geofeature' })
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
let Geofeature = mongoose.model('Geofeature', GeofeatureSchema)
|
|
25
23
|
|
|
26
|
-
module.exports = Geofeature
|
|
24
|
+
module.exports = Geofeature
|