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
- File:
frontend/apps/broker/src/features/insurance-subjects/insurance-subject-scope-of-insurance-card.tsx:112 - Severity: Warning
- Category: Frontend lint
- Description: The static scanner flags
cn(data.length === 0 && 'py-8'). The local FE rulebook treats this as theno-classname-ternarypattern: use object-formcn(base, { className: condition })instead of passing a boolean/string expression. - Suggestion: Keep the conditional class but express it in the lint-approved form.
// Current
<CardContent className={cn(data.length === 0 && 'py-8')}>
// Suggested
<CardContent className={cn({ 'py-8': data.length === 0 })}>
Suggestions
frontend/apps/broker/src/features/insurance-subjects/insurance-subject-scope-of-insurance-card.tsx:192: Usesize-6for the squareIconArrowRightinstead of pairedw-6 h-6, matching the local icon-size convention. The same pre-existing pattern appears elsewhere in this file, so this can be cleaned up consistently.frontend/apps/broker/src/features/insurance-scope/additional-products/home-service-detail.tsx:55: Prefer stable data-derived keys overcrypto.randomUUID()for repeated Home Service rows/sections. The currentuseMemolimits churn, but a key fromsectionKeyplus the row identifier/value would be simpler and deterministic.
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
requiredOR nullable - Reuses shared Core enums/types for institution and risk type
-
DateTimeOffsetvalues normalized at ACL boundary - Generated FE Kubb client regenerated
Frontend
- Paraglide
mimports used directly - Design-token colors used for new UI
-
@tabler/icons-reactused 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
networkidleor fixed sleeps in the new tests
Infra / cross-cutting
- Generated FE Kubb client regenerated *** End Patch