Fix Mijn aanvragen: instant cancel + one Concept per type (resume)

Two dashboard bugs from the just-built feature.

1. Cancel didn't reflect until a browser refresh. ApplicationsStore now OWNS the
   list in a writable RemoteData signal instead of projecting a resource() through
   fromResource; cancel removes the row synchronously (guaranteed disappear, no
   dependence on CD timing / HTTP cache / the reloading gap), then confirms the
   DELETE (rollback on failure, no resync). Adapter gains list(); applicationsResource()
   removed. Shared fromResource/remote-data.ts deliberately untouched.

2. Duplicate / inconsistent Concepts per type. createDraftSync.resume() now: a
   ?aanvraag link wins; else it resumes THIS type's existing Concept (loads its
   draft); else fresh. ensureId is gated behind resume so a fast typist can't create
   a duplicate before the lookup lands. restart()/reset() deletes the current Concept
   (submitted → 409, kept) so there's at most one active Concept per type. A non-Concept
   id can't reopen as an editable draft. Backend unchanged.

Gates green: lint, vitest 128, build, check:tokens, backend dotnet 56.
Wiring is not unit-covered — needs live verification (see plan).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
eho
2026-07-01 16:34:01 +02:00
co-authored by Claude Opus 4.8
parent 168cf9786c
commit 0f14239f68
4 changed files with 112 additions and 55 deletions
@@ -1,4 +1,4 @@
import { Injectable, inject, resource } from '@angular/core';
import { Injectable, inject } from '@angular/core';
import { Result, ok, err } from '@shared/kernel/fp';
import {
ApiClient,
@@ -23,8 +23,8 @@ export class ApplicationsAdapter {
private client = inject(ApiClient);
/** The dashboard's application list (raw DTOs; the store parses at the boundary). */
applicationsResource() {
return resource({ loader: () => this.client.applicationsAll() });
list(): Promise<ApplicationSummaryDto[]> {
return this.client.applicationsAll();
}
detail(id: string): Promise<ApplicationDetailDto> {