S-09b: Approval flow — temp admin endpoint + status transition to projection #77
@@ -64,4 +64,23 @@ public sealed class Registration
|
|||||||
|
|
||||||
ZaakUrl = zaakUrl;
|
ZaakUrl = zaakUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Approve the registration — the behandelaar's decision to enter it in the register. Advances
|
||||||
|
/// <see cref="RegistrationStatus.Ingediend"/> → <see cref="RegistrationStatus.Ingeschreven"/>.
|
||||||
|
/// Requires an opened zaak (the approval sets that zaak's status via the ACL), and only a
|
||||||
|
/// submitted registration can be approved: re-approving is rejected as an invalid transition.
|
||||||
|
/// </summary>
|
||||||
|
public void Approve()
|
||||||
|
{
|
||||||
|
if (ZaakUrl is null)
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"Registration {Id} has no zaak yet; it cannot be approved before its zaak is opened.");
|
||||||
|
|
||||||
|
if (Status != RegistrationStatus.Ingediend)
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"Registration {Id} is {Status}; only an INGEDIEND registration can be approved.");
|
||||||
|
|
||||||
|
Status = RegistrationStatus.Ingeschreven;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
namespace Big.Domain;
|
namespace Big.Domain;
|
||||||
|
|
||||||
/// <summary>The lifecycle states a <see cref="Registration"/> moves through. The walking
|
/// <summary>The lifecycle states a <see cref="Registration"/> moves through. The walking
|
||||||
/// skeleton knows only <see cref="Ingediend"/>; withdrawal, beoordeling and herregistratie
|
/// skeleton knows <see cref="Ingediend"/> and the terminal <see cref="Ingeschreven"/>; withdrawal,
|
||||||
/// states arrive in their own slices (Iteration 2+).</summary>
|
/// beoordeling and herregistratie states arrive in their own slices (Iteration 2+).</summary>
|
||||||
public enum RegistrationStatus
|
public enum RegistrationStatus
|
||||||
{
|
{
|
||||||
/// <summary>Submitted by the zorgprofessional; the registratie process has been started.</summary>
|
/// <summary>Submitted by the zorgprofessional; the registratie process has been started.</summary>
|
||||||
Ingediend,
|
Ingediend,
|
||||||
|
|
||||||
|
/// <summary>Approved: entered in the register. Terminal in the walking skeleton (S-09b).</summary>
|
||||||
|
Ingeschreven,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user