Skip to content

feat(pos): dynamic currency unit adapter for payment modal inputs and i18n fixes - #387

Merged
khaira777 merged 5 commits into
mainfrom
fix/persian-i18n-gaps
Aug 18, 2026
Merged

khaira777 merged 5 commits into
mainfrom
fix/persian-i18n-gaps

Conversation

@khaira777

@khaira777 khaira777 commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Dynamic currency unit adapter for payment modal inputs

What Changed

  • Dynamic currency unit adapter: Added getCurrencyUnitAdapter in main/countries.ts and useCurrencyUnitAdapter in frontend/src/hooks/useCurrencyUnitAdapter.ts to 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) in PaymentModal and PrepaidCheckoutModal.
  • UI string localization: Localized remaining hardcoded UI text across settings, products, orders, customers, image uploader, confirmation dialogs, and status bar uptime/server statuses in English, Spanish, Persian, and Portuguese translation dictionaries.
  • RTL toast positioning: Switched standalone KDS and Server layouts from Toaster to DirectionalToaster to 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.

  • Evidence: Iranian Rial POS Payment Modal with Toman Currency Unit Adapter (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M09EG8J030YCK62W10XAD7D6/payment-modal-iran-toman.png)
Evidence: Iranian Rial POS Payment Modal HTML (Toman Display)
<!DOCTYPE html>
<html lang="fa-IR" dir="rtl">
<head>
  <meta charset="utf-8">
  <title>پرداخت صورت‌حساب</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
  <style>
    body {
      font-family: 'Vazirmatn', sans-serif;
      background-color: #0f172a;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      margin: 0;
      padding: 24px;
      box-sizing: border-box;
    }
  </style>
</head>
<body>
  <div class="bg-white w-full max-w-md rounded-2xl shadow-2xl overflow-hidden border border-slate-200">
    <!-- Header -->
    <div class="flex items-center justify-between px-5 pt-5 pb-4 border-b border-gray-100">
      <div>
        <h2 class="text-lg font-bold text-gray-900">پرداخت صورت‌حساب</h2>
        <p class="text-xs text-gray-400 mt-0.5">صورت‌حساب #BILL-IR-0089</p>
      </div>
      <div class="w-8 h-8 flex items-center justify-center rounded-full bg-gray-100 text-gray-500 font-bold">✕</div>
    </div>

    <div class="px-5 py-4 space-y-4">
      <!-- Amount + Customer Card -->
      <div class="bg-gradient-to-br from-slate-800 to-slate-900 rounded-2xl px-5 py-4 text-white">
        <div class="flex items-start justify-between mb-3">
          <div>
            <p class="text-xs font-medium text-slate-400 uppercase tracking-widest">مبلغ قابل پرداخت</p>
            <p class="text-3xl font-bold mt-1 tracking-tight text-white">۵۰۰٬۰۰۰ تومان</p>
          </div>
          <div class="text-end ms-4 shrink-0">
            <div class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center mb-1 ms-auto text-xs">👤</div>
            <p class="text-sm font-semibold text-white leading-tight">رضا حسینی</p>
          </div>
        </div>

        <div class="border-t border-white/10 pt-3 space-y-1.5 text-xs">
          <div class="flex justify-between text-slate-300">
            <span>جمع کل</span>
            <span>۵۰۰٬۰۰۰ تومان</span>
          </div>
          
          <div class="flex justify-between text-white font-semibold border-t border-white/10 pt-1.5 mt-1">
            <span>مجموع</span>
            <span>۵۰۰٬۰۰۰ تومان</span>
          </div>
        </div>
      </div>

      <!-- Payment Methods Inputs -->
      <div class="space-y-2">
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-blue-600 text-white border-blue-600">
            <span>💵</span>
            <span class="truncate">نقدی</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">تومان</span>
            <input
              type="number"
              value="۲۰۰۰۰۰"
              placeholder="0.00"
              step="0.001"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-blue-600 text-white border-blue-600">
            <span>💳</span>
            <span class="truncate">کارت‌خوان</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">تومان</span>
            <input
              type="number"
              value="۳۰۰۰۰۰"
              placeholder="0.00"
              step="0.001"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-gray-50 text-gray-700 border-gray-200">
            <span>📱</span>
            <span class="truncate">آنلاین</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">تومان</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.001"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
      </div>

      <!-- Change Returned -->
      

      <!-- Loyalty Wallet -->
      
      <div class="space-y-1">
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold bg-purple-50 text-purple-800 border-purple-200">
            <span>🎁</span><span class="truncate">کیف پول باشگاه</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-purple-200 rounded-e-xl bg-white">
            <span class="ps-3 text-gray-500 font-medium text-xs">تومان</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.001"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        <p class="px-1 text-[11px] text-gray-400 text-end">موجودی: ۲۰٬۰۰۰ امتیاز (ارزش تقریبی: ۲٬۰۰۰ تومان)</p>
      </div>
    </div>

    <!-- Footer Button -->
    <div class="px-5 pb-5 border-t border-gray-100 pt-3">
      <button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-xl text-sm transition-colors shadow-sm">
        پرداخت ۵۰۰٬۰۰۰ تومان
      </button>
    </div>
  </div>
