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:
@@ -110,8 +110,14 @@ class TrelloWebhookController extends Controller
|
|||||||
'Printing' => $order->update(['status' => 'printing']),
|
'Printing' => $order->update(['status' => 'printing']),
|
||||||
'Inspection' => $order->update(['status' => 'inspection']),
|
'Inspection' => $order->update(['status' => 'inspection']),
|
||||||
'Packing' => $order->update(['status' => 'packing']),
|
'Packing' => $order->update(['status' => 'packing']),
|
||||||
'Ready to Ship' => $this->handleReadyToShipIntent($order, $cardId),
|
'Ready to Ship' => (function () use ($order, $cardId) {
|
||||||
'Awaiting Collection' => $this->handleAwaitingCollectionIntent($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']),
|
'In Transit' => $order->update(['status' => 'in_transit']),
|
||||||
'Done' => $order->update(['status' => 'completed']),
|
'Done' => $order->update(['status' => 'completed']),
|
||||||
default => Log::debug('Card moved to list', [
|
default => Log::debug('Card moved to list', [
|
||||||
|
|||||||
Reference in New Issue
Block a user