feat(workflow): emit diplomaOrigin start variable + accept it on submit (S-13, refs #14)
The Workflow Client now posts diplomaOrigin alongside registrationId when starting the process, and the domain submit endpoint accepts an optional diplomaOrigin (defaulting to domestic) so a foreign submission can be driven end-to-end. Adds the aggregate + submit-forwarding tests now that the plumbing is in place. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,15 @@ public class RegistrationTests
|
||||
Assert.Null(registration.ProcessInstanceId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_registration_defaults_to_a_domestic_diploma()
|
||||
=> Assert.Equal(DiplomaOrigin.Binnenlands, Registration.Submit("123456782").DiplomaOrigin);
|
||||
|
||||
[Fact]
|
||||
public void A_foreign_diploma_submission_records_its_origin()
|
||||
=> Assert.Equal(DiplomaOrigin.Buitenlands,
|
||||
Registration.Submit("123456782", DiplomaOrigin.Buitenlands).DiplomaOrigin);
|
||||
|
||||
[Theory]
|
||||
[InlineData("")]
|
||||
[InlineData(" ")]
|
||||
|
||||
@@ -25,6 +25,19 @@ public class SubmitRegistrationTests
|
||||
Assert.Equal(2, store.SaveCount);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Submitting_a_foreign_diploma_carries_its_origin_to_the_process()
|
||||
{
|
||||
var store = new FakeRegistrationStore();
|
||||
var workflow = new FakeWorkflowClient();
|
||||
var handler = new SubmitRegistration(store, workflow);
|
||||
|
||||
var id = await handler.HandleAsync(new SubmitRegistrationCommand("123456782", DiplomaOrigin.Buitenlands));
|
||||
|
||||
Assert.Equal(DiplomaOrigin.Buitenlands, (await store.GetAsync(id))!.DiplomaOrigin);
|
||||
Assert.Equal(DiplomaOrigin.Buitenlands, workflow.StartedWithOrigin);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Rejects_a_null_command_without_touching_the_store_or_workflow()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user