feat(add-money): default Manteca deposit input to local currency#2511
Conversation
Users pay the bank transfer / QR in ARS or BRL, but the input opened USD-first (except Brazil), causing wrong-amount deposits. Match the withdraw flow: local currency first, USD one toggle away. Also map AmountInput's display symbol back to the ISO code before persisting ?currency= — Brazil was writing currency=R$, which the enum parser rejects, so the URL param never round-tripped.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughMantecaAddMoney now defaults denominations to the selected country’s currency, preserves explicit USD URL state, and writes ISO currency codes for UI denomination changes. Tests cover Argentina, Brazil, USD overrides, and URL synchronization. ChangesCurrency denomination synchronization
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code-analysis diffPainscore total: 6268.24 → 6268.39 (+0.15) 🆕 New findings (6)
✅ Resolved (6)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
The local-currency default was silently narrowed to Brazil-only once (3ab0668); this suite makes the next flip fail loudly, and covers the display-symbol → ISO-code mapping for the ?currency= param.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/AddMoney/components/__tests__/MantecaAddMoney.test.tsx`:
- Line 94: Remove the eslint-disable-next-line import/first directive from the
test file, leaving the surrounding jest.mock and import statements unchanged.
- Around line 21-30: Replace the four any usages in the mockQueryState,
mockSetQueryState, and related test mocks with narrow types matching the
query-state fields and InputAmountStep props used by MantecaAddMoney tests.
Update the nuqs mock and mock state declarations while preserving their current
behavior and ensuring the test satisfies the no-explicit-any lint rule.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 04e1381b-68f6-4070-85f1-ce95e93caad1
📒 Files selected for processing (2)
src/components/AddMoney/components/MantecaAddMoney.tsxsrc/components/AddMoney/components/__tests__/MantecaAddMoney.test.tsx
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Add-money via Manteca (Argentina / Brazil) opened the amount input USD-first (Brazil was special-cased to BRL on 2026-07-01, Argentina reverted to USD in the same commit). Users pay the bank transfer / QR in their local currency, so a USD-first input causes wrong-amount deposits — this matches the withdraw flow, which already defaults to local currency. USD stays one toggle away and an explicit
?currency=deep-link still wins.Also fixes a latent URL-state bug:
AmountInputreports the display symbol (R$) while the nuqs enum stores ISO codes, so Brazil wrote?currency=R$— silently rejected on parse, meaning the param never round-tripped. The handler now maps the symbol back to the country's ISO code before persisting.Risks / breaking changes
isUsdDenominatedin the deposit payload derives from the samecurrentDenomination, so API semantics are unchanged — just the default flips.Tests
New colocated suite
__tests__/MantecaAddMoney.test.tsxpins the behavior (this default was silently flipped once before — 3ab0668):?currency=USDdeep-link winsR$→BRL(valid enum value) andUSD→USDScreenshots
mainto match prod; its tsx + @zerodev/permissions resolution breaks the qa harness), so no authenticated add-money screen could be captured. Visual delta is a single default flip on an existing input: it opens showingARS/BRLinstead ofUSD. The new component tests assert the exact prop driving it.QA
/add-money/argentina/manteca→ input opens in ARS; toggle to USD →?currency=USD; toggle back →?currency=ARS(valid enum value, survives refresh)./add-money/brazil/manteca→ opens in BRL; toggling now writes?currency=BRLinstead ofcurrency=R$.?currency=USDstill forces USD-first.Summary by CodeRabbit