</body>
</html>
- Evidence: Iranian Rial POS Payment Modal with Toman Short Latin Adapter (local file: /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)
<!DOCTYPE html>
<html lang="fa-IR" dir="rtl">
<head>
  <meta charset="utf-8">
  <title>پرداخت صورت‌حساب (Toman Short)</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
  <style>
    body {
      font-family: 'Vazirmatn', sans-serif;
      background-color: #0f172a;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      margin: 0;
      padding: 24px;
      box-sizing: border-box;
    }
  </style>
</head>
<body>
  <div class="bg-white w-full max-w-md rounded-2xl shadow-2xl overflow-hidden border border-slate-200">
    <!-- Header -->
    <div class="flex items-center justify-between px-5 pt-5 pb-4 border-b border-gray-100">
      <div>
        <h2 class="text-lg font-bold text-gray-900">پرداخت صورت‌حساب (Toman Short)</h2>
        <p class="text-xs text-gray-400 mt-0.5">صورت‌حساب #BILL-IR-0089</p>
      </div>
      <div class="w-8 h-8 flex items-center justify-center rounded-full bg-gray-100 text-gray-500 font-bold">✕</div>
    </div>

    <div class="px-5 py-4 space-y-4">
      <!-- Amount + Customer Card -->
      <div class="bg-gradient-to-br from-slate-800 to-slate-900 rounded-2xl px-5 py-4 text-white">
        <div class="flex items-start justify-between mb-3">
          <div>
            <p class="text-xs font-medium text-slate-400 uppercase tracking-widest">مبلغ قابل پرداخت</p>
            <p class="text-3xl font-bold mt-1 tracking-tight text-white">500,000T</p>
          </div>
          <div class="text-end ms-4 shrink-0">
            <div class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center mb-1 ms-auto text-xs">👤</div>
            <p class="text-sm font-semibold text-white leading-tight">رضا حسینی</p>
          </div>
        </div>

        <div class="border-t border-white/10 pt-3 space-y-1.5 text-xs">
          <div class="flex justify-between text-slate-300">
            <span>جمع کل</span>
            <span>500,000T</span>
          </div>
          
          <div class="flex justify-between text-white font-semibold border-t border-white/10 pt-1.5 mt-1">
            <span>مجموع</span>
            <span>500,000T</span>
          </div>
        </div>
      </div>

      <!-- Payment Methods Inputs -->
      <div class="space-y-2">
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-blue-600 text-white border-blue-600">
            <span>💵</span>
            <span class="truncate">نقدی</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">T</span>
            <input
              type="number"
              value="500000"
              placeholder="0.00"
              step="0.001"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-gray-50 text-gray-700 border-gray-200">
            <span>💳</span>
            <span class="truncate">کارت‌خوان</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">T</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.001"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-gray-50 text-gray-700 border-gray-200">
            <span>📱</span>
            <span class="truncate">آنلاین</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">T</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.001"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
      </div>

      <!-- Change Returned -->
      

      <!-- Loyalty Wallet -->
      
      <div class="space-y-1">
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold bg-purple-50 text-purple-800 border-purple-200">
            <span>🎁</span><span class="truncate">کیف پول باشگاه</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-purple-200 rounded-e-xl bg-white">
            <span class="ps-3 text-gray-500 font-medium text-xs">T</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.001"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        <p class="px-1 text-[11px] text-gray-400 text-end">موجودی: 20,000 امتیاز (ارزش تقریبی: 2,000T)</p>
      </div>
    </div>

    <!-- Footer Button -->
    <div class="px-5 pb-5 border-t border-gray-100 pt-3">
      <button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-xl text-sm transition-colors shadow-sm">
        پرداخت 500,000T
      </button>
    </div>
  </div>
