Implement GET /api/routes-d/kyc/status endpoint#1078
Merged
Conversation
- Add GET handler to fetch KYC application status for authenticated user - Returns 'not_submitted' status when no application exists - Returns application details with status, level, and relevant timestamps - Includes authentication, user lookup, and structured error handling - Add comprehensive unit tests covering all scenarios (8 tests passing) Closes davedumto#963
|
@0xdevmes is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@0xdevmes Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement GET /api/routes-d/kyc/status endpoint
Summary
This PR implements a GET endpoint to fetch the KYC application status for an authenticated user. The endpoint returns the current status of the user's KYC application, including relevant details like level, submission timestamps, and rejection reasons if applicable.
Implementation
Endpoint: GET
/api/routes-d/kyc/statusResponse Structure:
{ status: "not_submitted", application: null }{ status: <status>, application: { <application_details> } }Application Details Returned:
id- Application UUIDstatus- Current status (pending, approved, rejected)level- KYC level (basic, enhanced)fullName- Applicant's full namesubmittedAt- Timestamp when application was submittedreviewedAt- Timestamp when application was reviewed (null if not reviewed)rejectionReason- Reason for rejection (null if not rejected)createdAt- Application creation timestampupdatedAt- Last update timestampAuthentication & Authorization:
Error Handling:
Testing
Added comprehensive unit tests in
tests/api.routes-d.kyc.status.test.ts(8 tests):All tests pass successfully.
Files Changed
app/api/routes-d/kyc/status/route.ts- GET handler implementationtests/api.routes-d.kyc.status.test.ts- Unit testsDesign Decisions
/api/routes-d/kyc/submitendpoint patternsCloses #963