Introduces a complete shipment review system allowing staff to request
changes to customer orders and customers to resubmit corrected orders.
- Add `ReviewState` enum and `ShipmentReview` model to track review history.
- Implement `ShipmentReviewService` to handle approval and change
request logic.
- Add `resubmit` endpoint for customers to update orders when
`changes_requested` state is active.
- Add `request-changes` endpoint for staff to flag orders for correction.
- Update `ShipmentResource` in Filament to display review states and
manage approvals.
- Implement WordPress bridge support for fetching and resubmitting
orders via AJAX.
- Add database migrations for `shipment_reviews` table and `review_state`
column on shipments.
- Add `StaffApiMiddleware` to secure staff-specific API routes.
Refactor the pricing calculation service and shipping rate import logic to improve consistency and reliability. This includes updating direction naming conventions, enhancing model casting, and adding comprehensive test suites.
- Update `ShippingRatesImport` to use 'outbound' and 'inbound' instead of 'export' and 'import'
- Refactor `PriceCalculatorService` to use a more modular calculation structure
- Update `ShippingRate` model to use explicit property casting for zones
- Add `HasFactory` trait to `Country` and `ShippingRate` models
- Add new database factories for `Country` and `ShippingRate`
- Implement new feature tests for API endpoints and service logic
- Add new service tests for `PriceCalculatorService`
Implement the core logic for applying discount codes during price
calculation and introduce the WalletService. This includes updating
the PriceCalculatorService to validate and apply discounts,
incrementing usage counts, and adding a Filament resource for
managing discount codes via the admin panel.
Additionally, refactor TrackingDataImport to use OnEachRow for better
memory management during large Excel imports.
Refactor the shipping rate import process to support bidirectional
data handling (import/export) and implement currency conversion using
system settings. Update the price calculator to ensure valid zone
data is retrieved.
- Update `ShippingRatesImport` to handle both import and export
directions via `SimpleRateSheetImport`.
- Implement AED to IRR conversion during rate importation using
`SystemSetting`.
- Add validation for zone numbers and rate values during import.
- Enhance `PriceCalculatorService` to filter for non-zero zone values.
- Add various debug and testing scripts for pricing and data
structure verification.