MR !1150

Draft: feat(ui): render insurance additional products generically on risk detail @navratilda · 2026-06-22

APPROVE WITH MINOR SUGGESTIONS

Merge Request Info

Field Value
Title Draft: feat(ui): render insurance additional products generically on risk detail
Author @navratilda
Reviewers @blaskom
Branch feature/4662-home-service -> main
Labels Frontend, Tests
Created 2026-06-22
Pipeline Passed (45736)
Conflicts No
State opened, draft
URL https://gitlab.allrisk.cz/core/core/-/merge_requests/1150

Summary

This MR generalizes vehicle additional-product rendering across quick overview, scope-of-insurance rows, and risk-detail tabs, including Home Service detail rendering. It also regenerates the FE API client, adds backend seed/mapping support, and covers the new behavior with focused unit and Playwright tests. The implementation looks directionally sound; only small FE lint/style cleanups remain.

Review Verdict

APPROVE WITH MINOR SUGGESTIONS

No blocking correctness or contract-regeneration issue found. Please clean up the lint-level cn(...) pattern before merge.

Existing Review Threads

  • general (@coderabbitai): "Review skipped. Draft detected." - open.

Changed Files Overview

File Change Type Lines +/- Risk
backend/src/Allrisk.Core.Contracts/Infrastructure/Services/AllriskContractDtoMapper/AllriskContractDtoMapper.AdditionalProducts.cs Modified +7 / -2 Medium
backend/src/Allrisk.Core.Contracts/Core/Contracts/InsuranceContract/AdditionalProducts/InsuranceAdditionalProduct.cs Modified +7 / -0 Medium
backend/src/Allrisk.Core.Contracts/Application/Commands/QaAutomation/**/VehicleInsurance.cs Modified +7 / -2 Low
frontend/apps/broker/src/features/insurance-scope/additional-products/** Added +1097 / -0 Medium
frontend/apps/broker/src/features/insurance-scope/insurance-risk-content.tsx Modified +42 / -5 Medium
frontend/apps/broker/src/features/insurance-subjects/Vehicle/vehicle-insurance-subject-quick-overview.tsx Modified +48 / -59 Medium
frontend/apps/broker/src/features/insurance-subjects/insurance-subject-scope-of-insurance-card.tsx Modified +48 / -6 Medium
frontend/apps/broker/e2e/** Added/Modified +196 / -0 Medium
frontend/packages/api/src/client/** Generated +22 / -0 Medium
docs/specs/4287-ta/**, docs/specs/4662-home-service/** Added +652 / -0 Low

Critical Issues

None.

Warnings

Issue 1: cn(...) uses the banned falsy-class pattern

// Current
<CardContent className={cn(data.length === 0 && 'py-8')}>

// Suggested
<CardContent className={cn({ 'py-8': data.length === 0 })}>

Suggestions

Positive Highlights

  • FE Kubb client regeneration is present with the backend contract change.
  • Home Service grouping and translation behavior has focused unit coverage.
  • The E2E tests use central locators/test data and assert seeded values rather than only checking that a card exists.
  • The backend ACL keeps locale dictionaries on cs / sk / en, matching the brand locale type.

Testing Assessment

Aspect Status
New tests added? Yes
k6 for new endpoints? N/A
Existing tests passing? Pipeline passed; local tests not run in this repair pass
Edge cases covered? Good
Test quality Good

Checklist

Backend

  • Core props are required OR nullable
  • Reuses shared Core enums/types for institution and risk type
  • DateTimeOffset values normalized at ACL boundary
  • Generated FE Kubb client regenerated

Frontend

  • Paraglide m imports used directly
  • Design-token colors used for new UI
  • @tabler/icons-react used for new icons
  • Generated API types used instead of hand-written HTTP types
  • No GritQL-banned class composition patterns

Testing

  • New unit tests added for mapping/rendering helpers
  • E2E uses central e2e/data/locators/*
  • E2E asserts real seeded values
  • No networkidle or fixed sleeps in the new tests

Infra / cross-cutting

  • Generated FE Kubb client regenerated *** End Patch