feat(acl): GET /catalogi/zaaktypen lists published zaaktypen (refs #130)
This commit is contained in:
@@ -170,9 +170,15 @@ public sealed class OpenZaakGateway(HttpClient http, OpenZaakOptions options) :
|
||||
return new Uri(match.Url);
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<ZaaktypeSummary>> ListZaaktypenAsync(CancellationToken ct = default) =>
|
||||
// ponytail: stub for the red test; real Catalogi read lands in the green commit.
|
||||
throw new NotImplementedException();
|
||||
public async Task<IReadOnlyList<ZaaktypeSummary>> ListZaaktypenAsync(CancellationToken ct = default)
|
||||
{
|
||||
// Only published zaaktypen (status=definitief excludes concepts) — the read-only catalogus the
|
||||
// beheer portal shows. Public-safe fields only.
|
||||
var page = await GetAsync<ZaaktypePage>("/catalogi/api/v1/zaaktypen?status=definitief", "zaaktypen", ct);
|
||||
return (page.Results ?? [])
|
||||
.Select(z => new ZaaktypeSummary(z.Identificatie ?? "", z.Omschrijving ?? "", new Uri(z.Url)))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
// GETs an absolute-by-path ZGW resource with auth (no CRS — catalogi is not a geo API).
|
||||
private async Task<T> GetAsync<T>(string pathAndQuery, string label, CancellationToken ct)
|
||||
@@ -350,7 +356,8 @@ public sealed class OpenZaakGateway(HttpClient http, OpenZaakOptions options) :
|
||||
|
||||
private sealed record ZaaktypeDto(
|
||||
[property: JsonPropertyName("url")] string Url,
|
||||
[property: JsonPropertyName("identificatie")] string? Identificatie);
|
||||
[property: JsonPropertyName("identificatie")] string? Identificatie,
|
||||
[property: JsonPropertyName("omschrijving")] string? Omschrijving = null);
|
||||
|
||||
private sealed record InformatieobjecttypePage(
|
||||
[property: JsonPropertyName("results")] IReadOnlyList<InformatieobjecttypeDto>? Results);
|
||||
|
||||
Reference in New Issue
Block a user