feat(domain): Registration.Expire() lapses an open registration to Verlopen (refs #102)
Adds the terminal Verlopen status and Expire(), reusing the RequireOpenForDecision guard so only an INGEDIEND/IN_BEHANDELING registration can lapse; idempotent once Verlopen. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -133,8 +133,24 @@ public sealed class Registration
|
|||||||
Status = RegistrationStatus.Ingetrokken;
|
Status = RegistrationStatus.Ingetrokken;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A decision (or withdrawal) is only valid while the registration is still open (INGEDIEND or
|
/// <summary>
|
||||||
// IN_BEHANDELING).
|
/// Expire the registration — the 30-day document-wait timer fired before the required documents
|
||||||
|
/// were supplied, so the registratie process cancels the case (S-10a). Allowed while it is still
|
||||||
|
/// open (INGEDIEND or IN_BEHANDELING) and needs no zaak; a decided (INGESCHREVEN/AFGEWEZEN) or
|
||||||
|
/// withdrawn (INGETROKKEN) registration can no longer expire. Re-expiring one already
|
||||||
|
/// <see cref="RegistrationStatus.Verlopen"/> is a no-op — the worker job may be redelivered (§8.6).
|
||||||
|
/// </summary>
|
||||||
|
public void Expire()
|
||||||
|
{
|
||||||
|
if (Status == RegistrationStatus.Verlopen)
|
||||||
|
return;
|
||||||
|
|
||||||
|
RequireOpenForDecision(nameof(Expire));
|
||||||
|
Status = RegistrationStatus.Verlopen;
|
||||||
|
}
|
||||||
|
|
||||||
|
// A decision (or withdrawal, or expiry) is only valid while the registration is still open
|
||||||
|
// (INGEDIEND or IN_BEHANDELING).
|
||||||
private void RequireOpenForDecision(string decision)
|
private void RequireOpenForDecision(string decision)
|
||||||
{
|
{
|
||||||
if (Status is not (RegistrationStatus.Ingediend or RegistrationStatus.InBehandeling))
|
if (Status is not (RegistrationStatus.Ingediend or RegistrationStatus.InBehandeling))
|
||||||
|
|||||||
@@ -21,4 +21,8 @@ public enum RegistrationStatus
|
|||||||
|
|
||||||
/// <summary>Withdrawn by the zorgprofessional before a decision (S-11). Terminal.</summary>
|
/// <summary>Withdrawn by the zorgprofessional before a decision (S-11). Terminal.</summary>
|
||||||
Ingetrokken,
|
Ingetrokken,
|
||||||
|
|
||||||
|
/// <summary>Lapsed: the required documents were not supplied within the 30-day window, so the
|
||||||
|
/// registratie process cancelled the case (S-10a). Terminal.</summary>
|
||||||
|
Verlopen,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user