</body>
</html>
- Evidence: Iranian Rial POS Payment Modal with Rial Adapter (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M09EG8J030YCK62W10XAD7D6/payment-modal-iran-rial.png)
Evidence: Iranian Rial POS Payment Modal HTML (Rial Display)
<!DOCTYPE html>
<html lang="fa-IR" dir="rtl">
<head>
  <meta charset="utf-8">
  <title>پرداخت صورت‌حساب (Rial)</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
  <style>
    body {
      font-family: 'Vazirmatn', sans-serif;
      background-color: #0f172a;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      margin: 0;
      padding: 24px;
      box-sizing: border-box;
    }
  </style>
</head>
<body>
  <div class="bg-white w-full max-w-md rounded-2xl shadow-2xl overflow-hidden border border-slate-200">
    <!-- Header -->
    <div class="flex items-center justify-between px-5 pt-5 pb-4 border-b border-gray-100">
      <div>
        <h2 class="text-lg font-bold text-gray-900">پرداخت صورت‌حساب (Rial)</h2>
        <p class="text-xs text-gray-400 mt-0.5">صورت‌حساب #BILL-IR-0089</p>
      </div>
      <div class="w-8 h-8 flex items-center justify-center rounded-full bg-gray-100 text-gray-500 font-bold">✕</div>
    </div>

    <div class="px-5 py-4 space-y-4">
      <!-- Amount + Customer Card -->
      <div class="bg-gradient-to-br from-slate-800 to-slate-900 rounded-2xl px-5 py-4 text-white">
        <div class="flex items-start justify-between mb-3">
          <div>
            <p class="text-xs font-medium text-slate-400 uppercase tracking-widest">مبلغ قابل پرداخت</p>
            <p class="text-3xl font-bold mt-1 tracking-tight text-white">۵٬۰۰۰٬۰۰۰ ریال</p>
          </div>
          <div class="text-end ms-4 shrink-0">
            <div class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center mb-1 ms-auto text-xs">👤</div>
            <p class="text-sm font-semibold text-white leading-tight">رضا حسینی</p>
          </div>
        </div>

        <div class="border-t border-white/10 pt-3 space-y-1.5 text-xs">
          <div class="flex justify-between text-slate-300">
            <span>جمع کل</span>
            <span>۵٬۰۰۰٬۰۰۰ ریال</span>
          </div>
          
          <div class="flex justify-between text-white font-semibold border-t border-white/10 pt-1.5 mt-1">
            <span>مجموع</span>
            <span>۵٬۰۰۰٬۰۰۰ ریال</span>
          </div>
        </div>
      </div>

      <!-- Payment Methods Inputs -->
      <div class="space-y-2">
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-blue-600 text-white border-blue-600">
            <span>💵</span>
            <span class="truncate">نقدی</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">IRR</span>
            <input
              type="number"
              value="۵۰۰۰۰۰۰"
              placeholder="0.00"
              step="0.01"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-gray-50 text-gray-700 border-gray-200">
            <span>💳</span>
            <span class="truncate">کارت‌خوان</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">IRR</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.01"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-gray-50 text-gray-700 border-gray-200">
            <span>📱</span>
            <span class="truncate">آنلاین</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">IRR</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.01"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
      </div>

      <!-- Change Returned -->
      

      <!-- Loyalty Wallet -->
      
      <div class="space-y-1">
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold bg-purple-50 text-purple-800 border-purple-200">
            <span>🎁</span><span class="truncate">کیف پول باشگاه</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-purple-200 rounded-e-xl bg-white">
            <span class="ps-3 text-gray-500 font-medium text-xs">IRR</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.01"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        <p class="px-1 text-[11px] text-gray-400 text-end">موجودی: ۲۰٬۰۰۰ امتیاز (ارزش تقریبی: ۲۰٬۰۰۰ ریال)</p>
      </div>
    </div>

    <!-- Footer Button -->
    <div class="px-5 pb-5 border-t border-gray-100 pt-3">
      <button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-xl text-sm transition-colors shadow-sm">
        پرداخت ۵٬۰۰۰٬۰۰۰ ریال
      </button>
    </div>
  </div>
</body>
</html>
- Evidence: US POS Payment Modal (USD Display) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M09EG8J030YCK62W10XAD7D6/payment-modal-usd.png)
Evidence: US POS Payment Modal HTML (USD Display)
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
  <meta charset="utf-8">
  <title>Payment</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
  <style>
    body {
      font-family: 'Inter', sans-serif;
      background-color: #0f172a;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      margin: 0;
      padding: 24px;
      box-sizing: border-box;
    }
  </style>
