feat(domain): withdrawal — INGETROKKEN transition + endpoint (S-11a, refs #12) #88

Merged
not merged 2 commits from feat/12-withdrawal into main 2026-07-16 09:15:13 +00:00
Contributor

What & why

First sub-slice of S-11 · Withdrawal (Flow 3) (#12). A zorgprofessional can withdraw a still-open registration ("trek aanvraag in"); this sub-slice delivers the domain transition + endpoint, mirroring how S-12a shipped the beoordeling decision model on its own (#82).

  • RegistrationStatus.Ingetrokken (terminal).
  • Registration.Withdraw() — allowed from INGEDIEND or IN_BEHANDELING, needs no zaak, idempotent, and rejected once the registration has been decided (INGESCHREVEN/AFGEWEZEN).
  • WithdrawRegistration application handler (load → withdraw → persist; repeated withdrawal is a no-op).
  • POST /registrations/{id}/withdraw on the domain API.

Demoable: POST /registrations/{id}/withdrawGET /registrations/{id} shows INGETROKKEN.

Refs #12 (not closing — see below).

Scope / follow-ups

S-11 is bigger than one slice, so it is split (CLAUDE.md §13), like S-12 was:

  • S-11a (this PR) — domain withdrawal transition + endpoint.
  • S-11b — cancel the running Flowable process via a BPMN message event, so a withdrawn case leaves the behandelaar's werkbak.
  • S-11c — owner-scoped BFF self-service withdraw endpoint + "trek aanvraag in" button + e2e.

Cancelling the Flowable process is deliberately deferred (documented in WithdrawRegistration), exactly as the beoordeling's rejection deferred its zaak propagation. #12 stays open until S-11c.

Definition of Done

  • Linked Gitea issue (#12).
  • Failing test committed before the implementation.
  • Implementation makes the test pass.
  • Conventional Commits referencing the issue (refs #12).
  • CI green — all Gitea Actions jobs.
  • docker compose up unaffected (no infra/contract change).
  • Docs — none needed for this backend sub-slice; the user-visible demo note lands with S-11c.
  • No ADR needed — mirrors existing aggregate/handler/endpoint patterns; no boundary change.

Notes for reviewers

  • Verified locally: Big.Tests 89/89 pass; Big.Api builds clean.
  • The domain trusts its callers (§8.3); owner-scoping by the caller's bsn is enforced at the BFF in S-11c.
## What & why First sub-slice of **S-11 · Withdrawal (Flow 3)** (#12). A zorgprofessional can withdraw a still-open registration ("trek aanvraag in"); this sub-slice delivers the **domain transition + endpoint**, mirroring how S-12a shipped the beoordeling decision model on its own (#82). - `RegistrationStatus.Ingetrokken` (terminal). - `Registration.Withdraw()` — allowed from INGEDIEND or IN_BEHANDELING, needs no zaak, idempotent, and rejected once the registration has been decided (INGESCHREVEN/AFGEWEZEN). - `WithdrawRegistration` application handler (load → withdraw → persist; repeated withdrawal is a no-op). - `POST /registrations/{id}/withdraw` on the domain API. Demoable: `POST /registrations/{id}/withdraw` → `GET /registrations/{id}` shows `INGETROKKEN`. Refs #12 (not closing — see below). ## Scope / follow-ups S-11 is bigger than one slice, so it is split (CLAUDE.md §13), like S-12 was: - **S-11a (this PR)** — domain withdrawal transition + endpoint. - **S-11b** — cancel the running Flowable process via a BPMN message event, so a withdrawn case leaves the behandelaar's werkbak. - **S-11c** — owner-scoped BFF self-service withdraw endpoint + "trek aanvraag in" button + e2e. Cancelling the Flowable process is deliberately deferred (documented in `WithdrawRegistration`), exactly as the beoordeling's rejection deferred its zaak propagation. #12 stays open until S-11c. ## Definition of Done - [x] Linked Gitea issue (#12). - [x] Failing test committed before the implementation. - [x] Implementation makes the test pass. - [x] Conventional Commits referencing the issue (`refs #12`). - [x] CI green — all Gitea Actions jobs. - [x] `docker compose up` unaffected (no infra/contract change). - [x] Docs — none needed for this backend sub-slice; the user-visible demo note lands with S-11c. - [x] No ADR needed — mirrors existing aggregate/handler/endpoint patterns; no boundary change. ## Notes for reviewers - Verified locally: `Big.Tests` 89/89 pass; `Big.Api` builds clean. - The domain trusts its callers (§8.3); owner-scoping by the caller's bsn is enforced at the BFF in S-11c.
not added 2 commits 2026-07-16 08:54:58 +00:00
Withdraw is allowed from INGEDIEND or IN_BEHANDELING, needs no zaak, is idempotent, and is

rejected once the registration has been decided (INGESCHREVEN/AFGEWEZEN). The WithdrawRegistration

handler loads, withdraws, and persists; a repeated withdrawal is a no-op.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(domain): withdraw a registration → INGETROKKEN via POST /registrations/{id}/withdraw (refs #12)
All checks were successful
CI / lint (pull_request) Successful in 1m13s
CI / build (pull_request) Successful in 57s
CI / unit (pull_request) Successful in 1m10s
CI / frontend (pull_request) Successful in 2m33s
CI / mutation (pull_request) Successful in 5m16s
CI / verify-stack (pull_request) Successful in 7m25s
d966a198fb
Add the Ingetrokken terminal status, Registration.Withdraw() (open-only, idempotent), the

WithdrawRegistration handler, and the domain endpoint. Cancelling the running Flowable process

(so the case leaves the werkbak) and the owner-scoped BFF/self-service action are follow-up

sub-slices (S-11b/S-11c).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
not added the type:slicearea:domainarea:workflow labels 2026-07-16 08:55:20 +00:00
not merged commit 1f1c944a8b into main 2026-07-16 09:15:13 +00:00
Sign in to join this conversation.