@glympse-inc/com.glympse.enroute 2.105.232

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/package.json +34 -0
  2. package/plugin.xml +262 -0
  3. package/scripts/iosFixPCH.js +38 -0
  4. package/src/android/BootReceiver.java +13 -0
  5. package/src/android/EnRoutePlugin.java +1867 -0
  6. package/src/android/HealthCheckJobService.java +225 -0
  7. package/src/android/LocationAccuracyChecker.java +49 -0
  8. package/src/android/ManagerWrapper.java +205 -0
  9. package/src/android/NotificationService.java +81 -0
  10. package/src/android/PushReceiver.java +90 -0
  11. package/src/android/enroute/aars/enrouteapi-aar.gradle +17 -0
  12. package/src/android/enroute/aars/glympseapi-aar.gradle +17 -0
  13. package/src/android/enroute/aars/glympseapipush-aar.gradle +17 -0
  14. package/src/android/enroute/aars/glympseapitoolbox-aar.gradle +17 -0
  15. package/src/android/gradle/build.gradle +25 -0
  16. package/src/ios/EnRoutePlugin.h +128 -0
  17. package/src/ios/EnRoutePlugin.mm +1258 -0
  18. package/src/ios/EnRouteWrapper.h +30 -0
  19. package/src/ios/EnRouteWrapper.mm +176 -0
  20. package/www/Agent.js +48 -0
  21. package/www/AgentManager.js +422 -0
  22. package/www/CardMessage.js +49 -0
  23. package/www/ChatMessage.js +29 -0
  24. package/www/CustomerMessage.js +18 -0
  25. package/www/EnRouteManager.js +613 -0
  26. package/www/EtaPlanner.js +129 -0
  27. package/www/GlobalConfig.js +13 -0
  28. package/www/Invite.js +93 -0
  29. package/www/LatLng.js +28 -0
  30. package/www/Location.js +63 -0
  31. package/www/Native.js +215 -0
  32. package/www/Operation.js +67 -0
  33. package/www/OrderItem.js +43 -0
  34. package/www/OrgConfig.js +184 -0
  35. package/www/Organization.js +88 -0
  36. package/www/Pickup.js +119 -0
  37. package/www/PickupArrivalData.js +38 -0
  38. package/www/PickupManager.js +512 -0
  39. package/www/Place.js +33 -0
  40. package/www/Session.js +87 -0
  41. package/www/SessionManager.js +431 -0
  42. package/www/Task.js +106 -0
  43. package/www/TaskManager.js +443 -0
  44. package/www/Ticket.js +205 -0
  45. package/www/Track.js +75 -0
