Skip to content

test(registration): KycPersonalData + KycAddress (+11 tests)#356

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

test(registration): KycPersonalData + KycAddress (+11 tests)#356
TaprootFreak merged 1 commit into
developfrom
test/kyc-personal-data-dtos

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Stage 32 of the coverage push. Registration DTOs that round-trip through the KYC backend.

DTO Cases
`KycAddress` toJson / fromJson 5
`KycPersonalData` toJson / fromJson 4
`KycAccountType.fromString` 2

What's pinned

  • KycAddress.toJson: nests country as `{id: int}` on the wire; omits `houseNumber` entirely when null.
  • KycAddress.fromJson: reads country as a nested map (canonical), AND as a bare int (legacy / alternate wire shape — the factory has a defensive `is Map` check); `houseNumber` optional.
  • KycPersonalData.toJson: serialises the personal fields + nested address; excludes optional `organizationName` / `organizationAddress` when absent; includes them when set.
  • KycPersonalData.fromJson: round-trips both personal and organization shapes.
  • KycAccountType.fromString: resolves the three known wire values (`Personal` / `Organization` / `SoleProprietorship`); throws on unknown.

Test plan

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

Stage 32 of the coverage push.

- KycAddress (5): toJson nests country as {id: int}; omits
  houseNumber when null; fromJson reads country as a nested map AND
  as a bare int (defensive 'is Map' branch); houseNumber optional
- KycPersonalData (4): toJson serialises personal + nested address,
  excludes optional org fields when absent, includes them when set;
  fromJson round-trips both personal and organization shapes
- KycAccountType.fromString (2): resolves three known wire values
  (Personal / Organization / SoleProprietorship); throws on unknown
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 18:13
@TaprootFreak TaprootFreak merged commit e862f2a into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/kyc-personal-data-dtos branch May 15, 2026 18:13
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