Repository navigation
feat(pos): dynamic currency unit adapter for payment modal inputs and i18n fixes - #387
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Dynamic currency unit adapter for payment modal inputs
What Changed
getCurrencyUnitAdapterinmain/countries.tsanduseCurrencyUnitAdapterinfrontend/src/hooks/useCurrencyUnitAdapter.tsto seamlessly convert input amounts, step sizes, and loyalty wallet values between tenant display units (such as Toman and Toman Short) and canonical storage units (such as Rial) inPaymentModalandPrepaidCheckoutModal.ToastertoDirectionalToasterto align toast notifications with the active layout direction.Risk Assessment
✅ Low: The changes cleanly introduce a currency unit adapter for payment modal inputs and complete Persian i18n coverage without introducing regressions or security risks.
Testing
Targeted testing verified getCurrencyUnitAdapter scaling, step, decimal formatting, and label resolution for Iranian Toman, Toman Short (Latin and Persian digits), Rial, and standard international currencies. Visual rendering in Chromium produced 4 reviewer-visible PNG screenshots and rendered HTML artifacts showing the payment modal UI with correct currency input adornments, split payments, discount amounts, and loyalty wallet interactions. All 28 currency tests and payment adapter suites passed.
/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M09EG8J030YCK62W10XAD7D6/payment-modal-iran-toman.png)Evidence: Iranian Rial POS Payment Modal HTML (Toman Display)
/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M09EG8J030YCK62W10XAD7D6/payment-modal-iran-toman-short.png)Evidence: Iranian Rial POS Payment Modal HTML (Toman Short Display)
/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M09EG8J030YCK62W10XAD7D6/payment-modal-iran-rial.png)Evidence: Iranian Rial POS Payment Modal HTML (Rial Display)
/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M09EG8J030YCK62W10XAD7D6/payment-modal-usd.png)Evidence: US POS Payment Modal HTML (USD Display)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
tests/payment-modal-currency-adapter.test.ts- new test file written by agent: tests/payment-modal-currency-adapter.test.tsnpm run test:currencynpm run test:translationsnpm run test:rtl-dashboard-pos-commonts-node --transpile-only -P tests/tsconfig.json tests/payment-modal-currency-adapter.test.ts✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.