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) <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,24 @@
|
|||||||
<p utrecht-paragraph role="status">
|
<p utrecht-paragraph role="status">
|
||||||
Uw registratie is ontvangen. Referentie: {{ reference() }}.
|
Uw registratie is ontvangen. Referentie: {{ reference() }}.
|
||||||
</p>
|
</p>
|
||||||
|
@if (documentsProvided()) {
|
||||||
|
<p utrecht-paragraph role="status">Uw documenten zijn aangeleverd.</p>
|
||||||
|
} @else {
|
||||||
|
@if (provideDocumentsFailed()) {
|
||||||
|
<p utrecht-paragraph role="alert">
|
||||||
|
Het aanleveren van uw documenten is niet gelukt. Probeer het opnieuw.
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
<button
|
||||||
|
utrecht-button
|
||||||
|
appearance="primary-action-button"
|
||||||
|
type="button"
|
||||||
|
[disabled]="providingDocuments()"
|
||||||
|
(click)="provideDocuments()"
|
||||||
|
>
|
||||||
|
Documenten aanleveren
|
||||||
|
</button>
|
||||||
|
}
|
||||||
@if (withdrawFailed()) {
|
@if (withdrawFailed()) {
|
||||||
<p utrecht-paragraph role="alert">
|
<p utrecht-paragraph role="alert">
|
||||||
Het intrekken van uw registratie is niet gelukt. Probeer het opnieuw.
|
Het intrekken van uw registratie is niet gelukt. Probeer het opnieuw.
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ export class RegistrationPage {
|
|||||||
protected readonly withdrawing = signal(false);
|
protected readonly withdrawing = signal(false);
|
||||||
protected readonly withdrawn = signal(false);
|
protected readonly withdrawn = signal(false);
|
||||||
protected readonly withdrawFailed = signal(false);
|
protected readonly withdrawFailed = signal(false);
|
||||||
|
protected readonly providingDocuments = signal(false);
|
||||||
|
protected readonly documentsProvided = signal(false);
|
||||||
|
protected readonly provideDocumentsFailed = signal(false);
|
||||||
|
|
||||||
submit(): void {
|
submit(): void {
|
||||||
this.submitting.set(true);
|
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 {
|
withdraw(): void {
|
||||||
const reference = this.reference();
|
const reference = this.reference();
|
||||||
if (!reference) {
|
if (!reference) {
|
||||||
|
|||||||
@@ -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];
|
const reference = (await confirmation.textContent())?.match(/Referentie:\s*([0-9a-fA-F-]+)/)?.[1];
|
||||||
expect(reference, 'the confirmation shows a registration reference').toBeTruthy();
|
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
|
// 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
|
// 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
|
// on open, so reload until *this* submission's row appears. We poll on the reference cell (not a
|
||||||
|
|||||||
Reference in New Issue
Block a user