@bluedot-innovation/models 1.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/.npmignore +1 -0
- package/Models.js +12 -0
- package/models/AdminPortalUser.js +24 -0
- 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 +36 -0
- package/models/BeaconFilter.js +23 -0
- package/models/BoundingBox.js +17 -0
- package/models/Circle.js +21 -0
- package/models/ConstrainAccuracyAction.js +11 -0
- package/models/Contract.js +41 -0
- package/models/Customer.js +28 -0
- package/models/CustomerSubscription.js +11 -0
- package/models/DBEvent.js +21 -0
- package/models/DateRangeFilter.js +21 -0
- package/models/Fence.js +22 -0
- package/models/FenceCollection.js +17 -0
- package/models/FenceFilter.js +30 -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 +24 -0
- package/models/Geofeature.js +26 -0
- package/models/Location.js +31 -0
- package/models/MessageAction.js +29 -0
- package/models/MetaData.js +11 -0
- package/models/NotificationLogEntry.js +19 -0
- package/models/PartnerCustomer.js +35 -0
- package/models/PartnerPasswordReset.js +20 -0
- package/models/PartnerUser.js +30 -0
- package/models/Partners.js +18 -0
- package/models/PercentageCrossedFilter.js +20 -0
- package/models/Permission.js +11 -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/Role.js +11 -0
- package/models/RuleSet.js +11 -0
- package/models/ServerNotificationAction.js +11 -0
- package/models/SimpleCheckInZone.js +29 -0
- package/models/SingleUseToken.js +19 -0
- package/models/SoundAction.js +28 -0
- package/models/TimeOfDayRange.js +23 -0
- package/models/TimeOfDayRangeFilter.js +20 -0
- package/models/URLAction.js +31 -0
- package/models/UserGroup.js +11 -0
- package/models/VibrationAction.js +28 -0
- package/models/ZoneUIState.js +25 -0
- package/models/property.js +25 -0
- package/package.json +15 -0
- package/test.js +3 -0
package/.npmignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.idea
|
package/Models.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by andrewstirling on 22/12/16.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
var Models = {};
|
|
6
|
+
var normalizedPath = require("path").join(__dirname, "models");
|
|
7
|
+
|
|
8
|
+
require("fs").readdirSync(normalizedPath).forEach(function(file) {
|
|
9
|
+
Models[file.substring(0, file.length-3)] = require("./models/" + file);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
module.exports = Models;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright : Bluedot Innovations.
|
|
3
|
+
*/
|
|
4
|
+
var mongoose = require('mongoose');
|
|
5
|
+
var Enums = require('@bluedot-innovation/enums');
|
|
6
|
+
|
|
7
|
+
var AdminPortalUser = mongoose.model('AdminPortalUser', new mongoose.Schema(
|
|
8
|
+
{
|
|
9
|
+
emailAddress: String,
|
|
10
|
+
password: String,
|
|
11
|
+
firstName: String,
|
|
12
|
+
lastName: String,
|
|
13
|
+
state: {type:String, default: Enums.StateEnum.active},
|
|
14
|
+
"creationTime" : {type: Date, default: Date.now},
|
|
15
|
+
"dataSource" : {type:String, select: false, default : 'AdminPortal'},
|
|
16
|
+
adminId: String
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
collection : 'adminPortalUser'
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
module.exports = AdminPortalUser;
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,38 @@
|
|
|
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;
|
|
@@ -0,0 +1,30 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
package/models/Beacon.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
Schema = mongoose.Schema;
|
|
10
|
+
var BeaconSchema = new mongoose.Schema({
|
|
11
|
+
"_id" : {type: String},
|
|
12
|
+
"creationTime" : {type: Date, default: Date.now},
|
|
13
|
+
"lastUpdateTime" : {type: Date, default: Date.now},
|
|
14
|
+
"state": {type: String, default: StateEnum.active},
|
|
15
|
+
"range": Number,
|
|
16
|
+
"major": Number,
|
|
17
|
+
"minor": Number,
|
|
18
|
+
"description": String,
|
|
19
|
+
"txPower": Number,
|
|
20
|
+
"name": String,
|
|
21
|
+
"macAddress": String,
|
|
22
|
+
"proximityUUID": String,
|
|
23
|
+
"customerId": String,
|
|
24
|
+
"beaconType": String,
|
|
25
|
+
"altitude": Number,
|
|
26
|
+
"altitudeAccuracy": Number,
|
|
27
|
+
"dataSource" : {type:String, select: false, default : 'openApi'},
|
|
28
|
+
"geometry" : {type: Schema.Types.Mixed, default: {}}
|
|
29
|
+
},
|
|
30
|
+
{ collection : 'beacon' }
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
var Beacon = mongoose.model('Beacon', BeaconSchema);
|
|
34
|
+
|
|
35
|
+
module.exports = Beacon;
|
|
36
|
+
|
|
@@ -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 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 FenceFilter = mongoose.model('BeaconFilter', BeaconFilterSchema);
|
|
22
|
+
|
|
23
|
+
module.exports = FenceFilter;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by Arun on 10/09/2014.
|
|
3
|
+
* Copyright : Bluedot Innovations.
|
|
4
|
+
* Owner :
|
|
5
|
+
*/
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
|
|
8
|
+
var ConstrainAccuracyAction = mongoose.model('ConstrainAccuracyAction', new mongoose.Schema({},
|
|
9
|
+
{ collection : 'au.com.bluedot.application.model.action.ConstrainAccuracyAction' }
|
|
10
|
+
));
|
|
11
|
+
module.exports = ConstrainAccuracyAction;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by Arun on 10/09/2014.
|
|
3
|
+
* Copyright : Bluedot Innovations.
|
|
4
|
+
* Owner :
|
|
5
|
+
*/
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
|
|
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
|
+
template: String,
|
|
29
|
+
addedBy: String,
|
|
30
|
+
xeroContactId: String,
|
|
31
|
+
creationTime : {type: Date, default: Date.now},
|
|
32
|
+
lastUpdateTime : {type: Date, default: Date.now},
|
|
33
|
+
dataSource : {type:String, select: false, default : 'adminPortal'},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
collection : 'contract'
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
module.exports = Contract;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
"dataSource" : {type:String, select: false, default : 'openApi'},
|
|
20
|
+
integrations: Schema.Types.Mixed
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
collection : 'customer'
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
module.exports = Customer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by Arun on 10/09/2014.
|
|
3
|
+
* Copyright : Bluedot Innovations.
|
|
4
|
+
* Owner :
|
|
5
|
+
*/
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
|
|
8
|
+
var CustomerSubscription = mongoose.model('CustomerSubscription', new mongoose.Schema({},
|
|
9
|
+
{ collection : 'au.com.bluedot.application.model.subscription.CustomerSubscription' }
|
|
10
|
+
));
|
|
11
|
+
module.exports = CustomerSubscription;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by Andrew on 25/07/2016.
|
|
3
|
+
* Copyright : Bluedot Innovations.
|
|
4
|
+
* Owner :
|
|
5
|
+
*/
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
Schema = mongoose.Schema;
|
|
8
|
+
|
|
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},
|
|
16
|
+
},
|
|
17
|
+
{ collection : 'dbevent' }
|
|
18
|
+
);
|
|
19
|
+
var DBEvent = mongoose.model('DBEvent', DBEventSchema);
|
|
20
|
+
|
|
21
|
+
module.exports = DBEvent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by Arun on 30/09/2014.
|
|
3
|
+
* Copyright : Bluedot Innovations.
|
|
4
|
+
* Owner :
|
|
5
|
+
*/
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
require('mongoose-long')(mongoose);
|
|
8
|
+
var SchemaTypes = mongoose.Schema.Types;
|
|
9
|
+
|
|
10
|
+
var DateRangeFilter = mongoose.model('DateRangeFilter', mongoose.Schema({
|
|
11
|
+
guid: {type: String},
|
|
12
|
+
_class : {type: String, default:"au.com.bluedot.application.spring.filter.action.DateRangeFilter"},
|
|
13
|
+
startDate: {type: String},
|
|
14
|
+
endDate: {type: String},
|
|
15
|
+
type : {type: String, default:"dateRangeFilter"},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
_id: false
|
|
19
|
+
}
|
|
20
|
+
));
|
|
21
|
+
module.exports = DateRangeFilter;
|
package/models/Fence.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
{ collection : 'au.com.bluedot.application.model.geo.Fence' }
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
var Fence = mongoose.model('Fence', FenceSchema);
|
|
21
|
+
|
|
22
|
+
module.exports = Fence;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by Arun on 10/09/2014.
|
|
3
|
+
* Copyright : Bluedot Innovations.
|
|
4
|
+
* Owner :
|
|
5
|
+
*/
|
|
6
|
+
var mongoose = require('mongoose');
|
|
7
|
+
Reference = require('./Reference');
|
|
8
|
+
Schema = mongoose.Schema;
|
|
9
|
+
var FenceCollection = mongoose.model('FenceCollection', new mongoose.Schema({
|
|
10
|
+
c : {type: String, default:'java.util.LinkedHashSet'},
|
|
11
|
+
d : [Reference]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
_id: false
|
|
15
|
+
}
|
|
16
|
+
));
|
|
17
|
+
module.exports = FenceCollection;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 uuid = require('node-uuid');
|
|
9
|
+
var UUIDGenerator = require('../utils/UUIDGenerator');
|
|
10
|
+
|
|
11
|
+
var FenceFilterSchema = new mongoose.Schema(
|
|
12
|
+
{
|
|
13
|
+
"c" : {type:String, default : "au.com.bluedot.application.model.filter.impl.FenceFilter"},
|
|
14
|
+
"d" : {
|
|
15
|
+
"id" : {type:String, default : UUIDGenerator.getId()},
|
|
16
|
+
"fence" : {
|
|
17
|
+
"r" : {type:String, default: null}
|
|
18
|
+
},
|
|
19
|
+
"description" : String,
|
|
20
|
+
"name" : String
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
_id: false
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
var FenceFilter = mongoose.model('FenceFilter', FenceFilterSchema);
|
|
29
|
+
|
|
30
|
+
module.exports = FenceFilter;
|
|
@@ -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,24 @@
|
|
|
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 uuid = require('node-uuid');
|
|
9
|
+
|
|
10
|
+
var FenceSchema = new mongoose.Schema({
|
|
11
|
+
_id : {type: String},
|
|
12
|
+
"geometry": {
|
|
13
|
+
"type": { type: String, required: true },
|
|
14
|
+
"coordinates": { type: Array, required: true}
|
|
15
|
+
},
|
|
16
|
+
"fenceId" : String,
|
|
17
|
+
"fenceName" : String
|
|
18
|
+
},
|
|
19
|
+
{ collection : 'GeoFence' }
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
var GeoFence = mongoose.model('GeoFence', FenceSchema);
|
|
23
|
+
|
|
24
|
+
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;
|