diff --git a/libs/api-client/src/lib/generated/bff-api.ts b/libs/api-client/src/lib/generated/bff-api.ts index 1828d6e..e806978 100644 --- a/libs/api-client/src/lib/generated/bff-api.ts +++ b/libs/api-client/src/lib/generated/bff-api.ts @@ -24,6 +24,12 @@ import { Observable } from 'rxjs'; +export interface BeheerDefaultFill { + bronorganisatie: string; + verantwoordelijkeOrganisatie: string; + vertrouwelijkheidaanduiding: string; +} + export interface BeheerZaaktype { identificatie: string; omschrijving: string; @@ -446,4 +452,69 @@ export class BffApiV1Service { ); } + getBeheerDefaultFill( options?: HttpClientBodyOptions): Observable; + getBeheerDefaultFill( options?: HttpClientEventOptions): Observable>; + getBeheerDefaultFill( options?: HttpClientResponseOptions): Observable>; + getBeheerDefaultFill( + options?: HttpClientObserveOptions): Observable | AngularHttpResponse> { + if (options?.observe === 'events') { + return this.http.get( + `/beheer/default-fill`,{ + ...(options as Omit, 'observe'>), + observe: 'events', + } + ); + } + + if (options?.observe === 'response') { + return this.http.get( + `/beheer/default-fill`,{ + ...(options as Omit, 'observe'>), + observe: 'response', + } + ); + } + + return this.http.get( + `/beheer/default-fill`,{ + ...(options as Omit, 'observe'>), + observe: 'body', + } + ); + } + + putBeheerDefaultFill(beheerDefaultFill: BeheerDefaultFill, options?: HttpClientBodyOptions): Observable; + putBeheerDefaultFill(beheerDefaultFill: BeheerDefaultFill, options?: HttpClientEventOptions): Observable>; + putBeheerDefaultFill(beheerDefaultFill: BeheerDefaultFill, options?: HttpClientResponseOptions): Observable>; + putBeheerDefaultFill( + beheerDefaultFill: BeheerDefaultFill, options?: HttpClientObserveOptions): Observable | AngularHttpResponse> { + if (options?.observe === 'events') { + return this.http.put( + `/beheer/default-fill`, + beheerDefaultFill,{ + ...(options as Omit, 'observe'>), + observe: 'events', + } + ); + } + + if (options?.observe === 'response') { + return this.http.put( + `/beheer/default-fill`, + beheerDefaultFill,{ + ...(options as Omit, 'observe'>), + observe: 'response', + } + ); + } + + return this.http.put( + `/beheer/default-fill`, + beheerDefaultFill,{ + ...(options as Omit, 'observe'>), + observe: 'body', + } + ); + } + }; diff --git a/services/bff/Bff.Api/Program.cs b/services/bff/Bff.Api/Program.cs index dd9a8f2..ee2a36e 100644 --- a/services/bff/Bff.Api/Program.cs +++ b/services/bff/Bff.Api/Program.cs @@ -228,6 +228,25 @@ app.MapGet("/beheer/catalogi/zaaktypen", async (IAclClient acl, CancellationToke .Produces(StatusCodes.Status401Unauthorized) .Produces(StatusCodes.Status403Forbidden); +// Beheer default-fill config (S-15b): read + edit the ACL's default-fill values. Behind medewerker- +// realm + beheerder authorization; the BFF proxies the ACL (ADR-0025). The ACL validates the values. +app.MapGet("/beheer/default-fill", async (IAclClient acl, CancellationToken ct) => + Results.Ok(await acl.GetDefaultFillAsync(ct))) + .RequireAuthorization(BeheerAuth.Policy) + .Produces(StatusCodes.Status200OK) + .Produces(StatusCodes.Status401Unauthorized) + .Produces(StatusCodes.Status403Forbidden); + +app.MapPut("/beheer/default-fill", async (BeheerDefaultFill body, IAclClient acl, CancellationToken ct) => +{ + await acl.UpdateDefaultFillAsync(body, ct); + return Results.NoContent(); +}) + .RequireAuthorization(BeheerAuth.Policy) + .Produces(StatusCodes.Status204NoContent) + .Produces(StatusCodes.Status401Unauthorized) + .Produces(StatusCodes.Status403Forbidden); + app.Run(); /// The behandelaar's decision on a registration. diff --git a/services/bff/openapi.json b/services/bff/openapi.json index 10b790d..a9a985c 100644 --- a/services/bff/openapi.json +++ b/services/bff/openapi.json @@ -255,10 +255,80 @@ } } } + }, + "/beheer/default-fill": { + "get": { + "tags": [ + "Bff.Api" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BeheerDefaultFill" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + } + }, + "put": { + "tags": [ + "Bff.Api" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BeheerDefaultFill" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + } + } } }, "components": { "schemas": { + "BeheerDefaultFill": { + "required": [ + "bronorganisatie", + "verantwoordelijkeOrganisatie", + "vertrouwelijkheidaanduiding" + ], + "type": "object", + "properties": { + "bronorganisatie": { + "type": "string" + }, + "verantwoordelijkeOrganisatie": { + "type": "string" + }, + "vertrouwelijkheidaanduiding": { + "type": "string" + } + } + }, "BeheerZaaktype": { "required": [ "identificatie",