Skip to content

test(kyc): KycStep + KycSession DTO hierarchy (+12 tests)#355

Merged
TaprootFreak merged 1 commit into
developfrom
test/kyc-step-session-dtos
May 15, 2026
Merged

test(kyc): KycStep + KycSession DTO hierarchy (+12 tests)#355
TaprootFreak merged 1 commit into
developfrom
test/kyc-step-session-dtos

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Stage 31 of the coverage push. Wire-format DTOs for the KYC session hierarchy.

DTO Cases
`KycStepDto.fromJson` 4
`KycSessionInfoDto` + `UrlType` 3
`KycStepSessionDto.fromJson` 1
`KycLevelDto.fromJson` 2
`KycSessionDto.fromJson` 2

What's pinned

  • KycStepDto: full-step parse (name + type + status + reason + sequenceNumber + isCurrent); type / reason are optional (null on the wire stays null); `isCurrent` defaults to `false` when missing entirely (`??` fallback — pinned because callers rely on this); unknown step name throws (no silent fallback).
  • KycSessionInfoDto / UrlType: url + UrlType parse; `UrlTypeExtension.fromJson` covers all four enum values (Browser/API/Token/None); unknown wire string throws `ArgumentError`.
  • KycStepSessionDto: inherits all step fields; carries a nested `KycSessionInfoDto` parsed from `session`.
  • KycLevelDto: level + step list; empty step list is allowed.
  • KycSessionDto: extends `KycLevelDto` with an optional `currentStep` (null stays null).

Test plan

  • `flutter analyze` clean
  • `flutter test` — 12 / 12 passing locally
  • CI green

…velDto + KycSessionDto fromJson (+12 tests)

Stage 31 of the coverage push. Wire-format DTOs for the KYC session
hierarchy.

- KycStepDto.fromJson (4): full step parse; type and reason optional;
  isCurrent defaults to false when missing; unknown name throws
- KycSessionInfoDto + UrlType (3): url + UrlType parse; fromJson covers
  Browser/API/Token/None; unknown throws ArgumentError
- KycStepSessionDto.fromJson (1): inherits step fields + carries nested
  KycSessionInfoDto
- KycLevelDto.fromJson (2): level + step list; empty steps allowed
- KycSessionDto.fromJson (2): extends KycLevelDto with optional
  currentStep; null currentStep preserved
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 17:59
@TaprootFreak TaprootFreak merged commit f75caba into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/kyc-step-session-dtos branch May 15, 2026 19:00
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