ExpenseTypeSelectorWidget
Component Detail
Description
Mobile UI widget that renders the list of allowed expense types for an organization and enforces mutual-exclusivity rules through reactive disabling. When a user selects a type from an exclusion group, all conflicting types in that group become immediately unavailable without requiring a server round-trip. The widget consumes cached configuration and reflects the current selection state visually at all times.
expense-type-selector-widget
Sources & reasoning
Lines 68 and 113 from two separate sections both explicitly require fixed expense type selection that makes invalid combinations technically impossible. The parent area is Fase 2 (line 148), mapping to v1.0. This feature is foundational to travel-expense-registration and must ship in the same release.
-
docs/source/likeperson.md · line 68Faste valg for utleggstype - ikke fritekst - for å hindre feilkombinasjon (f.eks. både km og bussbillett).
-
docs/source/likeperson.md · line 113Detaljert refusjonsstyring med faste valg som gjør feilkombinasjon teknisk umulig (f.eks. km + bussbillett kan ikke velges samtidig). Automatisk godkjenning under terskel.
Responsibilities
- Render the organization's configured expense types as selectable options
- Apply exclusion-group rules reactively, disabling conflicting types on selection
- Read expense type configuration from the local cache for offline support
- Emit the validated selection to the parent form or submission handler
- Display disabling reasons as tooltips or inline labels to guide the user
Interfaces
render(config: ExpenseTypeConfig, currentSelection: string[]): void
onSelectionChange(selectedTypeId: string): void
getActiveSelection(): string[]
resetSelection(): void