Skip to content

AdminCustomersPage: USD default + INR toggle for founder-friendly MRR display#46

Merged
mastermanas805 merged 1 commit into
mainfrom
feat/admin-currency-usd-default-fresh
May 13, 2026
Merged

AdminCustomersPage: USD default + INR toggle for founder-friendly MRR display#46
mastermanas805 merged 1 commit into
mainfrom
feat/admin-currency-usd-default-fresh

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • Founder convention for SaaS dashboards is USD; Track B (PR AdminCustomersPage: founder view of all teams + tier/promo actions #45) rendered MRR as INR because that's the wire format from Track A (paise). Make USD the default and add an INR toggle.
  • New src/lib/currency.ts with formatINR / formatUSD / formatMoney + resolveInrToUsd. Static rate INR_TO_USD = 0.012 (May 2026), overridable at build time via VITE_INR_TO_USD. Inline docs note this is directional signal only — daily-refreshed FX is a follow-up if accuracy ever matters.
  • AdminCustomersPage gains a [USD] [INR] toggle in the header, persists choice in localStorage (instant.admin.currency), defaults to USD, threads selection into CustomerDetailDrawer. Tooltip on the toggle documents the static rate.

Test plan

  • npm test — 376 passed / 3 pre-existing skips (34 in AdminCustomersPage.test.tsx, 11 new for Track H)
  • npm run build — clean TS + Vite bundle
  • Default render: USD with $ prefix on MRR cells + drawer
  • Click INR toggle: cells + drawer re-render with prefix
  • Reload page: choice persists via localStorage
  • resolveInrToUsd parser: positive numeric → that value; empty/null/NaN/zero/negative → static fallback
  • Visual smoke against live dashboard once deployed

Pushback

  • The VITE_INR_TO_USD env override is not asserted at the integration level — Vite statically inlines import.meta.env.VITE_* at transform time, so the module-load constant can't be re-driven from a runtime test. The parser (resolveInrToUsd) is asserted directly instead. If we ever need the override to be testable end-to-end, expose the resolver as a getActiveRate() getter that reads from a swappable source.
  • Static FX rate is a directional approximation. Acceptable for an internal founder console; not acceptable for any customer-facing pricing surface.

🤖 Generated with Claude Code

Track B (PR #45) shipped MRR formatted as INR because that's the wire
format Track A returns (paise). Founder convention for SaaS dashboards
is USD — switch the default and add an INR toggle for India context.

- New src/lib/currency.ts with formatINR / formatUSD / formatMoney +
  resolveInrToUsd. Static rate constant (INR_TO_USD = 0.012, May 2026),
  override via VITE_INR_TO_USD at build time. Inline comments note
  this is directional signal only; daily-refreshed FX is a follow-up.
- AdminCustomersPage gains a [USD] [INR] toggle in the header, persists
  the choice in localStorage (instant.admin.currency), defaults to USD,
  threads the chosen currency into CustomerDetailDrawer.
- Tooltip on the toggle documents the static rate ("1₹ = $0.012; for
  directional comparison only").
- 11 new tests (34 total in the file, 376 across the project, 0 fail):
  default render USD/$, toggle INR/₹, localStorage persists across
  unmount, drawer inherits choice, lib helpers + resolveInrToUsd parser
  rules. The override flow is asserted at the parser unit because Vite
  statically inlines import.meta.env.VITE_* at transform time and the
  module-load constant can't be re-driven from a test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit db65955 into main May 13, 2026
1 of 2 checks passed
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