ifnex/04_Laravel/app/Services
Kazem Alghasi b9ede16613 refactor(core): harden production environment and fix discount logic
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.
2026-10-31 19:18:58 +03:30
..
CustomerCreditService.php feat(finance): implement multi-currency credit tracking and dashboard widgets 2026-10-04 01:01:20 +03:30
DiscountCodeService.php refactor(core): harden production environment and fix discount logic 2026-10-31 19:18:58 +03:30
ExchangeRateService.php refactor(currency): enforce IRR-only across all UIs and storage 2026-10-29 22:31:26 +03:30
KavenegarSmsService.php feat(core): integrate Kavenegar SMS notifications and audit logging 2026-09-10 00:52:18 +03:30
ManualInvoiceService.php feat(invoices): thousand-separator formatting + fix total calc + integrate invoices into customer portal 2026-10-29 23:59:19 +03:30
MockZarinpalService.php feat(wallet): complete online payment with Zarinpal + mock gateway 2026-08-08 00:46:54 +03:30
OrderPaymentService.php feat(security): implement secure file storage and shipment access control 2026-10-01 03:34:28 +03:30
PdfService.php refactor(pdf): switch AWB template to landscape orientation 2026-10-03 20:33:15 +03:30
PriceCalculatorService.php refactor(core): harden production environment and fix discount logic 2026-10-31 19:18:58 +03:30
RateImportService.php refactor(currency): enforce IRR-only across all UIs and storage 2026-10-29 22:31:26 +03:30
ShipmentReviewService.php feat(notifications): customer notifications on approve/request-changes + WP tab + badge + timezone Iran 2026-10-02 19:08:41 +03:30
TrackingService.php feat(core): implement configuration-driven logic via SystemSetting 2026-09-10 02:25:21 +03:30
WalletService.php feat(wallet): complete wallet system with admin adjust, freeze/unfreeze, activity logs 2026-08-07 22:51:42 +03:30
ZarinpalService.php feat(wallet): complete online payment with Zarinpal + mock gateway 2026-08-08 00:46:54 +03:30