Model Registration status as a discriminated union
Each status variant now owns its own data: only Geregistreerd carries a herregistratieDatum; Geschorst/Doorgehaald carry their own dates + reason. A struck-off registration can no longer hold a future herregistratie date — that impossible combination is gone from the type. - status-badge keys color off the tag via a switch + assertNever - registration-summary renders only the rows a variant's data supports - registration.json nests the status; stories cover all three variants Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
"bigNummer": "19012345601",
|
||||
"naam": "Dr. A. (Anna) de Vries",
|
||||
"beroep": "Arts",
|
||||
"status": "Geregistreerd",
|
||||
"registratiedatum": "2012-09-01",
|
||||
"herregistratieDatum": "2027-09-01",
|
||||
"geboortedatum": "1985-03-14"
|
||||
"geboortedatum": "1985-03-14",
|
||||
"status": { "tag": "Geregistreerd", "herregistratieDatum": "2027-09-01" }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user