@@ -9,23 +9,23 @@ |
||
9 | 9 | */ |
10 | 10 | class AddressNoteResponse extends Common |
11 | 11 | { |
12 | - public $status; |
|
13 | - public $note_id; |
|
14 | - public $upload_id; |
|
15 | - public $note; |
|
12 | + public $status; |
|
13 | + public $note_id; |
|
14 | + public $upload_id; |
|
15 | + public $note; |
|
16 | 16 | |
17 | - public static function fromArray(array $params) |
|
18 | - { |
|
19 | - $addressNoteResponse = new self(); |
|
17 | + public static function fromArray(array $params) |
|
18 | + { |
|
19 | + $addressNoteResponse = new self(); |
|
20 | 20 | |
21 | - foreach ($params as $key => $value) { |
|
22 | - if (property_exists($addressNoteResponse, $key)) { |
|
23 | - $addressNoteResponse->{$key} = $value; |
|
24 | - } else { |
|
25 | - throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
26 | - } |
|
27 | - } |
|
21 | + foreach ($params as $key => $value) { |
|
22 | + if (property_exists($addressNoteResponse, $key)) { |
|
23 | + $addressNoteResponse->{$key} = $value; |
|
24 | + } else { |
|
25 | + throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
26 | + } |
|
27 | + } |
|
28 | 28 | |
29 | - return $addressNoteResponse; |
|
30 | - } |
|
29 | + return $addressNoteResponse; |
|
30 | + } |
|
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -10,36 +10,36 @@ |
||
10 | 10 | */ |
11 | 11 | class ScheduleCalendarResponse extends Common |
12 | 12 | { |
13 | - /** |
|
14 | - * The address book contact quantity by dates |
|
15 | - * (dates are in the string format, e.g. 2020-10-18). |
|
16 | - * @var array |
|
17 | - */ |
|
18 | - public $address_book = []; |
|
13 | + /** |
|
14 | + * The address book contact quantity by dates |
|
15 | + * (dates are in the string format, e.g. 2020-10-18). |
|
16 | + * @var array |
|
17 | + */ |
|
18 | + public $address_book = []; |
|
19 | 19 | |
20 | - /* |
|
20 | + /* |
|
21 | 21 | * The order quantity by dates |
22 | 22 | * (dates are in the string format, e.g. 2020-10-18). |
23 | 23 | * @var array |
24 | 24 | */ |
25 | - public $orders = []; |
|
25 | + public $orders = []; |
|
26 | 26 | |
27 | - /* |
|
27 | + /* |
|
28 | 28 | * The order quantity by dates |
29 | 29 | * (dates are in the string format, e.g. 2020-10-18). |
30 | 30 | * @var array |
31 | 31 | */ |
32 | - public $routes_count = []; |
|
32 | + public $routes_count = []; |
|
33 | 33 | |
34 | - public static function fromArray(array $params) |
|
35 | - { |
|
36 | - $order = new self(); |
|
37 | - foreach ($params as $key => $value) { |
|
38 | - if (property_exists($order, $key)) { |
|
39 | - $order->{$key} = $value; |
|
40 | - } |
|
41 | - } |
|
34 | + public static function fromArray(array $params) |
|
35 | + { |
|
36 | + $order = new self(); |
|
37 | + foreach ($params as $key => $value) { |
|
38 | + if (property_exists($order, $key)) { |
|
39 | + $order->{$key} = $value; |
|
40 | + } |
|
41 | + } |
|
42 | 42 | |
43 | - return $order; |
|
44 | - } |
|
43 | + return $order; |
|
44 | + } |
|
45 | 45 | } |
@@ -7,226 +7,226 @@ |
||
7 | 7 | |
8 | 8 | class Address extends Common |
9 | 9 | { |
10 | - public $route_destination_id; |
|
11 | - public $alias; |
|
12 | - public $member_id; |
|
13 | - public $address; |
|
14 | - public $addressUpdate; |
|
15 | - public $is_depot = false; |
|
16 | - public $lat; |
|
17 | - public $lng; |
|
18 | - public $route_id; |
|
19 | - public $original_route_id; |
|
20 | - public $optimization_problem_id; |
|
21 | - public $sequence_no; |
|
22 | - public $geocoded; |
|
23 | - public $preferred_geocoding; |
|
24 | - public $failed_geocoding; |
|
25 | - public $geocodings = []; |
|
26 | - public $contact_id; |
|
27 | - public $is_visited; |
|
28 | - public $customer_po; |
|
29 | - public $invoice_no; |
|
30 | - public $reference_no; |
|
31 | - public $order_no; |
|
32 | - public $weight; |
|
33 | - public $cost; |
|
34 | - public $revenue; |
|
35 | - public $cube; |
|
36 | - public $pieces; |
|
37 | - public $email; |
|
38 | - public $phone; |
|
39 | - public $tracking_number; |
|
40 | - public $destination_note_count; |
|
41 | - public $drive_time_to_next_destination; |
|
42 | - public $distance_to_next_destination; |
|
43 | - public $generated_time_window_start; |
|
44 | - public $generated_time_window_end; |
|
45 | - public $time_window_start; |
|
46 | - public $time_window_end; |
|
47 | - public $time; |
|
48 | - public $notes; |
|
49 | - public $timestamp_last_visited; |
|
50 | - public $custom_fields = []; |
|
51 | - public $manifest = []; |
|
52 | - |
|
53 | - public $first_name; |
|
54 | - public $last_name; |
|
55 | - public $is_departed; |
|
56 | - public $timestamp_last_departed; |
|
57 | - public $order_id; |
|
58 | - public $priority; |
|
59 | - public $curbside_lat; |
|
60 | - public $curbside_lng; |
|
61 | - public $time_window_start_2; |
|
62 | - public $time_window_end_2; |
|
63 | - |
|
64 | - public $timeframe_violation_state; |
|
65 | - public $timeframe_violation_time; |
|
66 | - public $timeframe_violation_rate; |
|
67 | - public $route_name; |
|
68 | - public $address_stop_type; |
|
69 | - public $visited_lat; |
|
70 | - public $visited_lng; |
|
71 | - public $departed_lat; |
|
72 | - public $departed_lng; |
|
73 | - public $group; |
|
74 | - public $abnormal_traffic_time_to_next_destination; |
|
75 | - public $uncongested_time_to_next_destination; |
|
76 | - public $traffic_time_to_next_destination; |
|
77 | - public $channel_name; |
|
78 | - public $pickup; |
|
79 | - public $dropoff; |
|
80 | - public $joint; |
|
81 | - public $geofence_detected_visited_timestamp; |
|
82 | - public $geofence_detected_departed_timestamp; |
|
83 | - public $geofence_detected_service_time; |
|
84 | - public $geofence_detected_visited_lat; |
|
85 | - public $geofence_detected_visited_lng; |
|
86 | - public $geofence_detected_departed_lat; |
|
87 | - public $geofence_detected_departed_lng; |
|
88 | - public $custom_fields_str_json; |
|
89 | - public $custom_fields_config; |
|
90 | - public $custom_fields_config_str_json; |
|
91 | - public $bundle_count; |
|
92 | - public $bundle_items; |
|
93 | - public $order_inventory; |
|
94 | - public $required_skills; |
|
95 | - public $udu_distance_to_next_destination; |
|
96 | - public $wait_time_to_next_destination; |
|
97 | - public $path_to_next = []; |
|
98 | - public $additional_status; |
|
99 | - |
|
100 | - public function __construct() |
|
101 | - { |
|
102 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
103 | - } |
|
104 | - |
|
105 | - public static function fromArray(array $params) |
|
106 | - { |
|
107 | - $address = new self(); |
|
108 | - |
|
109 | - foreach ($params as $key => $value) { |
|
110 | - if (property_exists($address, $key)) { |
|
111 | - $address->{$key} = $value; |
|
112 | - } else { |
|
113 | - throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
114 | - } |
|
115 | - } |
|
116 | - |
|
117 | - return $address; |
|
118 | - } |
|
119 | - |
|
120 | - public static function getAddress($routeId, $addressId) |
|
121 | - { |
|
122 | - $address = Route4Me::makeRequst([ |
|
123 | - 'url' => Endpoint::ADDRESS_V4, |
|
124 | - 'method' => 'GET', |
|
125 | - 'query' => [ |
|
126 | - 'route_id' => $routeId, |
|
127 | - 'route_destination_id' => $addressId, |
|
128 | - ], |
|
129 | - ]); |
|
130 | - |
|
131 | - return self::fromArray($address); |
|
132 | - } |
|
133 | - |
|
134 | - public function update() |
|
135 | - { |
|
136 | - $addressUpdate = Route4Me::makeRequst([ |
|
137 | - 'url' => Endpoint::ADDRESS_V4, |
|
138 | - 'method' => 'PUT', |
|
139 | - 'body' => $this->toArray(), |
|
140 | - 'query' => [ |
|
141 | - 'route_id' => $this->route_id, |
|
142 | - 'route_destination_id' => $this->route_destination_id, |
|
143 | - ], |
|
144 | - ]); |
|
145 | - |
|
146 | - return self::fromArray($addressUpdate); |
|
147 | - } |
|
148 | - |
|
149 | - /* |
|
10 | + public $route_destination_id; |
|
11 | + public $alias; |
|
12 | + public $member_id; |
|
13 | + public $address; |
|
14 | + public $addressUpdate; |
|
15 | + public $is_depot = false; |
|
16 | + public $lat; |
|
17 | + public $lng; |
|
18 | + public $route_id; |
|
19 | + public $original_route_id; |
|
20 | + public $optimization_problem_id; |
|
21 | + public $sequence_no; |
|
22 | + public $geocoded; |
|
23 | + public $preferred_geocoding; |
|
24 | + public $failed_geocoding; |
|
25 | + public $geocodings = []; |
|
26 | + public $contact_id; |
|
27 | + public $is_visited; |
|
28 | + public $customer_po; |
|
29 | + public $invoice_no; |
|
30 | + public $reference_no; |
|
31 | + public $order_no; |
|
32 | + public $weight; |
|
33 | + public $cost; |
|
34 | + public $revenue; |
|
35 | + public $cube; |
|
36 | + public $pieces; |
|
37 | + public $email; |
|
38 | + public $phone; |
|
39 | + public $tracking_number; |
|
40 | + public $destination_note_count; |
|
41 | + public $drive_time_to_next_destination; |
|
42 | + public $distance_to_next_destination; |
|
43 | + public $generated_time_window_start; |
|
44 | + public $generated_time_window_end; |
|
45 | + public $time_window_start; |
|
46 | + public $time_window_end; |
|
47 | + public $time; |
|
48 | + public $notes; |
|
49 | + public $timestamp_last_visited; |
|
50 | + public $custom_fields = []; |
|
51 | + public $manifest = []; |
|
52 | + |
|
53 | + public $first_name; |
|
54 | + public $last_name; |
|
55 | + public $is_departed; |
|
56 | + public $timestamp_last_departed; |
|
57 | + public $order_id; |
|
58 | + public $priority; |
|
59 | + public $curbside_lat; |
|
60 | + public $curbside_lng; |
|
61 | + public $time_window_start_2; |
|
62 | + public $time_window_end_2; |
|
63 | + |
|
64 | + public $timeframe_violation_state; |
|
65 | + public $timeframe_violation_time; |
|
66 | + public $timeframe_violation_rate; |
|
67 | + public $route_name; |
|
68 | + public $address_stop_type; |
|
69 | + public $visited_lat; |
|
70 | + public $visited_lng; |
|
71 | + public $departed_lat; |
|
72 | + public $departed_lng; |
|
73 | + public $group; |
|
74 | + public $abnormal_traffic_time_to_next_destination; |
|
75 | + public $uncongested_time_to_next_destination; |
|
76 | + public $traffic_time_to_next_destination; |
|
77 | + public $channel_name; |
|
78 | + public $pickup; |
|
79 | + public $dropoff; |
|
80 | + public $joint; |
|
81 | + public $geofence_detected_visited_timestamp; |
|
82 | + public $geofence_detected_departed_timestamp; |
|
83 | + public $geofence_detected_service_time; |
|
84 | + public $geofence_detected_visited_lat; |
|
85 | + public $geofence_detected_visited_lng; |
|
86 | + public $geofence_detected_departed_lat; |
|
87 | + public $geofence_detected_departed_lng; |
|
88 | + public $custom_fields_str_json; |
|
89 | + public $custom_fields_config; |
|
90 | + public $custom_fields_config_str_json; |
|
91 | + public $bundle_count; |
|
92 | + public $bundle_items; |
|
93 | + public $order_inventory; |
|
94 | + public $required_skills; |
|
95 | + public $udu_distance_to_next_destination; |
|
96 | + public $wait_time_to_next_destination; |
|
97 | + public $path_to_next = []; |
|
98 | + public $additional_status; |
|
99 | + |
|
100 | + public function __construct() |
|
101 | + { |
|
102 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
103 | + } |
|
104 | + |
|
105 | + public static function fromArray(array $params) |
|
106 | + { |
|
107 | + $address = new self(); |
|
108 | + |
|
109 | + foreach ($params as $key => $value) { |
|
110 | + if (property_exists($address, $key)) { |
|
111 | + $address->{$key} = $value; |
|
112 | + } else { |
|
113 | + throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
114 | + } |
|
115 | + } |
|
116 | + |
|
117 | + return $address; |
|
118 | + } |
|
119 | + |
|
120 | + public static function getAddress($routeId, $addressId) |
|
121 | + { |
|
122 | + $address = Route4Me::makeRequst([ |
|
123 | + 'url' => Endpoint::ADDRESS_V4, |
|
124 | + 'method' => 'GET', |
|
125 | + 'query' => [ |
|
126 | + 'route_id' => $routeId, |
|
127 | + 'route_destination_id' => $addressId, |
|
128 | + ], |
|
129 | + ]); |
|
130 | + |
|
131 | + return self::fromArray($address); |
|
132 | + } |
|
133 | + |
|
134 | + public function update() |
|
135 | + { |
|
136 | + $addressUpdate = Route4Me::makeRequst([ |
|
137 | + 'url' => Endpoint::ADDRESS_V4, |
|
138 | + 'method' => 'PUT', |
|
139 | + 'body' => $this->toArray(), |
|
140 | + 'query' => [ |
|
141 | + 'route_id' => $this->route_id, |
|
142 | + 'route_destination_id' => $this->route_destination_id, |
|
143 | + ], |
|
144 | + ]); |
|
145 | + |
|
146 | + return self::fromArray($addressUpdate); |
|
147 | + } |
|
148 | + |
|
149 | + /* |
|
150 | 150 | * Marks an address as marked as visited/as departed |
151 | 151 | * depending on which parameter is specified: 'is_visited' or 'is_departed'. |
152 | 152 | */ |
153 | - public function markAddress($params) |
|
154 | - { |
|
155 | - $allQueryFields = ['route_id', 'route_destination_id']; |
|
156 | - $allBodyFields = ['is_visited', 'is_departed']; |
|
157 | - |
|
158 | - $result = Route4Me::makeRequst([ |
|
159 | - 'url' => Endpoint::ADDRESS_V4, |
|
160 | - 'method' => 'PUT', |
|
161 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
162 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
163 | - ]); |
|
164 | - |
|
165 | - return $result; |
|
166 | - } |
|
167 | - |
|
168 | - /* |
|
153 | + public function markAddress($params) |
|
154 | + { |
|
155 | + $allQueryFields = ['route_id', 'route_destination_id']; |
|
156 | + $allBodyFields = ['is_visited', 'is_departed']; |
|
157 | + |
|
158 | + $result = Route4Me::makeRequst([ |
|
159 | + 'url' => Endpoint::ADDRESS_V4, |
|
160 | + 'method' => 'PUT', |
|
161 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
162 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
163 | + ]); |
|
164 | + |
|
165 | + return $result; |
|
166 | + } |
|
167 | + |
|
168 | + /* |
|
169 | 169 | * Marks an address as departed. |
170 | 170 | */ |
171 | - public function markAsDeparted($params) |
|
172 | - { |
|
173 | - $allQueryFields = ['route_id', 'address_id', 'is_departed', 'member_id']; |
|
171 | + public function markAsDeparted($params) |
|
172 | + { |
|
173 | + $allQueryFields = ['route_id', 'address_id', 'is_departed', 'member_id']; |
|
174 | 174 | |
175 | - $address = Route4Me::makeRequst([ |
|
176 | - 'url' => Endpoint::MARK_ADDRESS_DEPARTED, |
|
177 | - 'method' => 'PUT', |
|
178 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
179 | - ]); |
|
175 | + $address = Route4Me::makeRequst([ |
|
176 | + 'url' => Endpoint::MARK_ADDRESS_DEPARTED, |
|
177 | + 'method' => 'PUT', |
|
178 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
179 | + ]); |
|
180 | 180 | |
181 | - return $address; |
|
182 | - } |
|
181 | + return $address; |
|
182 | + } |
|
183 | 183 | |
184 | - /* |
|
184 | + /* |
|
185 | 185 | * Marks an address as visited. |
186 | 186 | */ |
187 | - public function markAsVisited($params) |
|
188 | - { |
|
189 | - $allQueryFields = ['route_id', 'address_id', 'is_visited', 'member_id']; |
|
190 | - |
|
191 | - $address = Route4Me::makeRequst([ |
|
192 | - 'url' => Endpoint::UPDATE_ADDRESS_VISITED, |
|
193 | - 'method' => 'PUT', |
|
194 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
195 | - ]); |
|
196 | - |
|
197 | - return $address; |
|
198 | - } |
|
199 | - |
|
200 | - public function deleteAddress() |
|
201 | - { |
|
202 | - $address = Route4Me::makeRequst([ |
|
203 | - 'url' => Endpoint::ADDRESS_V4, |
|
204 | - 'method' => 'DELETE', |
|
205 | - 'query' => [ |
|
206 | - 'route_id' => $this->route_id, |
|
207 | - 'route_destination_id' => $this->route_destination_id, |
|
208 | - ], |
|
209 | - ]); |
|
210 | - |
|
211 | - return (bool) $address['deleted']; |
|
212 | - } |
|
213 | - |
|
214 | - public function moveDestinationToRoute($params) |
|
215 | - { |
|
216 | - $allBodyFields = ['to_route_id', 'route_destination_id', 'after_destination_id']; |
|
217 | - |
|
218 | - $result = Route4Me::makeRequst([ |
|
219 | - 'url' => Endpoint::MOVE_ROUTE_DESTINATION, |
|
220 | - 'method' => 'POST', |
|
221 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
222 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
223 | - ]); |
|
224 | - |
|
225 | - return $result; |
|
226 | - } |
|
227 | - |
|
228 | - public function getAddressId() |
|
229 | - { |
|
230 | - return $this->route_destination_id; |
|
231 | - } |
|
187 | + public function markAsVisited($params) |
|
188 | + { |
|
189 | + $allQueryFields = ['route_id', 'address_id', 'is_visited', 'member_id']; |
|
190 | + |
|
191 | + $address = Route4Me::makeRequst([ |
|
192 | + 'url' => Endpoint::UPDATE_ADDRESS_VISITED, |
|
193 | + 'method' => 'PUT', |
|
194 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
195 | + ]); |
|
196 | + |
|
197 | + return $address; |
|
198 | + } |
|
199 | + |
|
200 | + public function deleteAddress() |
|
201 | + { |
|
202 | + $address = Route4Me::makeRequst([ |
|
203 | + 'url' => Endpoint::ADDRESS_V4, |
|
204 | + 'method' => 'DELETE', |
|
205 | + 'query' => [ |
|
206 | + 'route_id' => $this->route_id, |
|
207 | + 'route_destination_id' => $this->route_destination_id, |
|
208 | + ], |
|
209 | + ]); |
|
210 | + |
|
211 | + return (bool) $address['deleted']; |
|
212 | + } |
|
213 | + |
|
214 | + public function moveDestinationToRoute($params) |
|
215 | + { |
|
216 | + $allBodyFields = ['to_route_id', 'route_destination_id', 'after_destination_id']; |
|
217 | + |
|
218 | + $result = Route4Me::makeRequst([ |
|
219 | + 'url' => Endpoint::MOVE_ROUTE_DESTINATION, |
|
220 | + 'method' => 'POST', |
|
221 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
222 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
223 | + ]); |
|
224 | + |
|
225 | + return $result; |
|
226 | + } |
|
227 | + |
|
228 | + public function getAddressId() |
|
229 | + { |
|
230 | + return $this->route_destination_id; |
|
231 | + } |
|
232 | 232 | } |