feat: Add CreateShipmentOnReadyToShip listener to handle webhook-triggered shipments

- Create new listener that fires on ReadyToShipIntent event
- Register listener in EventServiceProvider
- Fix log statements in ShippingController to use order UUID instead of ID
- Now when Trello card moves to 'Ready to Ship', backend automatically creates shipment
This commit is contained in:
twotalesanimation
2026-01-02 17:26:11 +02:00
parent 291393d497
commit 1c68fff301
3 changed files with 57 additions and 3 deletions
+7
View File
@@ -13,8 +13,10 @@ use App\Events\ParcelInTransit;
use App\Events\ProofApproved;
use App\Events\ProofRevisionRequested;
use App\Events\ProofUploaded;
use App\Events\ReadyToShipIntent;
use App\Events\ShipmentCreated;
use App\Events\ShipmentCreationFailed;
use App\Listeners\CreateShipmentOnReadyToShip;
use App\Listeners\NotifySlackOnOrderCreated;
use App\Listeners\NotifySlackOnOrderPacked;
use App\Listeners\NotifySlackOnParcelCollected;
@@ -42,8 +44,13 @@ class EventServiceProvider extends ServiceProvider
// Packing events
OrderPacked::class => [
NotifySlackOnOrderPacked::class,
],Ready to Ship intent (from Trello webhook)
ReadyToShipIntent::class => [
CreateShipmentOnReadyToShip::class,
],
//
// Shipment events
ShipmentCreated::class => [
NotifySlackOnShipmentCreated::class,