Commit Graph

12 Commits

Author SHA1 Message Date
twotalesanimation aa30111841 fix: Fix CreateShipmentOnReadyToShip listener syntax and add guard logging 2026-01-02 17:37:54 +02:00
twotalesanimation 1c68fff301 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
2026-01-02 17:26:11 +02:00
twotalesanimation 291393d497 feat: Implement full Trello webhook handling and event dispatch
- Parse incoming Trello webhook payloads for card movement actions
- Extract order number from card names (supports both numeric and full formats)
- Look up orders in database (Order or CustomOrder models)
- Emit ReadyToShipIntent event when cards moved to 'Ready to Ship' list
- Validate shipment exists before allowing 'Awaiting Collection' transition
- Add comprehensive logging for all Trello actions
- Handle validation pings and real events identically (both return 200)
- Card moves now trigger backend order processing workflows
2026-01-02 16:33:41 +02:00
twotalesanimation ca7d16da16 feat: Add Trello configuration fallback and test command
- Add fallback env parsing directly from .env file in config/trello.php
- Fixes issue where cached config prevents env() from reading .env values
- Add artisan trello:test command to diagnose Trello configuration
- Test command checks API credentials, board/list IDs, and connectivity
- Test successfully creates and moves a test Trello card
2026-01-02 15:36:27 +02:00
twotalesanimation 783cc88c6d feat: Update Order/CustomOrder models and controllers with event integration
- Add integration fields to Order model: packing_*, courier_*, trello_card_id, qr_token
- Add integration fields to CustomOrder model: packing_*, proof_approved_*, courier_*, trello_card_id, qr_token
- Update Order model fillable array and add relationships (packedBy)
- Update CustomOrder model fillable array, casts, and add relationships (packedBy)
- Add isCustomOrder() method to both models for type checking
- Update OrderController to emit OrderCreated and DepositPaid events on successful payment
- For standard orders: full payment -> prep status, emit events
- For custom orders: deposit -> design status, balance -> printing status, emit respective events
- Add approveProof() method to CustomOrderController (POST /custom-orders/{id}/approve-proof)
- Add requestChanges() method to CustomOrderController (POST /custom-orders/{id}/request-changes)
- Add markBalancePaid() method to CustomOrderController (POST /custom-orders/{id}/pay-balance)
- All new methods emit appropriate events (ProofApproved, ProofRevisionRequested, BalancePaid)
- Add database migration for proof_approved and proof_approved_at fields on custom_orders
- Add routes for new custom order endpoints with UUID binding
- Import all required event classes in both controllers
2026-01-02 14:35:01 +02:00
twotalesanimation 12aadfd917 feat: Implement Slack, Trello, and Courier (ShipLogic) integration
- Add 14 domain events for order lifecycle (OrderCreated, OrderPacked, ShipmentCreated, ParcelDelivered, etc.)
- Create SlackNotifierService with channels for orders, design, production, shipping, ops-alerts
- Create TrelloService to create cards, move cards between lists, attach files, check items
- Create CourierService to integrate with ShipLogic API for shipment creation and document retrieval
- Create PackingController to explicitly capture packing dimensions and weight
- Create ShippingController with multi-layer guards: packing validation, payment/approval verification, idempotency
- Create TrelloWebhookController to handle incoming Trello webhooks as intent signals
- Create CourierWebhookController to handle Shiplogic status updates
- Create event listeners for Slack notifications and Trello card updates
- Create EventServiceProvider to register all events and listeners
- Add database migration for packing, courier, and Trello data columns
- Create config files for slack, trello, and courier integration
- Update .env with integration secrets placeholders
- Add routes for /orders/{id}/pack, /orders/{id}/ship, /api/webhooks/trello, /api/webhooks/courier

Key architectural decisions:
- Packing is explicit ops action (not automatic from status)
- Shipment creation only after: Trello intent + packing confirmed + payment/approval rules met
- Courier API failures keep order in Ready to Ship state (safe retry)
- Trello and Slack are mirrors of backend state, not decision makers
- All side effects flow through event listeners, maintaining separation of concerns
2026-01-02 13:47:31 +02:00
twotalesanimation 94b90f603d Invoice system working 2025-12-30 22:10:30 +02:00
twotalesanimation e8e9b1f03c relocating 2025-12-30 20:59:58 +02:00
twotalesanimation a898c35a39 commit before consolodating payment methods 2025-12-30 10:40:45 +02:00
twotalesanimation 3c24c0e9ef everything semi working before sample implementation 2025-12-30 00:09:14 +02:00
twotalesanimation 00b8ff77b2 yoco updated to use webhook 2025-12-29 14:43:24 +02:00
twotalesanimation 6de01c13c5 New Initial Commit 2025-12-09 12:04:54 +02:00