@@ -0,0 +1,129 @@
1
+ var Place = require('./Place');
2
+ var LatLng = require('./LatLng');
3
+
4
+ var LISTENER_ETA_PLANNER = 7;
5
+ var ETA_PLANNER_ETAS_UPDATED = 0x00000001;
6
+
7
+ var _listeners = [];
8
+
9
+ var _noop = function(){};
10
+
11
+ var _nativeListener = function(data){
12
+ var result = JSON.parse(data);
13
+ var idListener = result.listener;
14
+ var events = result.events;
15
+ var param1 = result.param1;
16
+ var param2 = result.param2;
17
+
18
+ if ( LISTENER_ETA_PLANNER == idListener )
19
+ {
20
+ console.log("[EtaPlanner] Listener: " + idListener + " Events: " + events + " Param1: " + param1 + " Param2: " + param2 + " data: " + data);
21
+
22
+ if ( 0 !== ( ETA_PLANNER_ETAS_UPDATED & events ) ) {
23
+ var etaValues = param1;
24
+
25
+ spreadEtasUpdated(etaValues);
26
+ }
27
+ }
28
+ };
29
+
30
+ function spreadEtasUpdated(etas) {
31
+ console.log("[EtaPlanner] spreadEtasUpdated");
32
+ spreadEvent('etasUpdated', [etas]);
33
+ };
34
+
35
+ function spreadEvent(event, params) {
36
+ console.log("[EtaPlanner] spreadEvent");
37
+ if (_listeners) {
38
+ for (var index = 0; index < _listeners.length; ++index){
39
+ var listener = _listeners[index];
40
+ if ( typeof listener[event] == 'function' )
41
+ {
42
+ listener[event].apply(listener, params);
43
+ }
44
+ }
45
+ }
46
+ };
47
+
48
+ function createLocation(stop) {
49
+ var lat = 0;
50
+ var lng = 0;
51
+
52
+ if ( typeof stop.getLatitude === 'function' )
53
+ {
54
+ lat = stop.getLatitude();
55
+ }
56
+ else if ( stop.hasOwnProperty('_latitude') ) {
57
+ lat = stop._latitude;
58
+ }
59
+ else if ( stop.hasOwnProperty('latitude')) {
60
+ lat = stop.latitude;
61
+ }
62
+
63
+ if ( typeof stop.getLongitude === 'function' )
64
+ {
65
+ lng = stop.getLongitude();
66
+ }
67
+ else if ( stop.hasOwnProperty('_longitude') ) {
68
+ lng = stop._longitude;
69
+ }
70
+ else if ( stop.hasOwnProperty('longitude')) {
71
+ lng = stop.longitude;
72
+ }
73
+
74
+ return { "latitude": lat, "longitude": lng };
75
+ };
76
+
77
+ module.exports = {
78
+
79
+ init: function(){
80
+ console.log("[EtaPlanner] init");
81
+ Native.registerListener(_nativeListener);
82
+ },
83
+
84
+ addListener: function(listener) {
85
+ if ( !listener )
86
+ {
87
+ console.log('[EtaPlanner] Null listener not supported');
88
+ return;
89
+ }
90
+
91
+ var index = _listeners.indexOf(listener);
92
+ if (index > -1)
93
+ {
94
+ console.log('[EtaPlanner] Listener already registered!');
95
+ return;
96
+ }
97
+
98
+ _listeners.push(listener);
99
+ },
100
+
101
+ removeListener: function(listener) {
102
+ var index = _listeners.indexOf(listener);
103
+ if (index > -1) {
104
+ _listeners.splice(index, 1);
105
+ }
106
+ },
107
+
108
+ /**
109
+ * @param start Location object containing the initial location
110
+ * @param stops Array of Locations where each Location is a destination in the route
111
+ * @param stopoverTime Long in milliseconds of how much time should be added for each stop
112
+ */
113
+ query: function(start, stops, stopoverTime){
114
+
115
+ var initial = createLocation(start);
116
+ var places = [];
117
+
118
+ for (var index = 0; index < stops.length; ++index) {
119
+ var stop = stops[index];
120
+ places.push(createLocation(stop));
121
+ }
122
+
123
+ Native.startEtaPlannerQuery(initial, places, stopoverTime, _noop, _noop);
124
+ },
125
+
126
+ abort: function() {
127
+ Native.abortEtaPlannerQuery(_noop, _noop);
128
+ }
129
+ };
@@ -0,0 +1,13 @@
1
+ function GlobalConfig(data) {
2
+ this.update(data);
3
+ }
4
+
5
+ GlobalConfig.prototype.update = function(data) {
6
+ this._minAppBuild = data.minAppBuild;
7
+ }
8
+
9
+ GlobalConfig.prototype.getMinAppBuild = function() {
10
+ return this._minAppBuild;
11
+ };
12
+
13
+ module.exports = GlobalConfig;
package/www/Invite.js ADDED
@@ -0,0 +1,93 @@
1
+ function Invite(data) {
2
+ this.update(data);
3
+ }
4
+
5
+ Invite.prototype.update = function(data) {
6
+ this._type = data.type;
7
+ this._subtype = data.subtype;
8
+ this._name = data.name;
9
+ this._address = data.address;
10
+ this._brand = data.brand;
11
+ this._visible = data.visible;
12
+ this._createOnly = data.createOnly;
13
+ this._code = data.code;
14
+ this._reference = data.reference;
15
+ this._url = data.url;
16
+ this._state = data.state;
17
+ this._createdTime = data.createdTime;
18
+ this._lastViewTime = data.lastViewTime;
19
+ this._viewers = data.viewers;
20
+ this._viewing = data.viewing;
21
+ this._text = data.text;
22
+ this._error = data.error;
23
+ }
24
+
25
+ Invite.prototype.getType = function() {
26
+ return this._type;
27
+ };
28
+
29
+ Invite.prototype.getSubtype = function() {
30
+ return this._subtype;
31
+ };
32
+
33
+ Invite.prototype.getName = function() {
34
+ return this._name;
35
+ };
36
+
37
+ Invite.prototype.getAddress = function() {
38
+ return this._address;
39
+ };
40
+
41
+ Invite.prototype.getBrand = function() {
42
+ return this._brand;
43
+ };
44
+
45
+ Invite.prototype.isVisible = function() {
46
+ return this._visible;
47
+ };
48
+
49
+ Invite.prototype.isCreateOnly = function() {
50
+ return this._createOnly;
51
+ };
52
+
53
+ Invite.prototype.getCode = function() {
54
+ return this._code;
55
+ };
56
+
57
+ Invite.prototype.getReference = function() {
58
+ return this._reference;
59
+ };
60
+
61
+ Invite.prototype.getUrl = function() {
62
+ return this._url;
63
+ };
64
+
65
+ Invite.prototype.getState = function() {
66
+ return this._state;
67
+ };
68
+
69
+ Invite.prototype.getCreatedTime = function() {
70
+ return this._createdTime;
71
+ };
72
+
73
+ Invite.prototype.getLastViewTime = function() {
74
+ return this._lastViewTime;
75
+ };
76
+
77
+ Invite.prototype.getViewers = function() {
78
+ return this._viewers;
79
+ };
80
+
81
+ Invite.prototype.getViewing = function() {
82
+ return this._viewing;
83
+ };
84
+
85
+ Invite.prototype.getText = function() {
86
+ return this._text;
87
+ };
88
+
89
+ Invite.prototype.getError = function() {
90
+ return this._error;
91
+ };
92
+
93
+ module.exports = Invite;
package/www/LatLng.js ADDED
@@ -0,0 +1,28 @@
1
+ function LatLng(data) {
2
+ this.update(data);
3
+ }
4
+
5
+ LatLng.prototype.update = function(data) {
6
+ this._latitude = data.latitude;
7
+ this._longitude = data.longitude;
8
+ this._latitudeE6 = data.latitudeE6;
9
+ this._longitudeE6 = data.longitudeE6;
10
+ }
11
+
12
+ LatLng.prototype.getLatitude = function() {
13
+ return this._latitude;
14
+ };
15
+
16
+ LatLng.prototype.getLongitude = function() {
17
+ return this._longitude;
18
+ };
19
+
20
+ LatLng.prototype.getLatitudeE6 = function() {
21
+ return this._latitudeE6;
22
+ };
23
+
24
+ LatLng.prototype.getLongitudeE6 = function() {
25
+ return this._longitudeE6;
26
+ };
27
+
28
+ module.exports = LatLng;
@@ -0,0 +1,63 @@
1
+ function Location(data) {
2
+ this.update(data);
3
+ }
4
+
5
+ Location.prototype.update = function(data) {
6
+ this._provider = data.provider;
7
+ this._altitude = data.altitude;
8
+ this._bearing = data.bearing;
9
+ this._speed = data.speed;
10
+ this._hAccuracy = data.hAccuracy;
11
+ this._vAccuracy = data.vAccuracy;
12
+ this._time = data.time;
13
+ this._latitude = data.latitude;
14
+ this._longitude = data.longitude;
15
+ this._latitudeE6 = data.latitudeE6;
16
+ this._longitudeE6 = data.longitudeE6;
17
+ }
18
+
19
+ Location.prototype.getProvider = function() {
20
+ return this._provider;
21
+ };
22
+
23
+ Location.prototype.getAltitude = function() {
24
+ return this._altitude;
25
+ };
26
+
27
+ Location.prototype.getBearing = function() {
28
+ return this._bearing;
29
+ };
30
+
31
+ Location.prototype.getSpeed = function() {
32
+ return this._speed;
33
+ };
34
+
35
+ Location.prototype.getHAccuracy = function() {
36
+ return this._hAccuracy;
37
+ };
38
+
39
+ Location.prototype.getVAccuracy = function() {
40
+ return this._vAccuracy;
41
+ };
42
+
43
+ Location.prototype.getTime = function() {
44
+ return this._time;
45
+ };
46
+
47
+ Location.prototype.getLatitude = function() {
48
+ return this._latitude;
49
+ };
50
+
51
+ Location.prototype.getLongitude = function() {
52
+ return this._longitude;
53
+ };
54
+
55
+ Location.prototype.getLatitudeE6 = function() {
56
+ return this._latitudeE6;
57
+ };
58
+
59
+ Location.prototype.getLongitudeE6 = function() {
60
+ return this._longitudeE6;
61
+ };
62
+
63
+ module.exports = Location;
package/www/Native.js ADDED
@@ -0,0 +1,215 @@
1
+ module.exports = {
2
+
3
+ setActive: function(active, successCallback, errorCallback) {
4
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "setActive", [active]);
5
+ },
6
+
7
+ registerDeviceToken: function(tokenType, deviceToken, successCallback, errorCallback) {
8
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "registerDeviceToken", [tokenType, deviceToken]);
9
+ },
10
+
11
+ handleRemoteNotification: function(payload, successCallback, errorCallback) {
12
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "handleRemoteNotification", [payload]);
13
+ },
14
+
15
+ registerListener: function (successCallback, errorCallback) {
16
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "registerListener", []);
17
+ },
18
+
19
+ syncAccountState: function (successCallback, errorCallback) {
20
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "syncAccountState", []);
21
+ },
22
+
23
+ syncHealthReport: function(successCallback, errorCallback) {
24
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "syncHealthReport", []);
25
+ },
26
+
27
+ start: function (successCallback, errorCallback) {
28
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "start", []);
29
+ },
30
+
31
+ loginWithCredentials: function (username, password, successCallback, errorCallback) {
32
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "loginWithCredentials", [username, password]);
33
+ },
34
+
35
+ loginWithToken: function (token, expireTime, successCallback, errorCallback) {
36
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "loginWithToken", [token, expireTime]);
37
+ },
38
+
39
+ logout: function (successCallback, errorCallback) {
40
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "logout", []);
41
+ },
42
+
43
+ logoutWithReason: function (reason, successCallback, errorCallback) {
44
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "logoutWithReason", [reason]);
45
+ },
46
+
47
+ stop: function (successCallback, errorCallback) {
48
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "stop", []);
49
+ },
50
+
51
+ setAuthenticationMode: function (authMode, successCallback, errorCallback) {
52
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "setAuthenticationMode", [authMode]);
53
+ },
54
+
55
+ setBaseUrl: function (baseUrl, successCallback, errorCallback) {
56
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "setBaseUrl", [baseUrl]);
57
+ },
58
+
59
+ getAuthToken: function (successCallback, errorCallback) {
60
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "getAuthToken", []);
61
+ },
62
+
63
+ syncTasksState: function (successCallback, errorCallback) {
64
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "syncTasksState", []);
65
+ },
66
+
67
+ syncTasksStateLight: function (successCallback, errorCallback) {
68
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "syncTasksStateLight", []);
69
+ },
70
+
71
+ refreshTasks: function (successCallback, errorCallback) {
72
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "refreshTasks", []);
73
+ },
74
+
75
+ startTask: function (taskId, duration, successCallback, errorCallback) {
76
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "startTask", [taskId, duration]);
77
+ },
78
+
79
+ createTask: function (taskData, successCallback, errorCallback) {
80
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "createTask", [taskData]);
81
+ },
82
+
83
+ setTaskPhase: function (taskId, phase, successCallback, errorCallback) {
84
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "setTaskPhase", [taskId, phase]);
85
+ },
86
+
87
+ setTaskVisibility: function (taskId, visible, successCallback, errorCallback) {
88
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "setTaskVisibility", [taskId, visible]);
89
+ },
90
+
91
+ completeTask: function (taskId, successCallback, errorCallback) {
92
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "completeTask", [taskId]);
93
+ },
94
+
95
+ addOrUpdateMetadataItem: function (taskId, key, value, successCallback, errorCallback) {
96
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "addOrUpdateMetadataItem", [taskId, key, value]);
97
+ },
98
+
99
+ setTravelModeForTask: function(taskId, travelMode, successCallback, errorCallback) {
100
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "setTravelModeForTask", [taskId, travelMode]);
101
+ },
102
+
103
+ sendMessageToTask: function (taskId, message, predefinedMessageId, successCallback, errorCallback) {
104
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "sendMessageToTask", [taskId, message, predefinedMessageId]);
105
+ },
106
+
107
+ markTaskMessagesAsRead: function (taskId, successCallback, errorCallback) {
108
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "markTaskMessagesAsRead", [taskId]);
109
+ },
110
+
111
+ // Deprecated (CardMessages)
112
+ confirmMessageRead: function (taskId, messageId, successCallback, errorCallback) {
113
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "confirmMessageRead", [taskId, messageId]);
114
+ },
115
+
116
+ syncSessionsState: function (successCallback, errorCallback) {
117
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "syncSessionsState", []);
118
+ },
119
+
120
+ syncSessionsStateLight: function (successCallback, errorCallback) {
121
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "syncSessionsStateLight", []);
122
+ },
123
+
124
+ refreshSessions: function (successCallback, errorCallback) {
125
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "refreshSessions", []);
126
+ },
127
+
128
+ getSessions: function (successCallback, errorCallback) {
129
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "getSessions", []);
130
+ },
131
+
132
+ updateSessionTasks: function (sessionId, taskIds, successCallback, errorCallback) {
133
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "updateSessionTasks", [sessionId, taskIds]);
134
+ },
135
+
136
+ startEtaPlannerQuery: function (initial, places, stopoverTime, successCallback, errorCallback) {
137
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "startEtaPlannerQuery", [initial, places, stopoverTime]);
138
+ },
139
+
140
+ abortEtaPlannerQuery: function (successCallback, errorCallback) {
141
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "abortEtaPlannerQuery", []);
142
+ },
143
+
144
+ overrideLoggingLevels: function (fileLogLevel, debugLogLevel, successCallback, errorCallback) {
145
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "overrideLoggingLevels", [fileLogLevel, debugLogLevel]);
146
+ },
147
+
148
+ setRemoteLoggingEnabled: function (enabled, successCallback, errorCallback) {
149
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "setRemoteLoggingEnabled", [enabled]);
150
+ },
151
+
152
+ setFetchCompletedTasks: function (enabled, successCallback, errorCallback) {
153
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "setFetchCompletedTasks", [enabled]);
154
+ },
155
+
156
+ refreshPickups: function (successCallback, errorCallback) {
157
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "refreshPickups", []);
158
+ },
159
+
160
+ setPickupPhase: function (pickupId, phase, successCallback, errorCallback) {
161
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "setPickupPhase", [pickupId, phase]);
162
+ },
163
+
164
+ completePickup: function (pickupId, successCallback, errorCallback) {
165
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "completePickup", [pickupId]);
166
+ },
167
+
168
+ claimPickup: function (pickupId, successCallback, errorCallback) {
169
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "claimPickup", [pickupId]);
170
+ },
171
+
172
+ unclaimPickup: function (pickupId, successCallback, errorCallback) {
173
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "unclaimPickup", [pickupId]);
174
+ },
175
+
176
+ sendMessageToPickup: function (pickupId, message, predefinedMessageId, successCallback, errorCallback) {
177
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "sendMessageToPickup", [pickupId, message, predefinedMessageId]);
178
+ },
179
+
180
+ markMessagesAsRead: function (pickupId, successCallback, errorCallback) {
181
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "markMessagesAsRead", [pickupId]);
182
+ },
183
+
184
+ syncPickupsState: function (successCallback, errorCallback) {
185
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "syncPickupsState", []);
186
+ },
187
+
188
+ syncPickupsStateLight: function (successCallback, errorCallback) {
189
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "syncPickupsStateLight", []);
190
+ },
191
+
192
+ syncPickup: function(pickupId, successCallback, errorCallback) {
193
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "syncPickup", [pickupId]);
194
+ },
195
+
196
+ startShift: function (successCallback, errorCallback) {
197
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "startShift", []);
198
+ },
199
+
200
+ completeShift: function (successCallback, errorCallback) {
201
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "completeShift", []);
202
+ },
203
+
204
+ checkGoogleLocationAccuracy: function (successCallback, errorCallback) {
205
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "checkGoogleLocationAccuracy", []);
206
+ },
207
+
208
+ checkIsNetworkConstrained: function (successCallback, errorCallback) {
209
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "checkIsNetworkConstrained", []);
210
+ },
211
+
212
+ checkCellularDataAvailable: function (successCallback, errorCallback) {
213
+ cordova.exec(successCallback, errorCallback, "EnRoutePlugin", "checkCellularDataAvailable", []);
214
+ }
215
+ };
@@ -0,0 +1,67 @@
1
+ var Ticket = require('./Ticket');
2
+
3
+ function Operation(data) {
4
+ this.update(data);
5
+ }
6
+
7
+ Operation.prototype.update = function(data) {
8
+ this._state = data.state;
9
+ this._id = data.id;
10
+ this._startTime = data.startTime;
11
+ this._ticketId = data.ticketId;
12
+ this._inviteUrl = data.inviteUrl;
13
+ this._inviteCode = data.inviteCode;
14
+ this._taskId = data.taskId;
15
+ this._ticketVisible = data.ticketVisible;
16
+
17
+ this._updateTicket(data.ticket);
18
+ };
19
+
20
+ Operation.prototype._updateTicket = function(data) {
21
+ var ticket = data;
22
+ if (ticket) {
23
+ if (this._ticket) {
24
+ this._ticket.update(ticket);
25
+ } else {
26
+ this._ticket = new Ticket(ticket);
27
+ }
28
+ }
29
+ };
30
+
31
+ Operation.prototype.getState = function() {
32
+ return this._state;
33
+ };
34
+
35
+ Operation.prototype.getId = function() {
36
+ return this._id;
37
+ };
38
+
39
+ Operation.prototype.getStartTime = function() {
40
+ return this._startTime;
41
+ };
42
+
43
+ Operation.prototype.getTicketId = function() {
44
+ return this._ticketId;
45
+ };
46
+
47
+ Operation.prototype.getInviteUrl = function() {
48
+ return this._inviteUrl;
49
+ };
50
+
51
+ Operation.prototype.getInviteCode = function() {
52
+ return this._inviteCode;
53
+ };
54
+
55
+ Operation.prototype.getTaskId = function() {
56
+ return this._taskId;
57
+ };
58
+
59
+ Operation.prototype.getTicket = function() {
60
+ return this._ticket;
61
+ };
62
+
63
+ Operation.prototype.isTicketVisible = function() {
64
+ return this._ticketVisible;
65
+ };
66
+
67
+ module.exports = Operation;
@@ -0,0 +1,43 @@
1
+ function OrderItem(data) {
2
+ this.update(data);
3
+ }
4
+
5
+ OrderItem.prototype.update = function(data) {
6
+ this._id = data.id;
7
+ this._name = data.name;
8
+ this._status = data.status;
9
+ this._quantity = data.quantity;
10
+ this._location = data.location;
11
+ this._foreignId = data.foreignId;
12
+ this._avatarUrl = data.avatarUrl;
13
+ }
14
+
15
+ OrderItem.prototype.getId = function() {
16
+ return this._id;
17
+ };
18
+
19
+ OrderItem.prototype.getName = function() {
20
+ return this._name;
21
+ };
22
+
23
+ OrderItem.prototype.getStatus = function() {
24
+ return this._status;
25
+ };
26
+
27
+ OrderItem.prototype.getQuantity = function() {
28
+ return this._quantity;
29
+ };
30
+
31
+ OrderItem.prototype.getLocation = function() {
32
+ return this._location;
33
+ };
34
+
35
+ OrderItem.prototype.getForeignId = function() {
36
+ return this._foreignId;
37
+ };
38
+
39
+ OrderItem.prototype.getAvatarUrl = function() {
40
+ return this._avatarUrl;
41
+ };
42
+
43
+ module.exports = OrderItem;