Commit Graph

5 Commits

Author SHA1 Message Date
Kazem Alghasi
848f95f32e refactor(currency): enforce IRR-only across all UIs and storage 2026-10-29 22:31:26 +03:30
Kazem Alghasi
477418b349 fix(rate-import): enlarge rate column + correct AED fallback rate
Two issues caused the rate import to fail with 1237 'Out of range
value for column rate' errors:

1. The rate column was decimal(12,4) — max ~100 million. Converted
   IRR values for larger shipments exceed this. Migrate to
   decimal(20,4) which handles up to ~100 trillion.

2. The fallback AED→IRR rate in config/ifnex.php was 455,000 (way
   too high — should be ~14,000). Update to a realistic market rate.

Also improve the CurrencyResource helperText to remind users to
enter rates in Rials (not Tomans) and provide realistic examples
for AED, USD, and EUR.
2026-10-29 19:09:35 +03:30
Kazem Alghasi
4fac1dae01 refactor(currency): simplify exchange rate logic to use Rial as base
Refactor the currency management system to eliminate the redundant
`rate_to_aed` field and transition to a single-base model where all
rates are stored relative to the Iranian Rial (IRR).

Key changes:
- Removed `rate_to_aed` from `currencies` table via new migration.
- Updated `ExchangeRateService` to handle rates using a single
  `currency_code` parameter instead of currency pairs.
- Refactored `UpdateExchangeRates` command to fetch rates from the
  Exir.io API and support multiple currencies (AED, USD, EUR, CNY).
- Updated Filament resources (`CurrencyResource`,
  `ExchangeRateHistoryResource`) and widgets to reflect the new
  single-base architecture.
- Improved `PriceCalculatorService` to use the updated service
  methodology for fetching the AED/IRR conversion rate.
- Localized console command output to Persian.
2026-10-29 03:54:02 +03:30
Kazem Alghasi
78036245ad feat(ui): reorganize filament nav, shipment table density, 6 relation managers 2026-09-30 02:54:08 +03:30
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