✨ app: add kyc review and failure states - #1291
Conversation
🦋 Changeset detectedLatest commit: 9348774 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe mobile app centralizes KYC status handling through ChangesKYC review and failure flow
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🟡 Moderate · up to 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
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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 winClassify the post-inquiry status before returning
complete.When the refetch returns
"processing"or"bad kyc", this returns"complete".src/components/add-funds/AddFunds.tsxroutes that non-approved complete result to home instead of getting started. Apply the same blocked classification used beforestartKYC()tokyc.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
📒 Files selected for processing (18)
.changeset/six-peas-beg.mdsrc/components/add-funds/AddFunds.tsxsrc/components/card/Card.tsxsrc/components/getting-started/GettingStarted.tsxsrc/components/getting-started/Step.tsxsrc/components/home/GettingStarted.tsxsrc/components/home/Home.tsxsrc/components/send-funds/SendFunds.tsxsrc/components/shared/FundingAlert.tsxsrc/components/shared/InfoAlert.tsxsrc/components/swaps/Swaps.tsxsrc/i18n/es-AR.jsonsrc/i18n/es.jsonsrc/i18n/pt.jsonsrc/utils/persona.tssrc/utils/server.tssrc/utils/useKYC.tssrc/utils/useOnboardingSteps.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 winClassify the post-inquiry KYC status before returning success. After
startKYC()resolves, the mutation fetches the status but always returnsstatus: "complete". When the API returnsprocessingorbad kyc,GettingStarted.tsxandSwaps.tsxroute the user home instead of to blocked onboarding. Returnblockedunless the fetched code isokorlegacy kyc.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Team
Run ID: 5be8df4f-194e-4a8b-9579-7da075bbcca4
📒 Files selected for processing (10)
.changeset/six-peas-beg.mdsrc/components/card/Card.tsxsrc/components/getting-started/GettingStarted.tsxsrc/components/home/GettingStarted.tsxsrc/components/swaps/Swaps.tsxsrc/i18n/es.jsonsrc/i18n/pt.jsonsrc/utils/server.tssrc/utils/useKYC.tssrc/utils/useOnboardingSteps.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Team
Run ID: 9b5fea01-0d4f-4d71-8997-1655394bc61e
📒 Files selected for processing (2)
src/components/getting-started/GettingStarted.tsxsrc/utils/useKYC.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
There was a problem hiding this comment.
💡 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".
Summary by CodeRabbit