From e57457d73e6552d0eaa5211f109d1594a34a3e8a Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Sat, 31 Aug 2024 15:23:34 +0800 Subject: [PATCH 1/3] hotfix loading service quote for purchase rate --- composer.json | 2 +- extension.json | 2 +- package.json | 2 +- server/src/Http/Resources/v1/PurchaseRate.php | 11 ++--------- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index ccf55ad0..0bd3c9c7 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", 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; } } From 22c6f6527f65248bc084458a09b3990c15e57ca6 Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Sat, 31 Aug 2024 15:27:25 +0800 Subject: [PATCH 2/3] improved resource loading --- server/src/Http/Resources/v1/TrackingStatus.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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; } } From 59ec5a9430bce2d4cbb6d019798d4d5c35010ecd Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Sat, 31 Aug 2024 15:27:48 +0800 Subject: [PATCH 3/3] bump core-api --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0bd3c9c7..a0467b5f 100644 --- a/composer.json +++ b/composer.json @@ -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",