Skip to content

feat(country): enable Philippines organization onboarding - #4304

Open
joshuakrueger-dfx wants to merge 3 commits into
developfrom
feat/enable-philippines-organization-onboarding
Open

feat(country): enable Philippines organization onboarding#4304
joshuakrueger-dfx wants to merge 3 commits into
developfrom
feat/enable-philippines-organization-onboarding

Conversation

@joshuakrueger-dfx

Copy link
Copy Markdown
Collaborator

What

Enable organization (business) DFX onboarding for the Philippines by setting country.dfxOrganizationEnable = true for symbol = 'PH' via a data-only migration. This complements #4206, which enabled only individual onboarding (dfxEnable = true).

Why

After #4206, a customer onboarding a company/organization account still could not select the Philippines:

  • country-dto.mapper.ts exposes kycOrganizationAllowed = dfxOrganizationEnable; the app filters the business address list on that flag, so PH was hidden.
  • The business KYC country gate rejects PH: kyc.service.ts business branch → if (!userCountry.dfxOrganizationEnable) COUNTRY_NOT_ALLOWED.

Both gates key off dfxOrganizationEnable, so flipping it fixes selection and the KYC gate together.

Scope — verified end-to-end

The only organization-specific gate is kyc.service.ts:1790. Every other country gate (country list, quote gate, org-country validation in user-data.service.ts) keys off dfxEnable, which PH already has from #4206 — so this single flag makes PH usable for business accounts end-to-end. The migration touches only dfxOrganizationEnable (+ updated); dfxEnable, manualReviewRequiredOrganization, FATF and all unrelated controls stay untouched.

Review posture — consistent with #4206 (intentional)

manualReviewRequiredOrganization is deliberately not set. A clean PH business ident therefore auto-approves, exactly like the individual enablement in #4206. This keeps individual and organization onboarding consistent. If compliance later wants forced human review for PH business KYC, that is a separate one-line follow-up migration (SET manualReviewRequiredOrganization = true WHERE symbol = 'PH').

Safety / auditability

  • Fail-closed: the migration asserts the PH row exists and throws otherwise — it can never report success while silently leaving organization onboarding disabled.
  • Idempotent: the UPDATE is guarded on dfxOrganizationEnable = false, so a re-run or already-enabled row is a no-op and does not bump updated.
  • One-way down(): intentionally empty — a country allow-list change is compliance data; rolling back a deployment must not silently re-block the country.

Testing

enable-philippines-organization-onboarding.migration.spec.ts runs the real migration SQL against in-memory Postgres (pg-mem, prod dialect): selective enable + idempotency, no-rewrite when already enabled, fail-loud when the PH row is missing, and down() not reintroducing the restriction. All green.

Before deploy — compliance verification (out of code)

  • Confirm PH in production is currently dfxOrganizationEnable = false (seed has it false; migration only mutates a persisted prod row that is still false).
  • Confirm the auto-approval posture for PH business KYC (no forced manual review) is acceptable — accepted here for consistency with feat(country): enable Philippines onboarding #4206; flag if business KYC of a freshly FATF-cleared jurisdiction should instead require human review.

@joshuakrueger-dfx
joshuakrueger-dfx marked this pull request as ready for review July 22, 2026 10:20
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