feat(acl): CancelZaakAsync service + POST /annuleringen endpoint (S-10c) (refs #106)
The ACL exposes zaak cancellation as a service operation the domain calls on document-timeout expiry; it default-fills the zaaktype and dates the status today, translating the domain intent to the ZGW cancellation status/resultaat. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,34 @@ public class AclServiceTests
|
||||
Assert.Null(gateway.Approved);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Cancelling_a_zaak_sets_it_to_the_cancellation_status_dated_today()
|
||||
{
|
||||
var gateway = new FakeGateway();
|
||||
var defaults = Defaults();
|
||||
var service = new AclService(gateway, defaults, new FixedClock(new DateOnly(2026, 6, 4)));
|
||||
var zaak = new Uri("http://openzaak/zaken/api/v1/zaken/abc");
|
||||
|
||||
await service.CancelZaakAsync(zaak);
|
||||
|
||||
Assert.NotNull(gateway.Cancelled);
|
||||
Assert.Equal(zaak, gateway.Cancelled!.Value.Zaak);
|
||||
Assert.Equal(defaults.ZaaktypeUrl, gateway.Cancelled.Value.Zaaktype);
|
||||
Assert.Equal(new DateOnly(2026, 6, 4), gateway.Cancelled.Value.Datum);
|
||||
// Cancellation must not touch the approval path.
|
||||
Assert.Null(gateway.Approved);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Cancelling_a_null_zaak_is_rejected_without_touching_the_gateway()
|
||||
{
|
||||
var gateway = new FakeGateway();
|
||||
var service = new AclService(gateway, Defaults(), new FixedClock(new DateOnly(2026, 6, 4)));
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => service.CancelZaakAsync(null!));
|
||||
Assert.Null(gateway.Cancelled);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Storing_a_diploma_default_fills_the_document_fields_and_returns_its_url()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user