test(workflow): start carries diploma origin as a process variable (S-13, refs #14)
Add DiplomaOrigin (Binnenlands/Buitenlands) to the Registration aggregate and submit command, and thread it through the process-start port so the workflow's DMN can route on it (ADR proposal #100). Failing Workflow Client test asserts the diplomaOrigin start variable; the client takes the origin but does not emit it yet. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
17
services/domain/Big.Domain/DiplomaOrigin.cs
Normal file
17
services/domain/Big.Domain/DiplomaOrigin.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Big.Domain;
|
||||
|
||||
/// <summary>
|
||||
/// Where a zorgprofessional's diploma was issued. It is the input to the diploma-eligibility decision
|
||||
/// (S-13): a <see cref="Buitenlands"/> (foreign) diploma routes the registratie through an extra
|
||||
/// CBGV-advies assessment step, a <see cref="Binnenlands"/> (domestic) one goes straight to beoordeling.
|
||||
/// The decision itself lives in the workflow's DMN, not here (ADR-0016); the domain only carries the
|
||||
/// origin and hands it to the process as a start variable.
|
||||
/// </summary>
|
||||
public enum DiplomaOrigin
|
||||
{
|
||||
/// <summary>A Dutch (domestic) diploma. Default for a registration submitted via DigiD.</summary>
|
||||
Binnenlands,
|
||||
|
||||
/// <summary>A foreign diploma (e.g. an eIDAS submission). Triggers the CBGV-advies step.</summary>
|
||||
Buitenlands,
|
||||
}
|
||||
@@ -7,10 +7,11 @@ namespace Big.Domain;
|
||||
/// </summary>
|
||||
public sealed class Registration
|
||||
{
|
||||
private Registration(RegistrationId id, string bsn)
|
||||
private Registration(RegistrationId id, string bsn, DiplomaOrigin diplomaOrigin)
|
||||
{
|
||||
Id = id;
|
||||
Bsn = bsn;
|
||||
DiplomaOrigin = diplomaOrigin;
|
||||
Status = RegistrationStatus.Ingediend;
|
||||
}
|
||||
|
||||
@@ -20,6 +21,10 @@ public sealed class Registration
|
||||
/// as the domain payload; the domain never constructs ZGW concepts from it (§8.1).</summary>
|
||||
public string Bsn { get; }
|
||||
|
||||
/// <summary>Where the diploma was issued. Rides along to the process as a start variable and
|
||||
/// drives the diploma-eligibility DMN's foreign→CBGV-advies routing (S-13, ADR-0016).</summary>
|
||||
public DiplomaOrigin DiplomaOrigin { get; }
|
||||
|
||||
public RegistrationStatus Status { get; private set; }
|
||||
|
||||
/// <summary>The Flowable process instance driving this registration, once started.</summary>
|
||||
@@ -28,11 +33,13 @@ public sealed class Registration
|
||||
/// <summary>The zaak the ACL opened for this registration, once the external task has run.</summary>
|
||||
public Uri? ZaakUrl { get; private set; }
|
||||
|
||||
/// <summary>Submit a new registration. It begins in <see cref="RegistrationStatus.Ingediend"/>.</summary>
|
||||
public static Registration Submit(string bsn)
|
||||
/// <summary>Submit a new registration. It begins in <see cref="RegistrationStatus.Ingediend"/>.
|
||||
/// The diploma origin defaults to <see cref="DiplomaOrigin.Binnenlands"/> — the common DigiD path;
|
||||
/// a foreign (eIDAS) submission passes <see cref="DiplomaOrigin.Buitenlands"/>.</summary>
|
||||
public static Registration Submit(string bsn, DiplomaOrigin diplomaOrigin = DiplomaOrigin.Binnenlands)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(bsn);
|
||||
return new Registration(RegistrationId.New(), bsn);
|
||||
return new Registration(RegistrationId.New(), bsn, diplomaOrigin);
|
||||
}
|
||||
|
||||
/// <summary>Record that the registratie workflow process has been started for this registration.</summary>
|
||||
|
||||
Reference in New Issue
Block a user