Skip to content

[TASK-16456] chore: disable bolivia#1381

Merged
Hugo0 merged 1 commit intopeanut-walletfrom
chore/disable-bolivia
Oct 30, 2025
Merged

[TASK-16456] chore: disable bolivia#1381
Hugo0 merged 1 commit intopeanut-walletfrom
chore/disable-bolivia

Conversation

@jjramirezn
Copy link
Contributor

No description provided.

@jjramirezn jjramirezn requested a review from Hugo0 October 30, 2025 19:53
@vercel
Copy link

vercel bot commented Oct 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
peanut-wallet Ready Ready Preview Comment Oct 30, 2025 7:58pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Walkthrough

Modified country code mappings in AddMoney constants by removing Bolivia (BOL/BO) from MANTECA configurations and enabled bank transfer sets. Added runtime logic to centralize country enablement checks and construct per-country withdrawal and add-money methods with conditional SEPA injection and dynamic Manteca routing.

Changes

Cohort / File(s) Summary
Country Code Mappings and Enablement
src/components/AddMoney/consts/index.ts
Removed Bolivia (BOL: 'BO') mapping from MANTECA_ALPHA3_TO_ALPHA2; updated enabledBankWithdrawCountries to exclude 'BO'; modified ALL_COUNTRIES_ALPHA3_TO_ALPHA2 to reflect the change
Runtime Country Enablement Logic
src/components/AddMoney/consts/index.ts
Added isCountryEnabledForBankTransfer(countryCode, direction) function to determine country eligibility for withdraw/deposit operations; supports both 2-letter and 3-letter country codes
Per-Country Method Construction
src/components/AddMoney/consts/index.ts
Introduced logic to build per-country withdrawal and add-money methods; conditionally injects SEPA Instant for EUR countries, defaults for bank withdrawals, and routes between Manteca and bank flows based on country support; filters LATAM methods (Mercado Pago for AR, Pix for BR)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Multi-layered conditional logic for per-country method composition across withdraw and add-money flows requires careful verification
  • Dynamic SEPA injection and Manteca routing logic branches need tracing to ensure correctness for edge cases
  • Country code mapping removal (Bolivia) and its cascading effects through dependent sets and logic paths should be validated for completeness
  • Error handling around missing country code mappings and method duplication checks warrants scrutiny

Possibly related PRs

Suggested reviewers

  • Zishan-7
  • kushagrasarathe
  • Hugo0

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request contains no description provided by the author. While the title check passes with clarity, the description check requires that the description be related in some way to the changeset. An empty description fails to describe any part of the changeset, even though the lenient criteria do not require extensive detail. This represents a missed opportunity to document the rationale or context for disabling Bolivia support.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "[TASK-16456] chore: disable bolivia" directly relates to the primary change in the changeset. The main modification removes the Bolivia mapping (BOL: 'BO') from MANTECA_ALPHA3_TO_ALPHA2 and removes 'BO' from the enabledBankWithdrawCountries set, effectively disabling Bolivia for bank transfer operations. The title is concise, specific, and clearly communicates the core intent of the change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/disable-bolivia

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ab145c and 6dfb2fe.

📒 Files selected for processing (1)
  • src/components/AddMoney/consts/index.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/utils/withdraw.utils.ts:181-191
Timestamp: 2025-08-14T14:42:54.411Z
Learning: The countryCodeMap in src/components/AddMoney/consts/index.ts uses uppercase 3-letter country codes as keys (like 'AUT', 'BEL', 'CZE') that map to 2-letter country codes, requiring input normalization to uppercase for proper lookups.
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1173
File: src/components/Common/SavedAccountsView.tsx:86-87
Timestamp: 2025-09-03T12:23:31.845Z
Learning: In the ALL_METHODS_DATA structure from src/components/AddMoney/consts, the path field is required (not optional) for all country entries.
Learnt from: kushagrasarathe
PR: peanutprotocol/peanut-ui#869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".
Learnt from: kushagrasarathe
PR: peanutprotocol/peanut-ui#869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".
📚 Learning: 2025-08-14T14:42:54.411Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/utils/withdraw.utils.ts:181-191
Timestamp: 2025-08-14T14:42:54.411Z
Learning: The countryCodeMap in src/components/AddMoney/consts/index.ts uses uppercase 3-letter country codes as keys (like 'AUT', 'BEL', 'CZE') that map to 2-letter country codes, requiring input normalization to uppercase for proper lookups.

Applied to files:

  • src/components/AddMoney/consts/index.ts
📚 Learning: 2025-05-22T15:38:48.586Z
Learnt from: kushagrasarathe
PR: peanutprotocol/peanut-ui#869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Applied to files:

  • src/components/AddMoney/consts/index.ts
📚 Learning: 2025-09-03T12:23:31.845Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1173
File: src/components/Common/SavedAccountsView.tsx:86-87
Timestamp: 2025-09-03T12:23:31.845Z
Learning: In the ALL_METHODS_DATA structure from src/components/AddMoney/consts, the path field is required (not optional) for all country entries.

Applied to files:

  • src/components/AddMoney/consts/index.ts
📚 Learning: 2025-08-14T14:36:18.758Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/components/Claim/Link/views/BankFlowManager.view.tsx:0-0
Timestamp: 2025-08-14T14:36:18.758Z
Learning: Bridge API requires ISO3 country codes (3-letter codes like "USA", "GBR") while flag display components need ISO2 codes (2-letter codes like "US", "GB").

Applied to files:

  • src/components/AddMoney/consts/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Deploy-Preview

Comment @coderabbitai help to get the list of available commands and usage tips.

@jjramirezn jjramirezn changed the title chore: disable bolivia [TASK-16456] chore: disable bolivia Oct 30, 2025
@notion-workspace
Copy link

@Hugo0 Hugo0 merged commit b6877f4 into peanut-wallet Oct 30, 2025
5 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.

2 participants