diff --git a/composer.json b/composer.json index ccf55ad0..a0467b5f 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "fleetbase/fleetops-api", - "version": "0.5.6", + "version": "0.5.7", "description": "Fleet & Transport Management Extension for Fleetbase", "keywords": [ "fleetbase-extension", @@ -22,7 +22,7 @@ ], "require": { "php": "^8.0", - "fleetbase/core-api": "^1.5.3", + "fleetbase/core-api": "^1.5.5", "barryvdh/laravel-dompdf": "^2.0", "brick/geo": "0.7.2", "cknow/laravel-money": "^7.1", diff --git a/extension.json b/extension.json index 9518d13e..c8cf3945 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "Fleet-Ops", - "version": "0.5.6", + "version": "0.5.7", "description": "Fleet & Transport Management Extension for Fleetbase", "repository": "https://github.com/fleetbase/fleetops", "license": "AGPL-3.0-or-later", diff --git a/package.json b/package.json index ed0dba43..b8d72c40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fleetbase/fleetops-engine", - "version": "0.5.6", + "version": "0.5.7", "description": "Fleet & Transport Management Extension for Fleetbase", "fleetbase": { "route": "fleet-ops" diff --git a/server/src/Http/Resources/v1/PurchaseRate.php b/server/src/Http/Resources/v1/PurchaseRate.php index c9394895..e4fa7701 100644 --- a/server/src/Http/Resources/v1/PurchaseRate.php +++ b/server/src/Http/Resources/v1/PurchaseRate.php @@ -2,7 +2,6 @@ namespace Fleetbase\FleetOps\Http\Resources\v1; -use Fleetbase\FleetOps\Support\Utils; use Fleetbase\Http\Resources\FleetbaseResource; use Fleetbase\Support\Http; @@ -62,14 +61,8 @@ public function toWebhookPayload() */ public function serviceQuote() { - if (Utils::notEmpty($this->service_quote_uuid) && Utils::isEmpty($this->serviceQuote)) { - $this->load(['serviceArea']); - } + $this->loadMissing('serviceQuote'); - if (Utils::isEmpty($this->serviceQuote)) { - return null; - } - - return new ServiceQuote($this->serviceQuote); + return $this->serviceQuote ? new ServiceQuote($this->serviceQuote) : null; } } diff --git a/server/src/Http/Resources/v1/TrackingStatus.php b/server/src/Http/Resources/v1/TrackingStatus.php index dc7dd0ce..a0f64f97 100644 --- a/server/src/Http/Resources/v1/TrackingStatus.php +++ b/server/src/Http/Resources/v1/TrackingStatus.php @@ -2,7 +2,6 @@ namespace Fleetbase\FleetOps\Http\Resources\v1; -use Fleetbase\FleetOps\Support\Utils; use Fleetbase\Http\Resources\FleetbaseResource; use Fleetbase\LaravelMysqlSpatial\Types\Point; use Fleetbase\Support\Http; @@ -68,14 +67,8 @@ public function toWebhookPayload() */ public function trackingNumber() { - if (Utils::notEmpty($this->tracking_number_uuid) && Utils::isEmpty($this->trackingNumber)) { - $this->load(['trackingNumber']); - } + $this->loadMissing('trackingNumner'); - if (Utils::isEmpty($this->trackingNumber)) { - return null; - } - - return new TrackingNumber($this->trackingNumber); + return $this->trackingNumber ? new TrackingNumber($this->trackingNumber) : null; } }