## What & why After submitting, the self-service portal held the registration only in in-memory signals, so a **page refresh stranded an in-flight registration** — the reference and its "Documenten aanleveren" / "Trek aanvraag in" actions were lost, with no way back (the reference wasn't in the URL and there was no read endpoint). This is the gap a citizen hit in testing. Now the portal **resumes on load**: - **Domain:** `IRegistrationStore.FindOpenByBsnAsync` (the citizen's non-terminal INGEDIEND/IN_BEHANDELING registration) + `GET /registrations/current?bsn=`. - **BFF:** owner-scoped `GET /self-service/registrations` (bsn from the DigiD token) → the current registration, or **204** when none. Regenerated `services/bff/openapi.json`. - **Frontend:** `registration-page` calls it on init and restores the submitted view (reference + actions); 204 shows the submit form as before. api-client regenerated (orval). Closes #111 ## Definition of Done - [x] Linked issue (#111). - [x] TDD — store `FindOpenByBsnAsync` tests, BFF endpoint tests, an Angular component test (resume-on-load), a Playwright e2e (submit → reload → restored). - [x] Conventional Commits referencing #111. - [ ] CI green — validated locally (below); runner CI running. - [x] `docker compose up` reaches green health — fresh stack + full e2e (3 specs) green. - [x] Docs — `docs/synthetic-data.md` (new e2e users). - [ ] ADR — N/A (follows existing BFF/domain patterns; no boundary change). - [ ] Demo note — the flow is unchanged for the demo; no new demo-script section (happy to add one if wanted). ## Verified locally - Unit: Big 141 (+7 store tests), Bff 36 (+3 endpoint tests), all suites green. - Frontend: 12 self-service component tests (incl. resume-on-load); lint + build green. - **e2e (fresh CI stack): all 3 specs pass** — `registration`, `resume`, `withdrawal` (29.5s, single worker). - Mutation: domain **91.04%**, bff **100%** (break 90%). `make lint` clean. ## Notes for reviewers - **Shared-stack isolation:** resume-on-load restores any open registration for the logged-in bsn, so the self-service e2e specs can no longer share `jan-burger` (the verify-* API checks submit as `jan-burger`/`123456782` before the e2e). Each spec now has its own DigiD citizen (`emma`/`sanne`/`lars`-burger); `jan-burger` stays the documented citizen for the verify checks. This is the fix for the two intermittent e2e failures seen during development. - **Scope:** resumes the current **in-flight** registration only (terminal ones aren't resumed), per the issue's out-of-scope note. Reviewed-on: #119
414 lines
13 KiB
TypeScript
414 lines
13 KiB
TypeScript
/**
|
|
* Generated by orval v8.19.0 🍺
|
|
* Do not edit manually.
|
|
* Bff.Api | v1
|
|
* OpenAPI spec version: 1.0.0
|
|
*/
|
|
import {
|
|
HttpClient,
|
|
HttpHeaders,
|
|
HttpResponse as AngularHttpResponse
|
|
} from '@angular/common/http';
|
|
import type {
|
|
HttpContext,
|
|
HttpEvent,
|
|
HttpParams
|
|
} from '@angular/common/http';
|
|
|
|
import {
|
|
Injectable,
|
|
inject
|
|
} from '@angular/core';
|
|
|
|
import {
|
|
Observable
|
|
} from 'rxjs';
|
|
|
|
export interface CurrentRegistration {
|
|
registrationId: string;
|
|
status: string;
|
|
}
|
|
|
|
export interface DecideRequest {
|
|
besluit: string;
|
|
}
|
|
|
|
export interface OpenbaarEntry {
|
|
id: string;
|
|
status: string;
|
|
/** @nullable */
|
|
reference: string | null;
|
|
}
|
|
|
|
export interface ProvideDocumentsRequest {
|
|
contentBase64: string;
|
|
/** @nullable */
|
|
fileName?: string | null;
|
|
/** @nullable */
|
|
contentType?: string | null;
|
|
}
|
|
|
|
export interface SubmitAccepted {
|
|
registrationId: string;
|
|
status: string;
|
|
}
|
|
|
|
export interface WerkbakItem {
|
|
registrationId: string;
|
|
bsn: string;
|
|
status: string;
|
|
}
|
|
|
|
export type GetOpenbaarRegisterParams = {
|
|
q?: string;
|
|
};
|
|
|
|
interface HttpClientOptions {
|
|
readonly headers?: HttpHeaders | Record<string, string | string[]>;
|
|
readonly context?: HttpContext;
|
|
readonly params?:
|
|
| HttpParams
|
|
| Record<string, string | number | boolean | Array<string | number | boolean>>;
|
|
readonly reportProgress?: boolean;
|
|
readonly withCredentials?: boolean;
|
|
readonly credentials?: RequestCredentials;
|
|
readonly keepalive?: boolean;
|
|
readonly priority?: RequestPriority;
|
|
readonly cache?: RequestCache;
|
|
readonly mode?: RequestMode;
|
|
readonly redirect?: RequestRedirect;
|
|
readonly referrer?: string;
|
|
readonly integrity?: string;
|
|
readonly referrerPolicy?: ReferrerPolicy;
|
|
readonly transferCache?: {includeHeaders?: string[]} | boolean;
|
|
readonly timeout?: number;
|
|
}
|
|
|
|
type HttpClientBodyOptions = HttpClientOptions & {
|
|
readonly observe?: 'body';
|
|
};
|
|
|
|
type HttpClientEventOptions = HttpClientOptions & {
|
|
readonly observe: 'events';
|
|
};
|
|
|
|
type HttpClientResponseOptions = HttpClientOptions & {
|
|
readonly observe: 'response';
|
|
};
|
|
|
|
type HttpClientObserveOptions = HttpClientOptions & {
|
|
readonly observe?: 'body' | 'events' | 'response';
|
|
};
|
|
|
|
type AngularHttpParamValue = string | number | boolean | Array<string | number | boolean>;
|
|
type AngularHttpParamValueWithNullable = AngularHttpParamValue | null;
|
|
|
|
function filterParams(
|
|
params: Record<string, unknown>,
|
|
requiredNullableKeys?: ReadonlySet<string>,
|
|
preserveRequiredNullables?: false,
|
|
passthroughKeys?: undefined,
|
|
): Record<string, AngularHttpParamValue>;
|
|
function filterParams(
|
|
params: Record<string, unknown>,
|
|
requiredNullableKeys: ReadonlySet<string> | undefined,
|
|
preserveRequiredNullables: true,
|
|
passthroughKeys?: undefined,
|
|
): Record<string, AngularHttpParamValueWithNullable>;
|
|
function filterParams(
|
|
params: Record<string, unknown>,
|
|
requiredNullableKeys: ReadonlySet<string> | undefined,
|
|
preserveRequiredNullables: boolean | undefined,
|
|
passthroughKeys: ReadonlySet<string>,
|
|
): Record<string, unknown>;
|
|
function filterParams(
|
|
params: Record<string, unknown>,
|
|
requiredNullableKeys: ReadonlySet<string> = new Set(),
|
|
preserveRequiredNullables = false,
|
|
passthroughKeys: ReadonlySet<string> = new Set(),
|
|
): Record<string, unknown> {
|
|
const filteredParams: Record<string, unknown> = {};
|
|
for (const [key, value] of Object.entries(params)) {
|
|
if (passthroughKeys.has(key)) {
|
|
if (value !== undefined) {
|
|
filteredParams[key] = value;
|
|
}
|
|
continue;
|
|
}
|
|
if (Array.isArray(value)) {
|
|
const filtered = value.filter(
|
|
(item) =>
|
|
item != null &&
|
|
(typeof item === 'string' ||
|
|
typeof item === 'number' ||
|
|
typeof item === 'boolean'),
|
|
) as Array<string | number | boolean>;
|
|
if (filtered.length) {
|
|
filteredParams[key] = filtered;
|
|
}
|
|
} else if (
|
|
preserveRequiredNullables &&
|
|
value === null &&
|
|
requiredNullableKeys.has(key)
|
|
) {
|
|
filteredParams[key] = null;
|
|
} else if (
|
|
value != null &&
|
|
(typeof value === 'string' ||
|
|
typeof value === 'number' ||
|
|
typeof value === 'boolean')
|
|
) {
|
|
filteredParams[key] = value;
|
|
}
|
|
}
|
|
return filteredParams;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Injectable({ providedIn: 'root' })
|
|
export class BffApiV1Service {
|
|
private readonly http = inject(HttpClient);
|
|
postSelfServiceRegistrations<TData = SubmitAccepted>( options?: HttpClientBodyOptions): Observable<TData>;
|
|
postSelfServiceRegistrations<TData = SubmitAccepted>( options?: HttpClientEventOptions): Observable<HttpEvent<TData>>;
|
|
postSelfServiceRegistrations<TData = SubmitAccepted>( options?: HttpClientResponseOptions): Observable<AngularHttpResponse<TData>>;
|
|
postSelfServiceRegistrations<TData = SubmitAccepted>(
|
|
options?: HttpClientObserveOptions): Observable<TData | HttpEvent<TData> | AngularHttpResponse<TData>> {
|
|
if (options?.observe === 'events') {
|
|
return this.http.post<TData>(
|
|
`/self-service/registrations`,
|
|
undefined,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'events',
|
|
}
|
|
);
|
|
}
|
|
|
|
if (options?.observe === 'response') {
|
|
return this.http.post<TData>(
|
|
`/self-service/registrations`,
|
|
undefined,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'response',
|
|
}
|
|
);
|
|
}
|
|
|
|
return this.http.post<TData>(
|
|
`/self-service/registrations`,
|
|
undefined,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'body',
|
|
}
|
|
);
|
|
}
|
|
|
|
getSelfServiceRegistrations<TData = CurrentRegistration | void>( options?: HttpClientBodyOptions): Observable<TData>;
|
|
getSelfServiceRegistrations<TData = CurrentRegistration | void>( options?: HttpClientEventOptions): Observable<HttpEvent<TData>>;
|
|
getSelfServiceRegistrations<TData = CurrentRegistration | void>( options?: HttpClientResponseOptions): Observable<AngularHttpResponse<TData>>;
|
|
getSelfServiceRegistrations<TData = CurrentRegistration | void>(
|
|
options?: HttpClientObserveOptions): Observable<TData | HttpEvent<TData> | AngularHttpResponse<TData>> {
|
|
if (options?.observe === 'events') {
|
|
return this.http.get<TData>(
|
|
`/self-service/registrations`,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'events',
|
|
}
|
|
);
|
|
}
|
|
|
|
if (options?.observe === 'response') {
|
|
return this.http.get<TData>(
|
|
`/self-service/registrations`,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'response',
|
|
}
|
|
);
|
|
}
|
|
|
|
return this.http.get<TData>(
|
|
`/self-service/registrations`,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'body',
|
|
}
|
|
);
|
|
}
|
|
|
|
postSelfServiceRegistrationsIdWithdraw<TData = void>(id: string, options?: HttpClientBodyOptions): Observable<TData>;
|
|
postSelfServiceRegistrationsIdWithdraw<TData = void>(id: string, options?: HttpClientEventOptions): Observable<HttpEvent<TData>>;
|
|
postSelfServiceRegistrationsIdWithdraw<TData = void>(id: string, options?: HttpClientResponseOptions): Observable<AngularHttpResponse<TData>>;
|
|
postSelfServiceRegistrationsIdWithdraw<TData = void>(
|
|
id: string, options?: HttpClientObserveOptions): Observable<TData | HttpEvent<TData> | AngularHttpResponse<TData>> {
|
|
if (options?.observe === 'events') {
|
|
return this.http.post<TData>(
|
|
`/self-service/registrations/${id}/withdraw`,
|
|
undefined,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'events',
|
|
}
|
|
);
|
|
}
|
|
|
|
if (options?.observe === 'response') {
|
|
return this.http.post<TData>(
|
|
`/self-service/registrations/${id}/withdraw`,
|
|
undefined,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'response',
|
|
}
|
|
);
|
|
}
|
|
|
|
return this.http.post<TData>(
|
|
`/self-service/registrations/${id}/withdraw`,
|
|
undefined,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'body',
|
|
}
|
|
);
|
|
}
|
|
|
|
postSelfServiceRegistrationsIdDocuments<TData = void>(id: string,
|
|
provideDocumentsRequest: ProvideDocumentsRequest, options?: HttpClientBodyOptions): Observable<TData>;
|
|
postSelfServiceRegistrationsIdDocuments<TData = void>(id: string,
|
|
provideDocumentsRequest: ProvideDocumentsRequest, options?: HttpClientEventOptions): Observable<HttpEvent<TData>>;
|
|
postSelfServiceRegistrationsIdDocuments<TData = void>(id: string,
|
|
provideDocumentsRequest: ProvideDocumentsRequest, options?: HttpClientResponseOptions): Observable<AngularHttpResponse<TData>>;
|
|
postSelfServiceRegistrationsIdDocuments<TData = void>(
|
|
id: string,
|
|
provideDocumentsRequest: ProvideDocumentsRequest, options?: HttpClientObserveOptions): Observable<TData | HttpEvent<TData> | AngularHttpResponse<TData>> {
|
|
if (options?.observe === 'events') {
|
|
return this.http.post<TData>(
|
|
`/self-service/registrations/${id}/documents`,
|
|
provideDocumentsRequest,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'events',
|
|
}
|
|
);
|
|
}
|
|
|
|
if (options?.observe === 'response') {
|
|
return this.http.post<TData>(
|
|
`/self-service/registrations/${id}/documents`,
|
|
provideDocumentsRequest,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'response',
|
|
}
|
|
);
|
|
}
|
|
|
|
return this.http.post<TData>(
|
|
`/self-service/registrations/${id}/documents`,
|
|
provideDocumentsRequest,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'body',
|
|
}
|
|
);
|
|
}
|
|
|
|
getOpenbaarRegister<TData = OpenbaarEntry[]>(params?: GetOpenbaarRegisterParams, options?: HttpClientBodyOptions): Observable<TData>;
|
|
getOpenbaarRegister<TData = OpenbaarEntry[]>(params?: GetOpenbaarRegisterParams, options?: HttpClientEventOptions): Observable<HttpEvent<TData>>;
|
|
getOpenbaarRegister<TData = OpenbaarEntry[]>(params?: GetOpenbaarRegisterParams, options?: HttpClientResponseOptions): Observable<AngularHttpResponse<TData>>;
|
|
getOpenbaarRegister<TData = OpenbaarEntry[]>(
|
|
params?: GetOpenbaarRegisterParams, options?: HttpClientObserveOptions): Observable<TData | HttpEvent<TData> | AngularHttpResponse<TData>> {
|
|
const filteredParams = filterParams({...params, ...options?.params}, new Set<string>([]));
|
|
|
|
if (options?.observe === 'events') {
|
|
return this.http.get<TData>(
|
|
`/openbaar/register`,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'events',
|
|
params: filteredParams,}
|
|
);
|
|
}
|
|
|
|
if (options?.observe === 'response') {
|
|
return this.http.get<TData>(
|
|
`/openbaar/register`,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'response',
|
|
params: filteredParams,}
|
|
);
|
|
}
|
|
|
|
return this.http.get<TData>(
|
|
`/openbaar/register`,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'body',
|
|
params: filteredParams,}
|
|
);
|
|
}
|
|
|
|
getBehandelWerkbak<TData = WerkbakItem[]>( options?: HttpClientBodyOptions): Observable<TData>;
|
|
getBehandelWerkbak<TData = WerkbakItem[]>( options?: HttpClientEventOptions): Observable<HttpEvent<TData>>;
|
|
getBehandelWerkbak<TData = WerkbakItem[]>( options?: HttpClientResponseOptions): Observable<AngularHttpResponse<TData>>;
|
|
getBehandelWerkbak<TData = WerkbakItem[]>(
|
|
options?: HttpClientObserveOptions): Observable<TData | HttpEvent<TData> | AngularHttpResponse<TData>> {
|
|
if (options?.observe === 'events') {
|
|
return this.http.get<TData>(
|
|
`/behandel/werkbak`,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'events',
|
|
}
|
|
);
|
|
}
|
|
|
|
if (options?.observe === 'response') {
|
|
return this.http.get<TData>(
|
|
`/behandel/werkbak`,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'response',
|
|
}
|
|
);
|
|
}
|
|
|
|
return this.http.get<TData>(
|
|
`/behandel/werkbak`,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'body',
|
|
}
|
|
);
|
|
}
|
|
|
|
postBehandelRegistrationsIdDecide<TData = void>(id: string,
|
|
decideRequest: DecideRequest, options?: HttpClientBodyOptions): Observable<TData>;
|
|
postBehandelRegistrationsIdDecide<TData = void>(id: string,
|
|
decideRequest: DecideRequest, options?: HttpClientEventOptions): Observable<HttpEvent<TData>>;
|
|
postBehandelRegistrationsIdDecide<TData = void>(id: string,
|
|
decideRequest: DecideRequest, options?: HttpClientResponseOptions): Observable<AngularHttpResponse<TData>>;
|
|
postBehandelRegistrationsIdDecide<TData = void>(
|
|
id: string,
|
|
decideRequest: DecideRequest, options?: HttpClientObserveOptions): Observable<TData | HttpEvent<TData> | AngularHttpResponse<TData>> {
|
|
if (options?.observe === 'events') {
|
|
return this.http.post<TData>(
|
|
`/behandel/registrations/${id}/decide`,
|
|
decideRequest,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'events',
|
|
}
|
|
);
|
|
}
|
|
|
|
if (options?.observe === 'response') {
|
|
return this.http.post<TData>(
|
|
`/behandel/registrations/${id}/decide`,
|
|
decideRequest,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'response',
|
|
}
|
|
);
|
|
}
|
|
|
|
return this.http.post<TData>(
|
|
`/behandel/registrations/${id}/decide`,
|
|
decideRequest,{
|
|
...(options as Omit<NonNullable<typeof options>, 'observe'>),
|
|
observe: 'body',
|
|
}
|
|
);
|
|
}
|
|
|
|
};
|