diff --git a/services/domain/Big.Domain/Registration.cs b/services/domain/Big.Domain/Registration.cs index 51f20cf..a3b3503 100644 --- a/services/domain/Big.Domain/Registration.cs +++ b/services/domain/Big.Domain/Registration.cs @@ -133,8 +133,24 @@ public sealed class Registration Status = RegistrationStatus.Ingetrokken; } - // A decision (or withdrawal) is only valid while the registration is still open (INGEDIEND or - // 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 + /// is a no-op — the worker job may be redelivered (§8.6). + /// + 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) { if (Status is not (RegistrationStatus.Ingediend or RegistrationStatus.InBehandeling)) diff --git a/services/domain/Big.Domain/RegistrationStatus.cs b/services/domain/Big.Domain/RegistrationStatus.cs index fccfac7..5e8a28c 100644 --- a/services/domain/Big.Domain/RegistrationStatus.cs +++ b/services/domain/Big.Domain/RegistrationStatus.cs @@ -21,4 +21,8 @@ public enum RegistrationStatus /// Withdrawn by the zorgprofessional before a decision (S-11). Terminal. Ingetrokken, + + /// Lapsed: the required documents were not supplied within the 30-day window, so the + /// registratie process cancelled the case (S-10a). Terminal. + Verlopen, }