9 Commits

Author SHA1 Message Date
twotalesanimation 2a10f9af38 feat: Complete Shiplogic integration with mobile-optimized ops workflow
**Shiplogic API Integration:**
- Fixed API base URL configuration (removed /api suffix)
- Implemented comprehensive request/response logging for rates and shipments endpoints
- Fixed PDF fetching: API returns S3 URLs, now downloads actual PDFs from S3
- Added tests and mock API responses for local development (routes/shiplogic-mock.php)

**Courier Service Enhancements:**
- Added redownloadShipmentPdfs() public method for re-downloading corrupted PDFs
- Enhanced error logging with full request/response bodies for debugging
- Proper binary PDF storage using Laravel Storage facade
- URL and S3 download handling for Shiplogic API responses

**Workflow & Operations:**
- Changed to manual "Ready for Collection" button instead of automatic move
- Operators now: scan QR → apply labels → click "Ready for Collection" → moves to Awaiting Collection
- Removed duplicate PDF attachments to Trello (was adding twice from two listeners)
- Fixed NotifySlackOnShipmentCreated to only handle Slack notifications

**Mobile-Optimized Ops Page:**
- Removed QR code display from order detail page
- Implemented responsive single-column layout for mobile phones
- Large touch-friendly buttons (full width, increased padding)
- Bold typography for better readability on small screens
- Larger input fields and tracking number displays
- Clear step-by-step instructions for warehouse operators
- Re-download PDF button for damaged/corrupted labels

**New Features:**
- POST /ops/orders/{uuid}/ready-for-collection endpoint
- Re-download PDFs functionality accessible from awaiting_collection and in_transit states
- Full audit logging for all operations via ops interface
- Proper error handling and user feedback

**Testing:**
- Added ShipmentCreationTest with mock HTTP client
- Created comprehensive testing guide (SHIPLOGIC_TESTING.md)
- Mock API routes for local development without hitting live API
2026-01-03 16:13:20 +02:00
twotalesanimation 124ab46507 refactor: Split shipping_address into component fields for ShipLogic API
- Create migration to add shipping_street_address, shipping_local_area, shipping_city, shipping_zone, shipping_country, shipping_postcode, shipping_type
- Update Order model fillable array with new address component fields
- Remove address parsing logic from CourierService
- Use individual address fields directly in ShipLogic API payload
- Fields match ShipLogic API requirements (street_address, local_area, city, zone, code, country, type)
- Note: Custom orders address collection can be implemented later
2026-01-02 21:40:16 +02:00
twotalesanimation 027278c216 fix: Add datetime casts to Order model and null check in view
- Add casts array to Order model for packing_completed_at, delivered_at, qr_generated_at
- Update ops order-detail view to safely handle null packing_completed_at
- Prevents 'Call to a member function format() on string' error
2026-01-02 21:29:12 +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 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 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