From 206ea2d35cfee9bc4e63579e8ce2a80f76d6d022 Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Fri, 2 Jan 2026 21:32:41 +0200 Subject: [PATCH] fix: Update order status to ready_to_ship before handling intent - Previously 'Ready to Ship' list movement was calling handler without updating status - This caused status to remain 'packing' even after card moved to Ready to Ship - Now status is updated to 'ready_to_ship' before attempting shipment creation - Also added status update for Awaiting Collection list for consistency --- app/Http/Controllers/TrelloWebhookController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/TrelloWebhookController.php b/app/Http/Controllers/TrelloWebhookController.php index 45013f4..1550171 100644 --- a/app/Http/Controllers/TrelloWebhookController.php +++ b/app/Http/Controllers/TrelloWebhookController.php @@ -110,8 +110,14 @@ class TrelloWebhookController extends Controller 'Printing' => $order->update(['status' => 'printing']), 'Inspection' => $order->update(['status' => 'inspection']), 'Packing' => $order->update(['status' => 'packing']), - 'Ready to Ship' => $this->handleReadyToShipIntent($order, $cardId), - 'Awaiting Collection' => $this->handleAwaitingCollectionIntent($order, $cardId), + 'Ready to Ship' => (function () use ($order, $cardId) { + $order->update(['status' => 'ready_to_ship']); + $this->handleReadyToShipIntent($order, $cardId); + })(), + 'Awaiting Collection' => (function () use ($order, $cardId) { + $order->update(['status' => 'awaiting_collection']); + $this->handleAwaitingCollectionIntent($order, $cardId); + })(), 'In Transit' => $order->update(['status' => 'in_transit']), 'Done' => $order->update(['status' => 'completed']), default => Log::debug('Card moved to list', [