diff --git a/services/domain/Big.Domain/Registration.cs b/services/domain/Big.Domain/Registration.cs
index 3aea662..ea19202 100644
--- a/services/domain/Big.Domain/Registration.cs
+++ b/services/domain/Big.Domain/Registration.cs
@@ -105,7 +105,7 @@ public sealed class Registration
RequireOpenForDecision(nameof(Approve));
Status = RegistrationStatus.Ingeschreven;
- // RED stub: the inscription moment is not stored yet.
+ IngeschrevenOp = ingeschrevenOp;
}
// --- Herregistratie (S-17) โ RED stubs, implemented in the green commit ---------------------
@@ -125,19 +125,35 @@ public sealed class Registration
/// The date by which herregistratie must happen: inscription + validity. Null until
/// inscribed.
- public DateTimeOffset? HerregistratieVoor => null; // RED stub
+ public DateTimeOffset? HerregistratieVoor =>
+ IngeschrevenOp is DateTimeOffset ingeschrevenOp ? ingeschrevenOp + HerregistratieGeldigheid : null;
/// Whether the herregistratie reminder has been sent for this inscription (S-17).
public bool HerregistratieReminderVerstuurd { get; private set; }
/// Whether, as of , this registration is due a herregistratie
/// reminder: it is inscribed, the reminder window before its deadline has opened, and it has not
- /// already been reminded.
- public bool HerregistratieReminderDue(DateTimeOffset asOf) => false; // RED stub
+ /// already been reminded. Once inside the window it stays due until reminded (an overdue inscription
+ /// is still due). This is the single rule the store query and the sweep both build on.
+ public bool HerregistratieReminderDue(DateTimeOffset asOf) =>
+ Status == RegistrationStatus.Ingeschreven
+ && !HerregistratieReminderVerstuurd
+ && IngeschrevenOp is DateTimeOffset ingeschrevenOp
+ && asOf >= ingeschrevenOp + HerregistratieGeldigheid - Herinneringstermijn;
/// Record that the herregistratie reminder has been sent. Idempotent โ a re-sweep is a
- /// no-op; only an inscribed registration can be reminded.
- public void MarkHerregistratieReminderVerstuurd() { } // RED stub
+ /// no-op (ยง8.6); only an inscribed registration can be reminded.
+ public void MarkHerregistratieReminderVerstuurd()
+ {
+ if (HerregistratieReminderVerstuurd)
+ return;
+
+ if (Status != RegistrationStatus.Ingeschreven)
+ throw new InvalidOperationException(
+ $"Registration {Id} is {Status}; only an INGESCHREVEN registration can be sent a herregistratie reminder.");
+
+ HerregistratieReminderVerstuurd = true;
+ }
///
/// Reject the registration โ the behandelaar's decision not to enter it in the register. Advances a