</head>
<body>
  <div class="bg-white w-full max-w-md rounded-2xl shadow-2xl overflow-hidden border border-slate-200">
    <!-- Header -->
    <div class="flex items-center justify-between px-5 pt-5 pb-4 border-b border-gray-100">
      <div>
        <h2 class="text-lg font-bold text-gray-900">Payment</h2>
        <p class="text-xs text-gray-400 mt-0.5">Bill #BILL-US-0012</p>
      </div>
      <div class="w-8 h-8 flex items-center justify-center rounded-full bg-gray-100 text-gray-500 font-bold">✕</div>
    </div>

    <div class="px-5 py-4 space-y-4">
      <!-- Amount + Customer Card -->
      <div class="bg-gradient-to-br from-slate-800 to-slate-900 rounded-2xl px-5 py-4 text-white">
        <div class="flex items-start justify-between mb-3">
          <div>
            <p class="text-xs font-medium text-slate-400 uppercase tracking-widest">TOTAL DUE</p>
            <p class="text-3xl font-bold mt-1 tracking-tight text-white">$45.50</p>
          </div>
          <div class="text-end ms-4 shrink-0">
            <div class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center mb-1 ms-auto text-xs">👤</div>
            <p class="text-sm font-semibold text-white leading-tight">Customer</p>
          </div>
        </div>

        <div class="border-t border-white/10 pt-3 space-y-1.5 text-xs">
          <div class="flex justify-between text-slate-300">
            <span>Subtotal</span>
            <span>$45.50</span>
          </div>
          
          <div class="flex justify-between text-white font-semibold border-t border-white/10 pt-1.5 mt-1">
            <span>Total</span>
            <span>$45.50</span>
          </div>
        </div>
      </div>

      <!-- Payment Methods Inputs -->
      <div class="space-y-2">
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-blue-600 text-white border-blue-600">
            <span>💵</span>
            <span class="truncate">Cash</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">USD</span>
            <input
              type="number"
              value="20.00"
              placeholder="0.00"
              step="0.01"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-blue-600 text-white border-blue-600">
            <span>💳</span>
            <span class="truncate">Card</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">USD</span>
            <input
              type="number"
              value="25.50"
              placeholder="0.00"
              step="0.01"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold transition-colors bg-gray-50 text-gray-700 border-gray-200">
            <span>📱</span>
            <span class="truncate">UPI / Online</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-gray-200 rounded-e-xl bg-white focus-within:ring-2 focus-within:ring-blue-500">
            <span class="ps-3 text-gray-500 font-medium text-xs">USD</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.01"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        
      </div>

      <!-- Change Returned -->
      

      <!-- Loyalty Wallet -->
      
      <div class="space-y-1">
        <div class="flex h-11">
          <button type="button" class="w-36 shrink-0 rounded-s-xl border px-3 flex items-center gap-2 text-sm font-semibold bg-purple-50 text-purple-800 border-purple-200">
            <span>🎁</span><span class="truncate">Loyalty Wallet</span>
          </button>
          <div class="flex flex-1 items-center border border-s-0 border-purple-200 rounded-e-xl bg-white">
            <span class="ps-3 text-gray-500 font-medium text-xs">USD</span>
            <input
              type="number"
              value=""
              placeholder="0.00"
              step="0.01"
              class="min-w-0 flex-1 px-2 py-2 text-end text-sm font-semibold outline-none rounded-e-xl bg-transparent"
              readonly
            />
          </div>
        </div>
        <p class="px-1 text-[11px] text-gray-400 text-end">Balance: 1,500 pts (~$15.00)</p>
      </div>
    </div>

    <!-- Footer Button -->
    <div class="px-5 pb-5 border-t border-gray-100 pt-3">
      <button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-xl text-sm transition-colors shadow-sm">
        Pay $45.50
      </button>
    </div>
  </div>
</body>
</html>
- Outcome: ⚠️ 1 info across 1 run (22m20s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 info
  • ℹ️ tests/payment-modal-currency-adapter.test.ts - new test file written by agent: tests/payment-modal-currency-adapter.test.ts
  • npm run test:currency
  • npm run test:translations
  • npm run test:rtl-dashboard-pos-common
  • ts-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.

@khaira777
khaira777 requested a review from itsbkm as a code owner August 18, 2026 02:52
@khaira777 khaira777 changed the title fix(i18n): localize hardcoded UI surfaces and Persian translation gaps feat(pos): dynamic currency unit adapter for payment modal inputs and i18n fixes Aug 18, 2026
@khaira777
khaira777 merged commit 8fd9082 into main Aug 18, 2026
12 checks passed
@khaira777
khaira777 deleted the fix/persian-i18n-gaps branch August 18, 2026 04:11
@khaira777 khaira777 self-assigned this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant