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

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>
This commit is contained in:
2026-07-16 10:53:31 +02:00
parent 98abba8b22
commit d966a198fb
4 changed files with 68 additions and 2 deletions

View File

@@ -111,7 +111,23 @@ public sealed class Registration
Status = RegistrationStatus.Afgewezen;
}
// A decision is only valid while the registration is still open (INGEDIEND or IN_BEHANDELING).
/// <summary>
/// Withdraw the registration — the zorgprofessional pulls their own submission back (S-11). Allowed
/// while it is still open (INGEDIEND or IN_BEHANDELING) and needs no zaak; a registration that has
/// already been decided (INGESCHREVEN/AFGEWEZEN) can no longer be withdrawn. Re-withdrawing one
/// already <see cref="RegistrationStatus.Ingetrokken"/> is a no-op.
/// </summary>
public void Withdraw()
{
if (Status == RegistrationStatus.Ingetrokken)
return;
RequireOpenForDecision(nameof(Withdraw));
Status = RegistrationStatus.Ingetrokken;
}
// A decision (or withdrawal) is only valid while the registration is still open (INGEDIEND or
// IN_BEHANDELING).
private void RequireOpenForDecision(string decision)
{
if (Status is not (RegistrationStatus.Ingediend or RegistrationStatus.InBehandeling))