Integrate `SystemSetting` into core services to enable dynamic
configuration of business logic and update the WordPress order form
redirection to align with the new order approval workflow.
- Update `PaymentController`, `ShipmentObserver`, and `TrackingService`
to utilize `SystemSetting` for runtime configuration.
- Modify `ifnex-order-form.js` to redirect users to the orders list
instead of order details upon successful submission.
Implement a comprehensive notification system using Kavenegar SMS
gateway and enhance system traceability through audit logging and
detailed shipment status history.
- SMS Integration:
- Add Kavenegar SMS service with configurable API keys and sender
numbers via system settings.
- Implement automated SMS notifications for shipment approval,
rejection, successful payments, and tracking updates.
- Add administrative UI in Filament to manage SMS gateway settings
and toggle specific notification types.
- Audit & Tracking:
- Apply `Auditable` trait to core models (User, Shipment, Wallet,
etc.) to track changes.
- Refactor `ShipmentStatusHistory` to include status transitions
(`from_status` to `to_status`) and specific reasons for changes.
- Implement `ShipmentObserver` to automate notification triggers
on status changes.
- Database & Config:
- Add migrations for enhanced shipment status history tracking.
- Update `.env.example` and `config/ifnex.php` with Kavenegar
configuration parameters.
Introduce a complete workflow for managing shipment-related documents
and mandatory commitment forms between the Laravel backend and
WordPress frontend.
- Laravel:
- Add `ShipmentCommitmentForm` model and migration to track signed
forms per shipment.
- Implement `CommitmentFormController` to handle fetching available
forms and uploading signed documents.
- Add PDF download endpoints for AWB, labels, and invoices via
`ShipmentPdfController`.
- Extend `User` model with notification management methods.
- Add `FinanceOverviewWidget` for Filament dashboard.
- WordPress:
- Implement AJAX handlers in `user-bridge.php` for PDF downloads and
commitment form management.
- Update `shortcodes.php` to display document download grid and
dynamic commitment form upload interface in order details.
- Add styling for document buttons and form status indicators in
`ifnex-orders.css`.
Refactor the order and shipment lifecycle across WordPress and Laravel,
improving multi-package handling, payment automation, and frontend
reliability.
- Laravel:
- Rename `package_number` to `package_no` and `description` to
`content_description` in `ShipmentPackage` model and controller.
- Update `PaymentController` to automatically transition approved
shipments to `Processed` status upon successful payment.
- Adjust `OrderPaymentService` to validate against `Approved` status
instead of `PendingPayment`.
- Expose `/countries` endpoint as a public route (unauthenticated).
- Remove obsolete `read_excel.php` utility.
- WordPress (Bridge Plugin & Theme):
- Implement AJAX handler for wallet-based order payments.
- Update `ifnex-order-form.js` to support multi-package input names
and auto-select Iran based on shipment direction.
- Improve error handling and feedback in the order form and country
loading logic.
- Add automatic tracking submission when an `awb` parameter is
present in the URL.
- Update CSS with `!important` flags to ensure correct visibility
of form steps and dashboard elements.
- Implement cache-busting for plugin assets and prevent OPcache
stale files via header controls.
- Optimize theme logo loading with eager loading and explicit
dimensions.
Introduce a comprehensive set of commercial features including a multi-step
order approval workflow, customer credit management, and specialized
import service invoicing.
Key changes:
- Implement `pending_approval` and `approved` shipment statuses to allow
staff verification before customer payment.
- Add a credit system to `User` model with `credit_limit` and `credit_used`
to manage customer balances and debts.
- Develop a new `importInvoice` PDF generation service following the
"Sheet ENG Invoice" specification for import services.
- Add Filament resources for managing Audit Logs, Commitment Forms,
Customer Credits, and Shipment Checklists.
- Implement staff-specific APIs for order approval/rejection and
customer financial status monitoring.
- Integrate Kavenegar SMS service for mobile verification and notifications.
- Add bulk tracking import functionality via CSV/Excel.
- Update WordPress bridge assets (CSS/JS) to support the new multi-step
order form UI and updated redirection logic.
- Update deployment configurations and documentation to reflect new
production domains and feature sets.
✅ Multi-Package Support (3.5.1)
- Add shipment_packages migration and ShipmentPackage model
- Add packages() relation to Shipment model
- Update CustomerOrderController to accept packages[] array
- Auto-calculate volumetric weight from dimensions (L*W*H/5000)
- Repeater UI for adding/removing packages
- Real-time summary of total weights
✅ Invoice Form for PARCEL (3.5.2)
- New step in order form (only for PARCEL type)
- Customs items: description, HS Code, quantity, unit price (USD)
- Auto-calculate total per item and invoice total
- Maximum 9 items
- 5-step order form structure
✅ PDF Redesign (3.5.4)
- Install picqer/php-barcode-generator
- Redesign AWB with barcode, From/To, Value, Service, Type
- Redesign Invoice with 9-row table, legal declaration
- Redesign Label to A5 landscape with large barcode
- DOC/PARCEL condition (only PARCEL has invoice)
- Barcode as base64 embed
✅ Technical Fixes (3.5.5)
- Add Enum casts to Shipment model (status, direction, type)
- Fix deselectAfterCompletion -> deselectRecordsAfterCompletion
- Migration for shipment_items (row_number, unit_price)
- Migration to make name nullable
- Fix Enum method names (DocNormal/DocEconomy)
✅ Tracking Test (3.5.6)
- Update TrackController with status_label
- Redesign tracking page with beautiful timeline
- Status box with colored badge
- Timeline with date, description, location, source
- Carrier mappings section
Documentation:
- Update README, Laravel_README, Roadmap, Checklist
- Add IFNEX_Meeting_Summary.md for client presentation
- Update IFNEX_I18N_Strategy.md (moved to deploy phase)
Phase 3.5 — 90% complete (i18n moved to deploy phase)"
- Add packages() relation to Shipment model
- Update CustomerOrderController to accept packages[] array
- Auto-calculate volumetric weight from dimensions (L*W*H/5000)
- Redesign order form Step 1 with Multi-Package UI
- Add package repeater (add/remove packages)
- Real-time summary of total weights
- Both real weight and dimensions are required
- Dimensions normalized to * format (5*6*9)
Phase 3.5.1 — Multi-Package complete"
- Redesign AWB PDF with barcode, From/To, Value, Service, Type
- Redesign Invoice PDF with 9-row table, legal declaration, barcode
- Redesign Label PDF to A5 landscape with large barcode
- Add DOC/PARCEL condition for Invoice (only PARCEL has invoice)
- Fix ShipmentType enum names (DocNormal/DocEconomy)
- Add migration for shipment_items (row_number, unit_price)
- Add migration to make name nullable
- Update PdfService with base64 barcode embedding
- Update ShipmentPdfController with DOC type handling
- Add test_pdf_generation.php script
Phase 3.5 — PDF redesign complete"
This commit marks the completion of Phase 3 (Integration and Improvements) and updates the project status to reflect that Phases 0 through 3 are finished.
Key changes include:
- **Laravel (Backend):**
- Added `calling_code` column to `countries` table via new migration.
- Added scripts to update calling codes for all countries.
- Updated `CustomerOrderController` to include `calling_code` in country data.
- Registered `api_key` middleware alias in `bootstrap/app.php`.
- Improved error handling to return JSON 401 for API authentication failures.
- Updated `README.md` with detailed architecture and feature descriptions.
- **WordPress (Frontend/Bridge):**
- Added `ifnex_wallet_charge` shortcode and AJAX handler for wallet top-ups.
- Implemented auto-fill for calling codes in the order form based on selected country.
- Added real-time phone number validation (digits, +, spaces only).
- Added English-only validation for name, city, and address fields with UI warnings.
- Updated asset enqueuing logic and versioning for CSS/JS.
- **Documentation:**
- Updated `IFNEX_File_Map.md`, `IFNEX_Phase0_Checklist.md`, and `IFNEX_Roadmap.md` to reflect completed phases and new features.
- Updated `DEPLOYMENT.md` with new environment variables (`IFNEX_BRIDGE_API_KEY`) and required WordPress pages.
- Updated project `README.md` with comprehensive feature list and system architecture.
Implement backend support for the user notification system by adding
endpoints to retrieve and manage notifications.
- Add `notifications` and `markNotificationRead` methods to
`CustomerOrderController`
- Register notification routes under the `v1` API prefix
- Update `IFNEX_User_Bridge` in WordPress to support fetching
notifications and marking them as read via API calls
Implement a comprehensive financial management suite within the Filament
admin panel, including new resources for payments and discount codes,
along with a financial dashboard.
- feat(ui): add Filament Dashboard with finance overview and transaction
widgets
- feat(ui): implement PaymentResource for monitoring gateway transactions
- feat(ui): complete DiscountCodeResource with full CRUD and filtering
- feat(wallet): add automatic wallet creation on balance retrieval
- fix(wallet): resolve null handling in isFrozen() and balance viewing
- fix(db): correct enum type from 'percent' to 'percentage' in
discount_codes migration
- fix(api): update pricing calculation endpoint to /api/v1/calculate
- test: add 21 new feature and service tests covering wallet, payment,
and discount logic
- chore: remove obsolete PaymentGatewayService and update project status
- Add ZarinpalService for production payment gateway
- Add MockZarinpalService for testing without real merchant ID
- Add MockGatewayController for simulating payment page
- Add beautiful mock gateway UI with RTL support
- Update PaymentController to switch between mock/real based on config
- Fix double-click bug: prevent re-processing completed transactions
- Add payment-result page with success/failure UI
- All API endpoints tested successfully:
* balance, transactions, activity-log
* admin-adjust (deposit/withdrawal)
* freeze/unfreeze
* online payment redirect + callback + verify
- Wallet balance verified: 67,700,000 IRR after all transactions
- 5 transactions recorded with correct gateways (manual/zarinpal)
Closes: Payment gateway integration for Phase 2
Add Zarinpal configuration options and implement the core payment
infrastructure, including the Payment model, migration, service
layer, and API controller.
Implement new API controllers for wallet management and discount code
validation. This includes adding an Artisan command for exchange rate
updates and refining the API routing structure.
Additionally, perform a significant cleanup of the repository by
removing obsolete migrations, debug scripts, and temporary test files.
Security and configuration improvements include restricting CORS origins
via environment variables and updating the system settings schema.
- Add `WalletController` and `DiscountCodeController` APIs
- Add `UpdateExchangeRates` command
- Remove redundant migrations and debug/test scripts
- Secure CORS configuration using `CORS_ALLOWED_ORIGINS`
- Update `STATUS.md` to reflect current phase progress
Improve the reliability and usability of the shipping rates import
process and update PDF document templates for better visual fidelity.
- Enhance `ImportShippingRates` command with `--clear` and `--dry-run`
options to prevent accidental data loss and allow safe testing.
- Implement error handling and statistics tracking in `ShippingRatesImport`
to capture skipped rows and import errors.
- Refactor AWB and Label PDF templates to use A4 standard dimensions
and improved CSS layouts.
- Integrate company logo into PDF headers.
- Add a new pricing inquiry page and navigation link.
- Clean up obsolete test scripts.
Introduce PDF generation capabilities for shipments using laravel-dompdf.
This includes a new service layer, dedicated controller, and routes
to handle the generation of Air Waybills (AWB), Invoices, and Shipping
Labels.
- Add `PdfService` to encapsulate PDF generation logic.
- Add `ShipmentPdfController` to handle PDF download requests.
- Integrate `barryvdh/laravel-dompdf` dependency.
- Add Filament header actions to view shipment pages for quick PDF access.
- Update order success view to provide direct download links for documents.
- Add label methods to `ShipmentDirection` and `ShipmentType` enums.
- Update project status documentation to reflect initial PDF implementation.
Introduce order management functionality including web routes for creating orders and a new API endpoint for price calculations. This change also cleans up the codebase by removing various debug scripts used during the development of the shipping rate logic.
- Add `OrderController` to handle order creation and success redirection.
- Add `POST /v1/calculate` endpoint for pricing calculations.
- Define web routes for order creation flow (`/order`).
- Remove multiple debug PHP scripts from the `04_Laravel` directory.
- Add base layout and order view directories.