From 2b60f8e51fafe4fb9592f5df328c2c22c96c934a Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Mon, 20 Jul 2026 10:45:24 +0200 Subject: [PATCH] feat(portal): 'Documenten aanleveren' action on the self-service page (refs #102) After submitting, the zorgprofessional supplies their documents; the page posts to the BFF keyed by the reference and confirms ("Uw documenten zijn aangeleverd"), with a surfaced failure + retry. The registration e2e provides documents before the behandelaar step, since the process now parks at WachtOpDocumenten first. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../app/registration/registration-page.html | 18 +++++++++++++++ .../src/app/registration/registration-page.ts | 23 +++++++++++++++++++ tests/e2e/registration.spec.ts | 6 +++++ 3 files changed, 47 insertions(+) diff --git a/apps/self-service/src/app/registration/registration-page.html b/apps/self-service/src/app/registration/registration-page.html index d4739e5..6910880 100644 --- a/apps/self-service/src/app/registration/registration-page.html +++ b/apps/self-service/src/app/registration/registration-page.html @@ -11,6 +11,24 @@

Uw registratie is ontvangen. Referentie: {{ reference() }}.

+ @if (documentsProvided()) { +

Uw documenten zijn aangeleverd.

+ } @else { + @if (provideDocumentsFailed()) { +

+ Het aanleveren van uw documenten is niet gelukt. Probeer het opnieuw. +

+ } + + } @if (withdrawFailed()) {

Het intrekken van uw registratie is niet gelukt. Probeer het opnieuw. diff --git a/apps/self-service/src/app/registration/registration-page.ts b/apps/self-service/src/app/registration/registration-page.ts index a5380de..8c93c48 100644 --- a/apps/self-service/src/app/registration/registration-page.ts +++ b/apps/self-service/src/app/registration/registration-page.ts @@ -26,6 +26,9 @@ export class RegistrationPage { protected readonly withdrawing = signal(false); protected readonly withdrawn = signal(false); protected readonly withdrawFailed = signal(false); + protected readonly providingDocuments = signal(false); + protected readonly documentsProvided = signal(false); + protected readonly provideDocumentsFailed = signal(false); submit(): void { this.submitting.set(true); @@ -44,6 +47,26 @@ export class RegistrationPage { }); } + provideDocuments(): void { + const reference = this.reference(); + if (!reference) { + return; + } + this.providingDocuments.set(true); + this.provideDocumentsFailed.set(false); + this.bff.postSelfServiceRegistrationsIdDocuments(reference).subscribe({ + next: () => { + this.documentsProvided.set(true); + this.providingDocuments.set(false); + }, + // Surface the failure instead of swallowing it: keep the action so the user can retry. + error: () => { + this.provideDocumentsFailed.set(true); + this.providingDocuments.set(false); + }, + }); + } + withdraw(): void { const reference = this.reference(); if (!reference) { diff --git a/tests/e2e/registration.spec.ts b/tests/e2e/registration.spec.ts index c6395ff..3b91bde 100644 --- a/tests/e2e/registration.spec.ts +++ b/tests/e2e/registration.spec.ts @@ -25,6 +25,12 @@ test('DigiD submit → public INGEDIEND → behandelaar goedkeurt → public ING const reference = (await confirmation.textContent())?.match(/Referentie:\s*([0-9a-fA-F-]+)/)?.[1]; expect(reference, 'the confirmation shows a registration reference').toBeTruthy(); + // Provide the documents the registration is waiting for (S-10a): the process parks at + // WachtOpDocumenten right after the zaak is opened, so it only reaches the behandelaar's werkbak once + // the documents are supplied. (S-10b turns this into a real file upload; here it is the trigger.) + await page.getByRole('button', { name: /documenten aanleveren/i }).click(); + await expect(page.getByText(/documenten zijn aangeleverd/i)).toBeVisible(); + // The openbaar register (anonymous, its own origin) shows the submitted entry once the projection // catches up. The projection updates asynchronously (NRC → event-subscriber), and the register loads // on open, so reload until *this* submission's row appears. We poll on the reference cell (not a