diff --git a/portal-frontend/src/app/case-detail/case-detail/case-detail.html b/portal-frontend/src/app/case-detail/case-detail/case-detail.html
index 88e3d79..37fa652 100644
--- a/portal-frontend/src/app/case-detail/case-detail/case-detail.html
+++ b/portal-frontend/src/app/case-detail/case-detail/case-detail.html
@@ -1 +1,71 @@
-
case-detail works!
+@if (detail(); as d) {
+ {{ d.surname }}, {{ d.initials }} ({{ d.origin }})
+
+
+ Aanvrager
+
+ - BSN
+ - {{ d.bsn }}
+ - E-mail
+ - {{ d.email ?? 'n.v.t.' }}
+ - Telefoon
+ - {{ d.phone ?? 'n.v.t.' }}
+ - Voorkeurskanaal
+ - {{ d.preferredChannel }}
+ @if (d.address; as address) {
+ - Adres
+ - {{ address.street }} {{ address.number }}, {{ address.postalCode }} {{ address.city }}
+ }
+
+
+
+
+ Diploma
+
+ - Code
+ - {{ d.diplomaCode }}
+ - Land van uitgifte
+ - {{ d.diplomaCountryOfIssue }}
+ - Uitgegeven op
+ - {{ d.diplomaIssuedOn }}
+ - Ontvangen op
+ - {{ d.receivedOn }}
+ - Processtatus
+ - {{ d.processStatus ?? 'n.v.t.' }}
+
+
+
+ @if (d.assessment; as assessment) {
+
+ Beoordeling
+
+ - Uitkomst
+ - {{ assessment.outcome }}
+ - Motivatie
+ - {{ assessment.motivation }}
+ - Gecontroleerde stukken
+ - {{ assessment.verifiedItems.join(', ') || 'geen' }}
+ - Beslist op
+ - {{ assessment.decidedOn }}
+
+
+ }
+
+
+ Seams
+ Toont welk backend elk onderdeel van deze pagina levert.
+
+ @for (seam of d.seams | keyvalue; track seam.key) {
+ - {{ seam.key }}
+ - {{ seam.value ?? 'n.v.t.' }}
+ }
+
+
+
+
+} @else {
+ Laden...
+}
diff --git a/portal-frontend/src/app/case-detail/case-detail/case-detail.spec.ts b/portal-frontend/src/app/case-detail/case-detail/case-detail.spec.ts
index d19497e..659a26e 100644
--- a/portal-frontend/src/app/case-detail/case-detail/case-detail.spec.ts
+++ b/portal-frontend/src/app/case-detail/case-detail/case-detail.spec.ts
@@ -1,22 +1,79 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { ActivatedRoute, convertToParamMap } from '@angular/router';
+import { of } from 'rxjs';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import { CaseDetailService } from '../case-detail.service';
+import { CaseDetail } from '../case-detail.types';
import { CaseDetailPage } from './case-detail';
+const legacyDetail: CaseDetail = {
+ origin: 'Legacy',
+ legacyAanvraagId: 1001,
+ registrationApplicationId: null,
+ surname: 'de Vries',
+ initials: 'A.',
+ bsn: '123456782',
+ address: { street: 'Kerkweg', number: '12', postalCode: '3512JK', city: 'Utrecht' },
+ email: 'anna@example.nl',
+ phone: null,
+ preferredChannel: 'Post',
+ diplomaCode: 'X',
+ diplomaCountryOfIssue: 'NL',
+ diplomaIssuedOn: '2020-01-01',
+ receivedOn: '2026-01-01',
+ assessment: null,
+ processStatus: null,
+ lastModifiedAt: null,
+ actions: {
+ editApplicantDetails: { mode: 'writeThrough', href: '/api/worklist/legacy/1001/details' },
+ recordAssessment: { mode: 'redirect', href: '/legacy/aanvraag/1001/beoordeling' },
+ takeOwnership: { mode: 'transition', href: '/api/worklist/legacy/1001/take-ownership' },
+ },
+ seams: { aanvrager: 'legacy-backend', procestijdlijn: null },
+};
+
+function configure(routeConfigPath: string, paramMap: Record, getLegacyDetail: unknown, getOwnedDetail: unknown) {
+ return TestBed.configureTestingModule({
+ imports: [CaseDetailPage],
+ providers: [
+ { provide: CaseDetailService, useValue: { getLegacyDetail, getOwnedDetail } },
+ {
+ provide: ActivatedRoute,
+ useValue: {
+ paramMap: of(convertToParamMap(paramMap)),
+ snapshot: { routeConfig: { path: routeConfigPath } },
+ },
+ },
+ ],
+ }).compileComponents();
+}
+
describe('CaseDetailPage', () => {
- let component: CaseDetailPage;
let fixture: ComponentFixture;
- beforeEach(async () => {
- await TestBed.configureTestingModule({
- imports: [CaseDetailPage],
- }).compileComponents();
+ it('given a legacy/:id route, fetches via getLegacyDetail and renders the case', async () => {
+ const getLegacyDetail = vi.fn().mockReturnValue(of(legacyDetail));
+ const getOwnedDetail = vi.fn();
+ await configure('legacy/:id', { id: '1001' }, getLegacyDetail, getOwnedDetail);
fixture = TestBed.createComponent(CaseDetailPage);
- component = fixture.componentInstance;
- await fixture.whenStable();
+ fixture.detectChanges();
+
+ expect(getLegacyDetail).toHaveBeenCalledWith('1001');
+ expect(getOwnedDetail).not.toHaveBeenCalled();
+ expect(fixture.nativeElement.textContent).toContain('de Vries');
});
- it('should create', () => {
- expect(component).toBeTruthy();
+ it('given an owned/:id route, fetches via getOwnedDetail', async () => {
+ const getLegacyDetail = vi.fn();
+ const getOwnedDetail = vi.fn().mockReturnValue(of({ ...legacyDetail, origin: 'Owned', legacyAanvraagId: null, registrationApplicationId: 'abc' }));
+ await configure('owned/:id', { id: 'abc' }, getLegacyDetail, getOwnedDetail);
+
+ fixture = TestBed.createComponent(CaseDetailPage);
+ fixture.detectChanges();
+
+ expect(getOwnedDetail).toHaveBeenCalledWith('abc');
+ expect(getLegacyDetail).not.toHaveBeenCalled();
});
});
diff --git a/portal-frontend/src/app/case-detail/case-detail/case-detail.ts b/portal-frontend/src/app/case-detail/case-detail/case-detail.ts
index afcf3ca..a200f1f 100644
--- a/portal-frontend/src/app/case-detail/case-detail/case-detail.ts
+++ b/portal-frontend/src/app/case-detail/case-detail/case-detail.ts
@@ -1,9 +1,29 @@
-import { Component } from '@angular/core';
+import { KeyValuePipe } from '@angular/common';
+import { Component, inject, signal } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
+
+import { CaseActions } from '../case-actions/case-actions';
+import { CaseDetailService } from '../case-detail.service';
+import { CaseDetail } from '../case-detail.types';
@Component({
selector: 'app-case-detail',
- imports: [],
+ imports: [CaseActions, KeyValuePipe],
templateUrl: './case-detail.html',
styleUrl: './case-detail.css',
})
-export class CaseDetailPage {}
+export class CaseDetailPage {
+ private readonly route = inject(ActivatedRoute);
+ private readonly caseDetailService = inject(CaseDetailService);
+
+ readonly detail = signal(null);
+
+ constructor() {
+ this.route.paramMap.subscribe((params) => {
+ const id = params.get('id')!;
+ const isLegacy = this.route.snapshot.routeConfig?.path?.startsWith('legacy') ?? false;
+ const source$ = isLegacy ? this.caseDetailService.getLegacyDetail(id) : this.caseDetailService.getOwnedDetail(id);
+ source$.subscribe((detail) => this.detail.set(detail));
+ });
+ }
+}