fix: narrow parseBrpAddress's return type instead of leaking the DTO

BrpAddressDto's fields are generated as optional, so returning it
directly from parseBrpAddress lost the narrowing the runtime check
already did. This broke the build once registratie-lookup.store.ts
assigned the parsed address into a stricter local type. Map to a
proper BrpAddress domain shape at the trust boundary instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
eho
2026-09-04 15:17:06 +02:00
co-authored by Claude Sonnet 5
parent 5977efe044
commit c7aed8d308
2 changed files with 22 additions and 13 deletions
@@ -41,7 +41,7 @@ export class RegistratieLookupStore {
const json = this.adresRes.value();
if (json === undefined) return null;
const parsed = parseBrpAddress(json);
return parsed.ok && parsed.value.gevonden && parsed.value.adres ? parsed.value.adres : null;
return parsed.ok && parsed.value.adres ? parsed.value.adres : null;
},
);