Commit Graph

40 Commits

Author SHA1 Message Date
Kazem Alghasi
e9a0c731c2 feat(admin): implement currency management and rate import system
Introduce a new currency management module including a dedicated
resource, database migration, and a custom Filament page for importing
exchange rates. Additionally, enhance the ShipmentResource table with
improved column visibility, sorting, and route display, and integrate
shipment update notifications.
2026-08-24 01:18:34 +03:30
Kazem Alghasi
a973c7ed5c feat(ui): add invoice download action to shipment view
Add a new 'download_invoice' action to the ViewShipment Filament page, allowing users to download invoices directly from the shipment details view.

refactor(shipping): remove redundant Persian comments from import classes
2026-08-23 23:35:12 +03:30
Kazem Alghasi
ab591dc9f8 refactor(shipping): clean up import logic and fix PDF asset paths
Refactor the shipping rates import process to remove redundant comments
and simplify variable assignments. Additionally, update PDF templates
to use the `asset()` helper instead of `public_path()` for logo
rendering to ensure consistent asset loading.

- refactor(import): simplify `ShippingRatesImport` logic and variable naming
- fix(pdf): update logo image source from `public_path` to `asset` in AWB and Label templates
2026-08-23 22:56:08 +03:30
Kazem Alghasi
b051ce4496 feat(shipment): expand schema and enhance PDF generation
Extend the shipment database schema to support additional tracking fields,
state information, and financial data. This update also transitions
shipment documentation from RTL/Persian to LTR/English layouts and
integrates barcode generation for AWB and labels.

- feat(db): add migration for missing shipment fields (state, cod_amount,
  declared_value, etc.)
- feat(shipment): update Shipment model with new casts and helper methods
- feat(ui): refactor Filament resource to use ShipmentStatus enum and
  add new input fields
- feat(pdf): implement barcode generation using picqer/php-barcode-generator
- feat(pdf): redesign AWB, Invoice, and Label templates for LTR/English
  support
- refactor(enum): simplify ShipmentStatus enum and update labels/colors
- chore(deps): add picqer/php-barcode-generator dependency
2026-08-23 22:31:58 +03:30
Kazem Alghasi
48c88e9bc7 refactor(shipment): update direction enums and shipment import logic
Refactor the shipment direction logic from 'outbound/inbound' to 'export/import' to align with the new database schema requirements. This includes updating the `ShippingRatesImport` logic, adjusting the Excel import sheet mappings, and removing the AED to IRR conversion during import as rates are now stored in AED.

Additionally, updated the shipment view action to open PDF documents in a new tab and updated the Phase 0 checklist with the new database schema requirements.

- docs: update Phase 0 checklist with new schema requirements
- refactor(ui): update shipment view actions to open in new tab
- refactor(import): update shipping rates import to use new direction enums and AED values
- docs: add file map and new excel document
2026-08-23 21:33:56 +03:30
Kazem Alghasi
11b524cf43 refactor: improve hero section responsiveness and update admin path
WordPress:
- Refactor hero section layout using CSS Grid for better responsiveness across desktop, tablet, and mobile devices.
- Improve spacing and alignment for hero buttons and trust badges.
- Fix admin bar offset issues in the hero section.
- Clean up redundant HTML tags in front-page template.

Laravel:
- Change Filament admin panel path from 'admin' to 'panel'.
- Clean up comments in web routes.
2026-08-12 11:58:46 +03:30
Kazem Alghasi
cd8021e6e1 docs: update project documentation and roadmap to reflect phase 2 and 3 completion
Update project documentation, status reports, and technical READMEs to
reflect the successful completion of Phase 2 (Financial Automation) and
Phase 3 (Customer Portal & WordPress Integration).

Changes include:
- Updated `STATUS.md` and `README.md` to mark Phases 2 and 3 as completed
- Updated `01_Documents/IFNEX_Phase0_Checklist.md` with detailed task
  completion status for Phases 1, 2, and 3
- Refined technical architecture documentation in `04_Laravel/README.md`
  to include new services (Zarinpal, OrderPayment), controllers (Auth,
  CustomerOrder), and Filament resources (Wallet, Payment, DiscountCode)
- Added `DEPLOYMENT.md` for deployment instructions
- Updated system specifications to include Laravel Sanctum, RBAC via
  spatie/laravel-permission, and the updated WordPress/IFNEX Bridge
  capabilities
