Skip to content

release: the country agreement check iterates the module, not a copied list - #237

Merged
mahmutkaya merged 1 commit into
mainfrom
develop
Sep 5, 2026
Merged

mahmutkaya merged 1 commit into
mainfrom
develop

Conversation

@mahmutkaya

Copy link
Copy Markdown
Contributor

Release — the country agreement check iterates the module, not a copied list

One commit (#236). Test + a one-line export. No behaviour change.

connectCountryForCurrency decides whether we may mint (currency -> country); CONNECT_ONBOARDABLE_COUNTRIES
decides whether the request boundary accepts that country. The agreement test between them existed, but it
iterated a literal ["CHF","GBP","USD","AED"] — a third hand-maintained copy of the same knowledge.

The silent failure it was blind to

Add a currency whose country the boundary refuses: the mint throws inside createExpressAccount,
mintForProposal catches it (by design — it must never throw, its caller chain ends at the Mollie webhook),
and the outcome is a restaurant that bought online payments and got a tenant without the module, plus a
note in a PR body nobody reads twice. No crash. No red test.

Measured, same mutant both sides

NOK: "NO" added to the map (NO is not onboardable; NOK is referenced nowhere else, so nothing catches it
incidentally):

test result
previous hardcoded loop 5 passed — blind
this PR's derived loop REDNOK resolves to NO, which the request boundary would refuse

Mutant verified landed (grep -F) and compiled (tsc 0) before either result was read, then reverted.

A first attempt used SEK, which the file already uses as its "unknown currency" example — it went red for an
unrelated reason and proved nothing. A red result only counts when it fails because of the property under test.

Also adds a positive control: if RESOLVABLE_CURRENCIES were emptied, every assertion in the loop would be
skipped and the file would still be green. That assertion is what dies then.

@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

@mahmutkaya
mahmutkaya merged commit 790c897 into main Sep 5, 2026
23 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