Implement critical security hardening and resolve a P0 bug in the
discount code consumption flow. This update transitions the system
from a development-heavy configuration to a production-ready state.
Key changes:
- Fix P0 bug where `consumeDiscountCode()` was missing, breaking order
registration; replaced with a robust `DiscountCodeService` using
`discount_code_usages` for audit trails and idempotency.
- Implement strict production guards for the Zarinpal payment gateway
to prevent accidental mock processing in live environments.
- Refactor WordPress bridge asset management to use `filemtime` based
versioning instead of `time()` to prevent unnecessary cache busting.
- Remove debug-only hacks (`opcache_reset`, `header` cache control)
from the WordPress plugin.
- Enhance file upload security by enforcing strict `mimetypes` validation.
- Update `.gitignore` to exclude sensitive WordPress configuration
files and local PHPUnit caches.
- Add comprehensive documentation for production deployment, including
security checklists and key rotation procedures.
- Update test suite to reflect new architecture and ensure 100%
coverage of the discount service.
Update project documentation to reflect the completion of Phase 0 and Phase 1, and the commencement of Phase 2. This includes archiving obsolete documents, updating the README with a new architectural overview, and refining the project checklist and status reports.
- Archive obsolete PRD and Roadmap documents
- Update `IFNEX_Phase0_Checklist.md` with completed tasks and Phase 2 roadmap
- Update `STATUS.md` with recent development progress for August 2026
- Refactor `04_Laravel/README.md` to include detailed technical specifications and architecture diagrams
- Update root `README.md` with updated versioning and system architecture visualization
- Refine `PriceCalculatorServiceTest.php` to align with updated service output structures
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`