Skip to content

✨ app: add kyc review and failure states - #1291

Merged
cruzdanilo merged 11 commits into
mainfrom
kyc
Sep 10, 2026
Merged

cruzdanilo merged 11 commits into
mainfrom
kyc

Conversation

@franm91

@franm91 franm91 commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added clearer identity-verification states, including pending review and failed verification.
    • Updated onboarding with ordered steps, status labels, descriptions, and relevant actions.
    • Added document-review messaging and customizable informational-alert icons.
  • Bug Fixes
    • Improved routing when verification is under review, blocked, or unsuccessful.
    • Verification flows now refresh status and complete navigation more reliably.
  • Localization
    • Added Spanish and Portuguese translations for new onboarding and verification messages.

@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9348774

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/mobile Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The mobile app centralizes KYC status handling through useKYC, adds review and failure states to onboarding, routes blocked verification results to getting started, and adds related alerts, translations, and Maestro validation.

Changes

KYC review and failure flow

Layer / File(s) Summary
KYC status normalization and mutation results
src/utils/server.ts, src/utils/useKYC.ts, src/utils/persona.ts
KYC responses expose recognized status codes through shared fallback handling. useKYC maps them to structured states. Mutations return a blocked result when required.
Onboarding status model and screens
src/utils/useOnboardingSteps.ts, src/components/getting-started/*, src/components/home/GettingStarted.tsx, src/components/home/Home.tsx
Onboarding steps use pending, review, failed, and completed statuses. Screens render dynamic content, tags, icons, actions, and current-step routing.
Funding, card, swaps, and alerts
src/components/add-funds/AddFunds.tsx, src/components/card/Card.tsx, src/components/send-funds/SendFunds.tsx, src/components/swaps/Swaps.tsx, src/components/shared/*
Funding and verification flows use shared KYC flags. Review and blocked states route to getting started. Card and alert rendering accounts for KYC review.
Translations, release metadata, and validation
src/i18n/es.json, src/i18n/es-AR.json, src/i18n/pt.json, .changeset/six-peas-beg.md, .maestro/*
Spanish and Portuguese locales add KYC status and document-review strings. The mobile package receives a patch changeset. The local Maestro flow checks onboarding, card activation, and Swaps states.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: 🟡 Moderate · up to a0ef4

This change adds KYC review and failure experiences, but users may still be routed to inappropriate onboarding actions after verification, and the new states are not reliably covered by the local flow. Resolve the outstanding routing and validation issues before merging.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AddFunds
  participant useKYC
  participant getKYCStatus
  participant startKYC
  participant GettingStarted
  User->>AddFunds: Start bank transfer
  AddFunds->>useKYC: Read KYC state
  useKYC->>getKYCStatus: Fetch status
  getKYCStatus-->>useKYC: Return status code
  AddFunds->>startKYC: Begin verification when required
  startKYC-->>AddFunds: Return complete or blocked
  AddFunds->>GettingStarted: Redirect for review or blocked state
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding KYC review and failure states across the app.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kyc
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch kyc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4bcac7d71b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .changeset/six-peas-beg.md Outdated
Comment thread src/utils/useKYC.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utils/persona.ts (1)

281-281: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Classify the post-inquiry status before returning complete.

When the refetch returns "processing" or "bad kyc", this returns "complete". src/components/add-funds/AddFunds.tsx routes that non-approved complete result to home instead of getting started. Apply the same blocked classification used before startKYC() to kyc.

Proposed fix
       const kyc = await queryClient.fetchQuery<KYCStatus>({ queryKey: ["kyc", "status"], staleTime: 0 });
+      const code = "code" in kyc ? kyc.code : undefined;
+      if (code !== "ok" && code !== "legacy kyc" && code !== "not started" && code !== "no kyc") {
+        return { status: "blocked", kyc };
+      }
       return { status: "complete", kyc };

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 1ceb862d-9310-47bd-92fd-8108dfc227d4

📥 Commits

Reviewing files that changed from the base of the PR and between f4fc241 and 4bcac7d.

📒 Files selected for processing (18)
  • .changeset/six-peas-beg.md
  • src/components/add-funds/AddFunds.tsx
  • src/components/card/Card.tsx
  • src/components/getting-started/GettingStarted.tsx
  • src/components/getting-started/Step.tsx
  • src/components/home/GettingStarted.tsx
  • src/components/home/Home.tsx
  • src/components/send-funds/SendFunds.tsx
  • src/components/shared/FundingAlert.tsx
  • src/components/shared/InfoAlert.tsx
  • src/components/swaps/Swaps.tsx
  • src/i18n/es-AR.json
  • src/i18n/es.json
  • src/i18n/pt.json
  • src/utils/persona.ts
  • src/utils/server.ts
  • src/utils/useKYC.ts
  • src/utils/useOnboardingSteps.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread src/components/swaps/Swaps.tsx
Comment thread src/utils/useOnboardingSteps.ts Outdated
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.53846% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.98%. Comparing base (7acdfff) to head (9348774).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/components/getting-started/GettingStarted.tsx 52.94% 16 Missing ⚠️
src/components/card/Card.tsx 53.57% 13 Missing ⚠️
src/utils/persona.ts 0.00% 6 Missing ⚠️
src/components/home/GettingStarted.tsx 42.85% 4 Missing ⚠️
src/components/getting-started/Step.tsx 57.14% 3 Missing ⚠️
src/components/send-funds/SendFunds.tsx 25.00% 3 Missing ⚠️
src/components/swaps/Swaps.tsx 62.50% 3 Missing ⚠️
src/utils/useKYC.ts 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1291      +/-   ##
==========================================
+ Coverage   73.40%   74.98%   +1.58%     
==========================================
  Files         276      279       +3     
  Lines       13463    13550      +87     
  Branches     4711     4758      +47     
==========================================
+ Hits         9883    10161     +278     
+ Misses       3241     3050     -191     
  Partials      339      339              
Flag Coverage Δ
e2e 74.98% <61.53%> (+1.58%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utils/persona.ts (1)

274-281: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Classify the post-inquiry KYC status before returning success. After startKYC() resolves, the mutation fetches the status but always returns status: "complete". When the API returns processing or bad kyc, GettingStarted.tsx and Swaps.tsx route the user home instead of to blocked onboarding. Return blocked unless the fetched code is ok or legacy kyc.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 5be8df4f-194e-4a8b-9579-7da075bbcca4

📥 Commits

Reviewing files that changed from the base of the PR and between 4bcac7d and c6d8ec3.

📒 Files selected for processing (10)
  • .changeset/six-peas-beg.md
  • src/components/card/Card.tsx
  • src/components/getting-started/GettingStarted.tsx
  • src/components/home/GettingStarted.tsx
  • src/components/swaps/Swaps.tsx
  • src/i18n/es.json
  • src/i18n/pt.json
  • src/utils/server.ts
  • src/utils/useKYC.ts
  • src/utils/useOnboardingSteps.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread src/components/getting-started/GettingStarted.tsx
Comment thread src/utils/useKYC.ts Outdated
Comment thread src/utils/useKYC.ts Outdated
@franm91 franm91 changed the title ✨ app: kyc review and failure states ✨ app: add kyc review and failure states Sep 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 9b5fea01-0d4f-4d71-8997-1655394bc61e

📥 Commits

Reviewing files that changed from the base of the PR and between c6d8ec3 and 003b5d6.

📒 Files selected for processing (2)
  • src/components/getting-started/GettingStarted.tsx
  • src/utils/useKYC.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread src/components/getting-started/GettingStarted.tsx

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bad22b6186

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/components/add-funds/AddFunds.tsx Outdated
@cruzdanilo
cruzdanilo merged commit 1f9bce2 into main Sep 10, 2026
13 of 14 checks passed
@cruzdanilo
cruzdanilo deleted the kyc branch September 10, 2026 13:06
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.

3 participants