@fleetbase/fleetops-engine 0.4.14 → 0.4.16
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/composer.json +2 -2
- package/extension.json +1 -1
- package/package.json +1 -1
- package/server/src/Expansions/UserExpansion.php +4 -4
- package/server/src/Http/Controllers/Internal/v1/OrderController.php +10 -9
- package/server/src/Http/Resources/v1/Payload.php +1 -1
- package/server/src/Models/Payload.php +2 -0
- package/server/src/Support/Utils.php +1 -1
package/composer.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fleetbase/fleetops-api",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "Fleet & Transport Management Extension for Fleetbase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fleetbase-extension",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"require": {
|
|
24
24
|
"php": "^8.0",
|
|
25
|
-
"fleetbase/core-api": "^1.4.
|
|
25
|
+
"fleetbase/core-api": "^1.4.10",
|
|
26
26
|
"barryvdh/laravel-dompdf": "^2.0",
|
|
27
27
|
"brick/geo": "0.7.2",
|
|
28
28
|
"cknow/laravel-money": "^7.1",
|
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ class UserExpansion implements Expansion
|
|
|
21
21
|
/**
|
|
22
22
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
|
23
23
|
*/
|
|
24
|
-
public function driver()
|
|
24
|
+
public static function driver()
|
|
25
25
|
{
|
|
26
26
|
return function () {
|
|
27
27
|
/* @var \Illuminate\Database\Eloquent\Model $this */
|
|
@@ -32,7 +32,7 @@ class UserExpansion implements Expansion
|
|
|
32
32
|
/**
|
|
33
33
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
|
34
34
|
*/
|
|
35
|
-
public function currentDriverSession()
|
|
35
|
+
public static function currentDriverSession()
|
|
36
36
|
{
|
|
37
37
|
return function () {
|
|
38
38
|
/* @var \Illuminate\Database\Eloquent\Model $this */
|
|
@@ -43,7 +43,7 @@ class UserExpansion implements Expansion
|
|
|
43
43
|
/**
|
|
44
44
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
45
45
|
*/
|
|
46
|
-
public function driverProfiles()
|
|
46
|
+
public static function driverProfiles()
|
|
47
47
|
{
|
|
48
48
|
return function () {
|
|
49
49
|
/* @var \Illuminate\Database\Eloquent\Model $this */
|
|
@@ -54,7 +54,7 @@ class UserExpansion implements Expansion
|
|
|
54
54
|
/**
|
|
55
55
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
|
56
56
|
*/
|
|
57
|
-
public function customer()
|
|
57
|
+
public static function customer()
|
|
58
58
|
{
|
|
59
59
|
return function () {
|
|
60
60
|
/* @var \Illuminate\Database\Eloquent\Model $this */
|
|
@@ -144,15 +144,16 @@ class OrderController extends FleetOpsController
|
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
* Route which enables editing of an order route.
|
|
147
|
-
*
|
|
148
|
-
* @param string $id - The order ID
|
|
149
|
-
*
|
|
147
|
+
*
|
|
148
|
+
* @param string $id - The order ID
|
|
149
|
+
*
|
|
150
150
|
* @return Response
|
|
151
151
|
*/
|
|
152
|
-
public function editOrderRoute(string $id, Request $request)
|
|
153
|
-
|
|
154
|
-
$
|
|
155
|
-
$
|
|
152
|
+
public function editOrderRoute(string $id, Request $request)
|
|
153
|
+
{
|
|
154
|
+
$pickup = $request->input('pickup');
|
|
155
|
+
$dropoff = $request->input('dropoff');
|
|
156
|
+
$return = $request->input('return');
|
|
156
157
|
$waypoints = $request->array('waypoints', []);
|
|
157
158
|
|
|
158
159
|
// Get the order
|
|
@@ -160,7 +161,7 @@ class OrderController extends FleetOpsController
|
|
|
160
161
|
if (!$order) {
|
|
161
162
|
return response()->error('Unable to find order to update route for.');
|
|
162
163
|
}
|
|
163
|
-
|
|
164
|
+
|
|
164
165
|
// Handle update of multiple waypoints
|
|
165
166
|
if ($waypoints) {
|
|
166
167
|
$order->payload->updateWaypoints($waypoints);
|
|
@@ -185,7 +186,7 @@ class OrderController extends FleetOpsController
|
|
|
185
186
|
$order->payload->removeWaypoints();
|
|
186
187
|
}
|
|
187
188
|
|
|
188
|
-
return ['order' => new $this->resource($order)];
|
|
189
|
+
return ['order' => new $this->resource($order)];
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
/**
|
|
@@ -578,6 +578,7 @@ class Payload extends Model
|
|
|
578
578
|
}
|
|
579
579
|
|
|
580
580
|
$this->load('order');
|
|
581
|
+
|
|
581
582
|
return $this->order;
|
|
582
583
|
}
|
|
583
584
|
|
|
@@ -585,6 +586,7 @@ class Payload extends Model
|
|
|
585
586
|
{
|
|
586
587
|
Waypoint::where('payload_uuid', $this->uuid)->delete();
|
|
587
588
|
$this->setRelation('waypoints', collect());
|
|
589
|
+
|
|
588
590
|
return $this;
|
|
589
591
|
}
|
|
590
592
|
|