From 50e0cff4979e4b8662839fa6cb8a434d98d7bbf0 Mon Sep 17 00:00:00 2001 From: Juan Felipe Zapata Moreno Date: Sat, 17 Jan 2026 01:13:28 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20pacakges/boxes=20razones=20de=20cancelac?= =?UTF-8?q?i=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Repuve/PackageController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Controllers/Repuve/PackageController.php b/app/Http/Controllers/Repuve/PackageController.php index d8da343..f431eed 100644 --- a/app/Http/Controllers/Repuve/PackageController.php +++ b/app/Http/Controllers/Repuve/PackageController.php @@ -31,6 +31,7 @@ public function index(Request $request) 'tags.status:id,code,name', 'tags.vehicle:id,placa,niv', 'tags.module:id,name', + 'tags.cancellationLogs.cancellationReason', 'user:id,name,email' ]); } else { @@ -107,6 +108,11 @@ public function index(Request $request) 'id' => $tag->module->id, 'name' => $tag->module->name, ] : null, + 'cancellation_reason' => in_array($tag->status?->code, ['cancelled', 'damaged']) && $tag->cancellationLogs->first() ? [ + 'reason' => $tag->cancellationLogs->first()->cancellationReason?->name, + 'observations' => $tag->cancellationLogs->first()->cancellation_observations, + 'cancelled_at' => $tag->cancellationLogs->first()->cancellation_at, + ] : null, ]; }), ];