Merge Request Info
| Field | Value |
|---|---|
| Title | feat(ui): render insurance additional products generically on risk detail |
| Author | @navratilda |
| Reviewers | @blaskom |
| Branch | feature/4287-ta -> main |
| Labels | Backend, Frontend, Tests |
| Created | 2026-06-22 |
| Pipeline | Passed (45736) |
| Conflicts | No |
| State | opened, ready |
| URL | https://gitlab.allrisk.cz/core/core/-/merge_requests/1149 |
Summary
This MR adds generic rendering for insurance additional products on vehicle risk detail and scope-of-insurance views, including backend contract shape, generated clients, k6 coverage, FE mapping helpers, and Playwright coverage. The overall direction matches the requested product model, but the backend contract currently contains duplicate Institution members/assignments and needs to be fixed before merge.
Review Verdict
REQUEST CHANGES
The MR should not merge until the duplicate backend Institution property and object-initializer assignments are removed. There is also one FE lint/style cleanup from the local scanner.
Existing Review Threads
general(@coderabbitai): automated walkthrough/commentary only; no team-raised blocking thread observed in the discussions payload.
Changed Files Overview
Critical Issues
Issue 1: Duplicate Institution member and duplicate object-initializer assignments break backend compilation
- File:
backend/src/Allrisk.Core.Contracts/Core/Contracts/InsuranceContract/AdditionalProducts/InsuranceAdditionalProduct.cs:28 - Severity: Critical
- Category: Correctness / Build
- Description:
InsuranceAdditionalProductdeclarespublic Institution? Institution { get; set; }twice: once afterCategoryName, then again afterProductCode. C# does not allow duplicate members with the same name/signature, so this file will not compile. - Suggestion: Keep one property with the intended semantics. If both upstream insurer and brokerage brand are required by the UI, introduce two explicitly named properties and regenerate FE/k6 clients.
// Current
public Institution? Institution { get; set; }
public string? ProductCode { get; set; }
public Institution? Institution { get; set; }
// Suggested, if one logo field is enough
public Institution? Institution { get; set; }
public string? ProductCode { get; set; }
Issue 2: The mapper assigns Institution twice in the same object initializer
- File:
backend/src/Allrisk.Core.Contracts/Infrastructure/Services/AllriskContractDtoMapper/AllriskContractDtoMapper.AdditionalProducts.cs:133 - Severity: Critical
- Category: Correctness / Build
- Description:
BuildAllriskStickerProduct()setsInstitution = Institution.Allrisktwice, andBuildTechnicalAssistanceProduct()setsInstitution = institutionand thenInstitution = Institution.Allrisk. Even after fixing the duplicate property declaration, these duplicate initializers will still fail compilation and the two assignments encode conflicting semantics. - Suggestion: Decide whether this field represents the upstream insurer or the displayed brokerage brand, then assign it once. If both values are needed, model them as separate properties and update generated clients/tests.
// Current
Institution = institution,
ProductCode = null,
Institution = Institution.Allrisk,
// Suggested, if the field means upstream insurer
Institution = institution,
ProductCode = null,
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 local scanner flags
cn(data.length === 0 && 'py-8'). The local FE rulebook prefers object-form conditional classes rather than boolean/string expressions. - 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. Similar existing instances can be cleaned up together.
Positive Highlights
- FE Kubb client regeneration is present with the backend contract change.
- k6 generated schema/types are present; the scanner's generic "C# changed without k6 generated client" heuristic is not applicable here.
- Mapping helpers have focused unit coverage, including locale fallback and visibility behavior.
- The E2E coverage uses central helpers/test data and asserts seeded scope-product behavior.
Testing Assessment
| Aspect | Status |
|---|---|
| New tests added? | Yes |
| k6 for new endpoints? | N/A; k6 contract/generated coverage updated |
| Existing tests passing? | Pipeline passed; local tests not run in this repair pass |
| Edge cases covered? | Good |
| Test quality | Good |
Checklist
Backend
- Core properties are uniquely named and compile
- Mapper object initializers assign each property once
- Reuses shared Core enums/types for institution and risk type
-
DateTimeOffsetvalues normalized at ACL boundary
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 helpers/test data
- E2E asserts real seeded values
- k6 generated client/schema updated
Infra / cross-cutting
- Generated FE Kubb client regenerated
- k6 generated client regenerated