feat: Move Trello card to Packing when inspection is passed

- Create InspectionPassed event
- Create MoveCardToPackingOnInspectionPassed listener
- Register event listener in EventServiceProvider
- Dispatch event when markInspectionPassed() is called

Now when an order passes inspection on the ops page, the Trello card
automatically moves from Inspection to Packing list.
This commit is contained in:
twotalesanimation
2026-01-02 21:23:12 +02:00
parent 341421d2a0
commit 5cd8c05a7c
7 changed files with 347 additions and 6 deletions
@@ -106,15 +106,25 @@ class TrelloWebhookController extends Controller
// Handle list-specific actions
match ($listName) {
'Prep' => $order->update(['status' => 'prep']),
'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),
'In Transit' => Log::info('Card in transit', ['order_uuid' => $order->uuid]),
'Done' => Log::info('Card completed', ['order_uuid' => $order->uuid]),
'In Transit' => $order->update(['status' => 'in_transit']),
'Done' => $order->update(['status' => 'completed']),
default => Log::debug('Card moved to list', [
'order_uuid' => $order->uuid,
'list' => $listName,
]),
};
Log::info('Order status updated from Trello', [
'order_uuid' => $order->uuid,
'list' => $listName,
'status' => $order->status,
]);
}
/**