test(acl): OpenZaak default-fills ZGW fields and posts to OpenZaak (refs #5)

Add the ACL skeleton (Application/Infrastructure/Api per §9) and failing
xUnit tests for the single operation: AclService.OpenZaakAsync must
default-fill bronorganisatie, verantwoordelijkeOrganisatie, startdatum
(clock) and vertrouwelijkheidaanduiding and delegate to the gateway; the
OpenZaakGateway must POST the zaak to OpenZaak with a Bearer JWT and the
default-filled body. Implementations throw NotImplementedException — red.

Also add ADR-0003 (default-fill strategy).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 09:44:12 +02:00
parent 71b76a0ef9
commit d666e71446
22 changed files with 384 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using Acl.Application;
using Acl.Infrastructure;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton<IClock, SystemClock>();
builder.Services.AddSingleton(sp => sp.GetRequiredService<IConfiguration>()
.GetSection("Acl:Defaults").Get<AclDefaults>()
?? throw new InvalidOperationException("Missing configuration section 'Acl:Defaults'"));
builder.Services.AddSingleton(sp => sp.GetRequiredService<IConfiguration>()
.GetSection("Acl:OpenZaak").Get<OpenZaakOptions>()
?? throw new InvalidOperationException("Missing configuration section 'Acl:OpenZaak'"));
builder.Services.AddHttpClient<IZaakGateway, OpenZaakGateway>();
builder.Services.AddScoped<AclService>();
var app = builder.Build();
app.MapGet("/health", () => "Healthy");
// The ACL's single operation, exposed as a service endpoint.
app.MapPost("/zaken", async (OpenZaakRequest body, AclService acl, CancellationToken ct) =>
{
var zaakUrl = await acl.OpenZaakAsync(new DomainRegistration(body.Bsn), ct);
return Results.Ok(new { zaakUrl = zaakUrl.ToString() });
});
app.Run();
public sealed record OpenZaakRequest(string Bsn);
public partial class Program;