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
+10 -1
View File
@@ -4,6 +4,7 @@ namespace App\Providers;
use App\Events\BalancePaid;
use App\Events\DepositPaid;
use App\Events\InspectionPassed;
use App\Events\OrderCreated;
use App\Events\OrderPacked;
use App\Events\ParcelCollected;
@@ -18,6 +19,7 @@ use App\Events\ShipmentCreated;
use App\Events\ShipmentCreationFailed;
use App\Listeners\CreateShipmentOnReadyToShip;
use App\Listeners\GenerateQrCodeOnOrderCreated;
use App\Listeners\MoveCardToPackingOnInspectionPassed;
use App\Listeners\NotifySlackOnOrderCreated;
use App\Listeners\NotifySlackOnOrderPacked;
use App\Listeners\NotifySlackOnParcelCollected;
@@ -46,7 +48,14 @@ class EventServiceProvider extends ServiceProvider
// Packing events
OrderPacked::class => [
NotifySlackOnOrderPacked::class,
],Ready to Ship intent (from Trello webhook)
],
// Inspection events
InspectionPassed::class => [
MoveCardToPackingOnInspectionPassed::class,
],
// Ready to Ship intent (from Trello webhook)
ReadyToShipIntent::class => [
CreateShipmentOnReadyToShip::class,
],