2026-08-10 18:12:49 +03:30
Kazem Alghasi
aa8fb17230 feat: Complete customer ordering and payment system (Phases 1-4) 2026-08-10 13:08:52 +03:30
Kazem Alghasi
4ee1d27d44 feat: Complete customer ordering system (Phase 3)
Laravel Backend:
- Add AuthController for Sanctum token login/logout
- Add CustomerOrderController with 6 endpoints
  (profile, countries, orders CRUD, cancel)
- Extend ShipmentStatus enum with pending_payment/cancelled
- Add SampleShippingRatesSeeder (10 zones, 3 service types)
- Zone-assign 232 countries (Gulf=1, Asia=2, EU=3, East=4, US=5)
- Add migration to extend shipments.status enum
- Add test-api.php automated test suite (5 tests)

WordPress Frontend:
- Add [ifnex_order_form] multi-step wizard (4 steps)
- Add [ifnex_orders_list] with status filter & cancel action
- Add [ifnex_user_profile] with wallet & stats
- Add ifnex-orders.css (RTL-ready, IFNEX theme)
- Add ifnex-order-form.js (step navigation + AJAX)
- Add AJAX handlers (countries, calculate, submit, cancel)
- Fix plugin asset paths with dirname(__FILE__)
2026-08-10 06:09:56 +03:30
Kazem Alghasi
f61de6f3a5 refactor(ui): redesign admin dashboard widgets and exchange service
Refactor the Filament dashboard by replacing the legacy FinanceOverviewWidget
with a new set of specialized widgets:
- DashboardInfoWidget for general information
- ExchangeRateWidget for real-time rate monitoring
- WalletStats for financial overview

Additionally, refactor the ExchangeRateService to improve encapsulation
and clean up the ExchangeRateHistory model by moving business logic
(change calculation and recording) from the model to the service layer.

Changes include:
- Removing deprecated helper methods from ExchangeRateHistory model
- Implementing direct queries in ExchangeRateService to replace model scopes
- Adding support for rate chart data retrieval
- Reordering and updating widget sorting in AdminPanelProvider
2026-08-10 04:08:29 +03:30
Kazem Alghasi
ed5bae9997 feat(exchange): implement exchange rate history tracking
Introduce a mechanism to track and audit changes in exchange rates.
This includes:
- Creating `ExchangeRateHistory` model and migration to store rate changes.
- Implementing `ExchangeRateService` to encapsulate rate logic.
- Updating `UpdateExchangeRates` command to record history when rates change.
- Adding `ExchangeRateHistoryResource` to the Filament admin panel for monitoring.
2026-08-10 03:04:18 +03:30
Kazem Alghasi
a0bc871c8d feat(auth): implement role-based access control using spatie/laravel-permission
Integrate Spatie Laravel Permission to replace the legacy role system.
This includes:
- Adding `spatie/laravel-permission` dependency.
- Implementing `Role` and `User` model updates with `HasRoles` trait.
- Adding migrations for permission and role tables.
- Creating `RoleResource` and `UserResource` for Filament administration.
- Adding a `RoleAndPermissionSeeder` for initial setup.
- Updating `User` model helper methods to utilize role checks.
2026-08-10 02:44:23 +03:30
Kazem Alghasi
bc52e94dc3 feat(admin): enhance shipment and wallet transaction resources
- Refactor ShipmentResource to improve form schema formatting and structure
- Update WalletTransactionResource with improved navigation icons and Persian labels
- Implement dynamic transaction type options using enum cases
- Add dedicated Create and Edit pages for WalletTransactionResource to support full CRUD operations
2026-08-10 00:25:15 +03:30
Kazem Alghasi
810004aab1 feat(admin): configure filament panel with custom branding and notifications
Enhance the Filament admin panel configuration to align with the new design system and enable core features.

- Implement custom color palette including dark navy for sidebar
- Set Vazirmatn as the primary font
- Enable SPA mode and collapsible sidebar for improved UX
- Configure database-driven notifications and global search bindings
- Add necessary web middleware stack for session and cookie management
- Create new migration for the notifications system
- Add directory for custom Filament render hooks
2026-08-09 05:14:36 +03:30
Kazem Alghasi
8b0814230c feat(ui): implement unified design system and financial reporting
Introduce a comprehensive design system across WordPress and Laravel
to ensure visual consistency. Implement new financial reporting
capabilities and Excel export functionality within the Filament admin
panel.

