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
This commit is contained in:
twotalesanimation
2026-01-02 21:32:41 +02:00
parent 027278c216
commit 206ea2d35c
@@ -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', [