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:
@@ -11,10 +11,12 @@ public interface IWorkflowClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Start one <c>registratie</c> process instance for the given registration, carrying the
|
||||
/// registration id so the <c>OpenZaakAanmaken</c> external task can be correlated back to its
|
||||
/// aggregate. Returns the process instance id.
|
||||
/// registration id (so the <c>OpenZaakAanmaken</c> external task can be correlated back to its
|
||||
/// aggregate) and the diploma origin (so the workflow's DMN can route foreign diplomas through
|
||||
/// CBGV-advies, S-13). Returns the process instance id.
|
||||
/// </summary>
|
||||
Task<string> StartRegistrationProcessAsync(RegistrationId registrationId, CancellationToken ct = default);
|
||||
Task<string> StartRegistrationProcessAsync(
|
||||
RegistrationId registrationId, DiplomaOrigin diplomaOrigin, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Cancel a running <c>registratie</c> process on withdrawal (S-11): correlate the
|
||||
|
||||
@@ -2,8 +2,10 @@ using Big.Domain;
|
||||
|
||||
namespace Big.Application;
|
||||
|
||||
/// <summary>A zorgprofessional's request to register, in domain language. No ZGW concepts.</summary>
|
||||
public sealed record SubmitRegistrationCommand(string Bsn);
|
||||
/// <summary>A zorgprofessional's request to register, in domain language. No ZGW concepts. The
|
||||
/// diploma origin defaults to domestic (the DigiD path); a foreign (eIDAS) submission sets it to
|
||||
/// <see cref="DiplomaOrigin.Buitenlands"/> so the workflow's DMN routes it through CBGV-advies (S-13).</summary>
|
||||
public sealed record SubmitRegistrationCommand(string Bsn, DiplomaOrigin DiplomaOrigin = DiplomaOrigin.Binnenlands);
|
||||
|
||||
/// <summary>
|
||||
/// The submit use case: create the <see cref="Registration"/> aggregate (INGEDIEND), persist it,
|
||||
@@ -18,13 +20,14 @@ public sealed class SubmitRegistration(IRegistrationStore store, IWorkflowClient
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var registration = Registration.Submit(command.Bsn);
|
||||
var registration = Registration.Submit(command.Bsn, command.DiplomaOrigin);
|
||||
|
||||
// Persist before starting the process so the worker can correlate the OpenZaakAanmaken
|
||||
// job back to an aggregate that already exists (ADR-0009).
|
||||
await store.SaveAsync(registration, ct);
|
||||
|
||||
var processInstanceId = await workflow.StartRegistrationProcessAsync(registration.Id, ct);
|
||||
var processInstanceId = await workflow.StartRegistrationProcessAsync(
|
||||
registration.Id, registration.DiplomaOrigin, ct);
|
||||
registration.RecordProcessStarted(processInstanceId);
|
||||
await store.SaveAsync(registration, ct);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user