test(domain): herregistratie inscription date + reminder-due rule (refs #18)
The Registration aggregate gains the herregistratie clock: Approve now records the inscription moment, from which the herregistratie deadline and a reminder-due rule are derived. Members are stubbed so the suite compiles and the new assertions fail; the green commit implements them. Approve's signature gains the inscription moment (callers now supply 'now' from an injected TimeProvider). refs #18
This commit is contained in:
@@ -12,7 +12,7 @@ public sealed record ApproveRegistrationCommand(RegistrationId RegistrationId);
|
||||
/// zaak status is the projection's source of truth (it flows back over NRC); the aggregate transition
|
||||
/// keeps the domain's own view consistent.
|
||||
/// </summary>
|
||||
public sealed class ApproveRegistration(IRegistrationStore store, IAclClient acl)
|
||||
public sealed class ApproveRegistration(IRegistrationStore store, IAclClient acl, TimeProvider clock)
|
||||
{
|
||||
public async Task HandleAsync(ApproveRegistrationCommand command, CancellationToken ct = default)
|
||||
{
|
||||
@@ -30,7 +30,7 @@ public sealed class ApproveRegistration(IRegistrationStore store, IAclClient acl
|
||||
$"Registration {command.RegistrationId} has no zaak yet; it cannot be approved.");
|
||||
|
||||
await acl.ApproveZaakAsync(registration.ZaakUrl, ct);
|
||||
registration.Approve();
|
||||
registration.Approve(clock.GetUtcNow());
|
||||
await store.SaveAsync(registration, ct);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user