- Add `DESIGN_SYSTEM.md` to define brand colors, typography, and spacing
- Implement `FinancialReport` page in Filament for transaction and
  shipment summaries
- Add Excel export support for `ShipmentResource` and
  `WalletTransactionResource` using Laravel Excel
- Refactor WordPress plugin and Filament CSS to utilize the new
  design system variables
- Update project status to reflect new reporting and design milestones
2026-08-08 06:13:09 +03:30
Kazem Alghasi
a699c2dbee feat(laravel): implement user synchronization and shipment schema
Add new core functionality and database structures to support WordPress
integration and shipment tracking.

- Add `SyncWordPressUsers` Artisan command to synchronize users between
  WordPress and Laravel.
- Create `shipment_items` table migration.
- Fix `discount_codes` enum type by changing `percent` to `percentage`.
- Add `SampleDataSeeder` for testing shipments, transactions, and
  discount codes.
- Update project status documentation.
2026-08-08 04:58:01 +03:30
Kazem Alghasi
0d04c89e91 refactor(admin): reorganize filament navigation and layout
Refactor the Filament admin panel structure by adjusting navigation sorting
across various resources to improve usability and logical grouping.

- Reorder navigation items in 'مالی' (Finance), 'تنظیمات' (Settings),
  and 'عملیات' (Operations) groups.
