Add ASP.NET Core backend hosting business rules; FE consumes via typed client
Move the authoritative business rules off the frontend into a real backend,
realising the BFF-lite + decision-DTO design (ADR-0001) that until now lived
only in static mock JSON.
Backend (backend/):
- ASP.NET Core (.NET 10) minimal API, contract-first, Swagger UI at /swagger.
- DDD Domain/ rules layer: profession derivation + applicable policy questions
(DiplomaRules), herregistratie eligibility + reason (HerregistratieRule),
scholing threshold (IntakePolicy), submit rejections + reference generation
(SubmissionRules). In-memory seeded data, ProblemDetails (RFC 7807) errors.
- 27 xUnit tests: rule units + endpoint integration incl. BRP no-address and
DUO not-found fallbacks and 422 submit paths.
Frontend (only infrastructure/ + contracts/ change, as the architecture promised):
- NSwag-generated typed client (api-client.ts), routed through Angular HttpClient
via a small fetch adapter so the ?scenario= interceptor still applies.
- GET adapters use resource({ loader: client.x }); submit commands call the client
and map ProblemDetails -> err. The hardcoded uren==0 / manual-diploma rules are
deleted (now server-side). Domain, stores, UI and format validators unchanged.
- Deleted the now-dead public/mock/*.json.
Tooling/docs:
- npm start proxies /api -> backend; npm run gen:api regenerates the client;
docker compose up runs both (bind mounts use :z for SELinux/Fedora).
- backend/README.md walkthrough: adding a policy question is a one-file backend
change, no FE change, no client regen. Updated CLAUDE.md + ARCHITECTURE.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"gevonden": true,
|
||||
"adres": {
|
||||
"straat": "Lange Voorhout 9",
|
||||
"postcode": "2514 EA",
|
||||
"woonplaats": "Den Haag"
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"registration": {
|
||||
"bigNummer": "19012345601",
|
||||
"naam": "Dr. A. (Anna) de Vries",
|
||||
"beroep": "Arts",
|
||||
"registratiedatum": "2012-09-01",
|
||||
"geboortedatum": "1985-03-14",
|
||||
"status": { "tag": "Geregistreerd", "herregistratieDatum": "2027-03-01" }
|
||||
},
|
||||
"person": {
|
||||
"naam": "Dr. A. (Anna) de Vries",
|
||||
"geboortedatum": "1985-03-14",
|
||||
"adres": {
|
||||
"straat": "Lange Voorhout 9",
|
||||
"postcode": "2514 EA",
|
||||
"woonplaats": "Den Haag"
|
||||
}
|
||||
},
|
||||
"decisions": {
|
||||
"eligibleForHerregistratie": true,
|
||||
"herregistratieReason": "Registratie verloopt binnen 12 maanden (2027-03-01)."
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"diplomas": [
|
||||
{
|
||||
"id": "d1",
|
||||
"naam": "Geneeskunde",
|
||||
"instelling": "Universiteit Leiden",
|
||||
"jaar": 2011,
|
||||
"beroep": "Arts",
|
||||
"policyQuestions": []
|
||||
},
|
||||
{
|
||||
"id": "d2",
|
||||
"naam": "Medicine (MBChB)",
|
||||
"instelling": "University of Edinburgh",
|
||||
"jaar": 2013,
|
||||
"beroep": "Arts",
|
||||
"policyQuestions": [
|
||||
{ "id": "nl-taalvaardigheid", "vraag": "Uw opleiding was Engelstalig. Beheerst u de Nederlandse taal op het vereiste niveau (B2)?", "type": "ja-nee" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "d3",
|
||||
"naam": "HBO-Verpleegkunde",
|
||||
"instelling": "Hogeschool Utrecht",
|
||||
"jaar": 2016,
|
||||
"beroep": "Verpleegkundige",
|
||||
"policyQuestions": []
|
||||
}
|
||||
],
|
||||
"handmatig": {
|
||||
"beroepen": ["Arts", "Verpleegkundige", "Fysiotherapeut", "Apotheker", "Tandarts"],
|
||||
"policyQuestions": [
|
||||
{ "id": "nl-taalvaardigheid", "vraag": "Beheerst u de Nederlandse taal op het vereiste niveau (B2)?", "type": "ja-nee" },
|
||||
{ "id": "diploma-erkend", "vraag": "Is uw diploma erkend door de Nederlandse overheid (bijv. via Nuffic)?", "type": "ja-nee" },
|
||||
{ "id": "toelichting", "vraag": "Geef een korte toelichting op uw diploma en opleiding.", "type": "tekst" }
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ "scholingThreshold": 1000 }
|
||||
@@ -1,5 +0,0 @@
|
||||
[
|
||||
{ "type": "Specialisme", "omschrijving": "Huisartsgeneeskunde", "datum": "2016-04-12" },
|
||||
{ "type": "Aantekening", "omschrijving": "Erkend opleider huisartsgeneeskunde", "datum": "2019-01-08" },
|
||||
{ "type": "Specialisme", "omschrijving": "Spoedeisende hulp (kaderopleiding)", "datum": "2021-06-30" }
|
||||
]
|
||||
Reference in New Issue
Block a user