test(service): dfx_kyc_service core methods (+10 tests)#343
Merged
Conversation
Stage 20 of the coverage push. Covers four core methods of the previously-deferred dfx_kyc_service. Safe from PR #332 conflicts — that PR touches lib/screens/kyc/cubits/kyc/kyc_cubit.dart and real_unit_registration_service.dart, NOT this service. - getUser (3): GET /v2/user with Bearer JWT + parses UserDto; 201 also accepted; ApiException on non-2xx non-401 - updateUser (3): PUT /v2/user with the JSON body; 201 accepted; ApiException on non-2xx - request2FaCode (2): POST /v2/kyc/2fa?level=Strict with the x-kyc-code header set from getUser().kyc.hash; ApiException on non-2xx - verify2FaCode (2): POST /v2/kyc/2fa/verify with {token: code} and the x-kyc-code header; ApiException on non-2xx Excluded (deferred): continueKyc, startStep, setData, getFinancialData, setFinancialData (more involved bodies; will land separately if needed).
3 tasks
TaprootFreak
added a commit
that referenced
this pull request
May 15, 2026
## Summary Stage 21 of the coverage push. Closes the \`dfx_kyc_service\` surface added in #343. | Method | Cases | | --- | --- | | \`continueKyc\` | 2 | | \`startStep\` | 2 | | \`setData\` | 2 | | \`getFinancialData\` | 3 | | \`setFinancialData\` | 2 | ## What each method pins - **continueKyc:** PUT \`/v2/kyc\` with the \`x-kyc-code\` header from \`getUser().kyc.hash\`; parses \`KycSessionDto\`; \`ApiException\` on non-2xx. - **startStep:** GET \`/v2/kyc/<stepName.value>\` (the path encodes the step enum's wire string); parses \`KycSessionDto\`; \`ApiException\` on non-2xx. - **setData:** PUTs the caller-provided session URL (NOT the host) with the JSON body + \`x-kyc-code\` header; \`ApiException\` on non-2xx. - **getFinancialData:** GET \`<url>?lang=<lang.code>\`; defaults the language to \`Language.de\` (\`'de'\`); \`x-kyc-code\` header; \`ApiException\` on non-2xx. - **setFinancialData:** PUTs \`{ "responses": [...] }\` to the caller-provided URL with \`x-kyc-code\` header; serialises each \`KycFinancialResponse\` to \`{ key, value }\`; \`ApiException\` on non-2xx. ## Conflict avoidance Same as #343 — \`dfx_kyc_service.dart\` is NOT in PR #332's diff. The service surface is stable on that branch. ## Test plan - [x] \`flutter analyze\` clean - [x] \`flutter test\` — 11 / 11 passing locally - [ ] CI green
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.
Summary
Stage 20 of the coverage push. Covers four core methods of the previously-deferred `dfx_kyc_service`.
What each method's tests pin
Conflict avoidance
PR #332 (bitbox sign + KYC routing) touches `lib/screens/kyc/cubits/kyc/kyc_cubit.dart` and `real_unit_registration_service.dart` — NOT this service. `dfx_kyc_service.dart` itself is unchanged on that branch, so this PR is conflict-free.
Notes
Excluded (deferred)
Test plan