From 681af334bf8ff713da5c38a85aa2c7d783994ed1 Mon Sep 17 00:00:00 2001 From: Bastian Wagner Date: Sat, 22 Aug 2026 20:20:26 +0200 Subject: [PATCH] fix(web): make ShopOfferView.effectSummary/requirements required The server always sends both fields; an optional frontend type only dodged a transient gap in merchant.store.spec.ts's shopView() fixture and risked a requirement line silently failing to render if a future fixture omitted the fields. Add the two fields to that single fixture instead (an open offer, so null/[] are the honest values) and drop the now-unnecessary `?? []` tolerance in the template. --- apps/web/src/app/core/api/game-api.models.ts | 9 ++------- .../src/app/features/npc/merchant-page.component.html | 2 +- apps/web/src/app/features/npc/merchant.store.spec.ts | 2 ++ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/web/src/app/core/api/game-api.models.ts b/apps/web/src/app/core/api/game-api.models.ts index d7d1a6e..f05f567 100644 --- a/apps/web/src/app/core/api/game-api.models.ts +++ b/apps/web/src/app/core/api/game-api.models.ts @@ -446,13 +446,8 @@ export interface ShopOfferView { currencyType: string; price: number; quantity: number; - /** - * Optional so fixtures written before slice 0.8.5 (e.g. the trade-in store's - * own spec, out of this task's scope) keep compiling untouched. The server - * always sends both fields; the template treats a missing one as "none". - */ - effectSummary?: string | null; - requirements?: ShopOfferRequirement[]; + effectSummary: string | null; + requirements: ShopOfferRequirement[]; unlocked: boolean; affordable: boolean; } diff --git a/apps/web/src/app/features/npc/merchant-page.component.html b/apps/web/src/app/features/npc/merchant-page.component.html index 6da1ea0..9850ecd 100644 --- a/apps/web/src/app/features/npc/merchant-page.component.html +++ b/apps/web/src/app/features/npc/merchant-page.component.html @@ -228,7 +228,7 @@ }} } @for ( - requirement of offer.requirements ?? []; + requirement of offer.requirements; track requirement.label ) {