- Hide `PriceTestPage` from the main navigation sidebar.
- Adjust sidebar width and max content width in `AdminPanelProvider`.
- Add custom CSS asset for Filament styling.
2026-08-08 04:11:03 +03:30
Kazem Alghasi
e1c4385a9c feat(finance): implement Filament admin panel and expand wallet/discount features
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
2026-08-08 03:15:51 +03:30
Kazem Alghasi
2e7f975094 feat(wallet): complete online payment with Zarinpal + mock gateway
- 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
2026-08-08 00:46:54 +03:30
Kazem Alghasi
78f5919b69 feat(wallet): complete wallet system with admin adjust, freeze/unfreeze, activity logs
- Add Enums: TransactionType, TransactionStatus, PaymentGateway
- Migrations: wallets, wallet_transactions, wallet_activity_logs
- Models: Wallet, WalletTransaction, WalletActivityLog
- Services: WalletService with complete business logic
- Controllers: WalletController, PaymentController
- Filament Resources: WalletResource, WalletTransactionResource
- Artisan Command: ifnex:token for API token generation
- Sanctum integration with statefulApi and exception handling
- Full API endpoints: balance, transactions, admin-adjust, freeze/unfreeze
2026-08-07 22:51:42 +03:30
Kazem Alghasi
285acdae89 docs(project): update project status, roadmap, and documentation
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
2026-08-07 05:58:12 +03:30
Kazem Alghasi
abae820070 refactor(api): improve pricing logic and add test coverage
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`
2026-08-07 04:39:14 +03:30
Kazem Alghasi
1ea9486ca1 docs(imports): add documentation comments to ShippingRatesImport 2026-08-06 01:39:26 +03:30
Kazem Alghasi
50ae20b14a feat(api): implement payment gateway integration
Add Zarinpal configuration options and implement the core payment
infrastructure, including the Payment model, migration, service
layer, and API controller.
2026-08-05 23:49:33 +03:30
Kazem Alghasi
8d228993f9 refactor(api): expose wallet and discount endpoints and cleanup project
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
2026-08-05 22:46:31 +03:30
Kazem Alghasi
f5917c34c2 feat(logic): integrate discount code application and wallet services
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.
2026-08-05 19:16:09 +03:30
Kazem Alghasi
6aa18f76a8 feat(db): implement wallet and discount code systems
Add database migrations and Eloquent models to support user wallets,
transaction history, and discount code functionality. Includes a
one-to-one relationship between User and Wallet.
2026-08-05 17:35:58 +03:30
Kazem Alghasi
67754f3e08 refactor(ui): clean up middleware configuration in AdminPanelProvider
Remove unused Filament middleware components to simplify the panel provider configuration.
2026-08-05 16:57:25 +03:30
Kazem Alghasi
91ecbc7656 docs(project): update documentation and project status for phase 1
Update project documentation to reflect the completion of Phase 0 and
the current progress of Phase 1. This includes:

- Updating `STATUS.md` and `README.md` to mark Phase 0 as completed.
- Adding details for Phase 1 features: `PriceCalculatorService`, online
  order forms, and professional PDF generation.
- Documenting new API endpoints for price calculation and tracking.
- Updating the Laravel technical stack to include `dompdf` and
  `laravel-dompdf`.
- Detailing the new directory structure and public web routes.
2026-08-04 09:58:33 +03:30
Kazem Alghasi
31d28fbe68 docs(pdf): add technical mapping and implementation notes to templates
Add detailed documentation within AWB, Invoice, and Label PDF templates
to map HTML elements to specific Excel cell references and VLOOKUP
sources. This includes requirements for fonts, colors, and dimensions
to ensure future alignment with official IFNEX branding and Excel
templates.

Also update project status to reflect completed middleware configuration
tasks.
2026-08-04 09:50:53 +03:30
Kazem Alghasi
f330d13620 refactor(import): enhance shipping rates import and refine PDF layouts
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.
2026-08-04 09:47:22 +03:30
Kazem Alghasi
5874568c63 feat(shipment): implement PDF generation for AWB, invoice, and labels
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.
2026-08-04 09:20:23 +03:30
Kazem Alghasi
24fc56feaf feat(order): implement order creation flow and pricing API
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.
2026-08-04 07:59:23 +03:30
Kazem Alghasi
3aaa9a5481 refactor(api): improve shipping rate import and pricing logic
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.
2026-08-04 07:24:23 +03:30
Kazem Alghasi
f8557a0f20 feat(console): add tracking data import functionality and utility scripts
Implement a new Artisan command and Excel import logic to handle tracking data ingestion. This includes registering new commands in the application bootstrap and providing several utility scripts for debugging and testing the import process.

- Add `ImportTrackingData` command and `TrackingDataImport` class
- Register `ImportShippingRates` and `ImportTrackingData` in `app.php`
- Add `ifnex:import:tracking` closure command in `console.php`
- Include various debugging and testing scripts for Excel and shipment verification
2026-08-04 05:38:35 +03:30
Kazem Alghasi
1c3811b01f feat(ui): localize filament admin panel and refactor settings page
Refactor the IfnexSettingsPage to use a custom Blade view and implement manual property binding for system settings. Additionally, localize navigation labels and groups to Persian for the Filament admin interface.

- Implement `ifnex-settings.blade.php` for custom settings management
- Localize navigation labels for Countries, Shipment Items, Shipments, and Shipping Rates
- Update navigation groups to Persian (تنظیمات, عملیات)
- Refactor `IfnexSettingsPage` to load settings from `SystemSetting` model during `mount`
- Fix type hinting for `ShipmentDirection` enum in `ShipmentResource` table columns
2026-08-04 04:44:24 +03:30
Kazem Alghasi
f1eb6b179c docs(docs): update project documentation and roadmap
Update project documentation to reflect the transition to Laravel 11,
Filament 3.3, and the new 4-phase roadmap.

- Mark `PRD_v2.md` as deprecated and provide guidance on official
  sources (`Phase0_Proposal.docx`, `STATUS.md`).
- Update `Project_Roadmap.md` to reflect the current 4-phase structure
  and Phase 0 progress.
- Revise `04_Laravel/README.md` with detailed setup instructions,
  package lists, and directory structure.
- Update root `README.md` with versioning, technology stack details,
  and improved project structure overview.
2026-08-04 02:11:58 +03:30
Kazem Alghasi
a59e192b32 ۱۰ مورد کامل شد (دیتابیس، مدل‌ها، API، Filament، Laravel 11، رفع باگ‌ها)
🔄 در حال انجام: تست دستی Filament
⏸️ بلاک: مهاجرت ۳۹۵۰ رکورد (منتظر فایل اکسل اصلاح‌شده)
⏸️ بلاک: پلاگین وردپرس (بعد از تست کامل API)
2026-08-04 01:59:08 +03:30
Kazem Alghasi
4ce5fa8f96 some edites and readme texts 2026-08-02 04:50:17 +03:30
Kazem Alghasi
c95e992dbb feat: Complete Phase 1 core logic and WP bridge setup 2026-08-01 04:01:22 +03:30