Skip to content

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

Open
franm91 wants to merge 1 commit into
mainfrom
kyc
Open

✨ app: add kyc review and failure states#1291
franm91 wants to merge 1 commit 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: 003b5d6

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 Stack

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 and translations.

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 and release metadata
src/i18n/es.json, src/i18n/es-AR.json, src/i18n/pt.json, .changeset/six-peas-beg.md
Spanish and Portuguese locales add KYC status and document-review strings. The mobile package receives a patch changeset.

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

Merge Risk: 🟡 Moderate · up to 003b5

Users whose identity verification is under review or has failed may be prompted to add funds instead of seeing the appropriate review or support flow. This can misdirect users during a blocking verification state and should be corrected before merge.

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.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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 56.97674% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.36%. Comparing base (f4fc241) to head (4bcac7d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/components/card/Card.tsx 45.83% 13 Missing ⚠️
src/components/swaps/Swaps.tsx 0.00% 7 Missing ⚠️
src/components/send-funds/SendFunds.tsx 14.28% 6 Missing ⚠️
src/utils/persona.ts 0.00% 4 Missing ⚠️
src/components/home/GettingStarted.tsx 57.14% 3 Missing ⚠️
src/components/shared/InfoAlert.tsx 0.00% 2 Missing ⚠️
src/utils/useKYC.ts 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1291      +/-   ##
==========================================
- Coverage   73.37%   73.36%   -0.01%     
==========================================
  Files         276      277       +1     
  Lines       13445    13469      +24     
  Branches     4704     4722      +18     
==========================================
+ Hits         9865     9882      +17     
- Misses       3241     3248       +7     
  Partials      339      339              
Flag Coverage Δ
e2e 73.36% <56.97%> (-0.01%) ⬇️

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
@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
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