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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user