Data Layer medium complexity backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

A data access component that manages persistence and retrieval of expense type definitions and their organisation-level configuration overrides. It serves both the admin portal when saving configuration changes and the mobile sync endpoint when devices fetch updated configurations for offline caching. Entity records include validation rules, required fields, and mutual-exclusion relationships.

Feature: Expense Types & Requirements

expense-type-repository

Sources & reasoning

Lines 67 and 112 both explicitly require fixed type choices with technical enforcement of mutual exclusivity, framed as a hard HLF requirement. This is part of Reiserefusjonshåndtering in the Phase 2 roadmap (line 343), placing it at v1.0.

  • docs/source/likeperson.md · line 67
    Faste valg for utleggstype - ikke fritekst - for å hindre feilkombinasjon (f.eks. både km og bussbillett).
  • docs/source/likeperson.md · line 112
    Detaljert refusjonsstyring med faste valg som gjør feilkombinasjon teknisk umulig (f.eks. km + bussbillett kan ikke velges samtidig). Automatisk godkjenning under terskel.

Responsibilities

  • Persist organisation-level expense type configuration including enabled types and mutual-exclusion rules
  • Retrieve the full active configuration for a given organisation
  • Provide a versioned snapshot endpoint used by mobile clients during sync
  • Update type definitions when admins modify available types or rules in the Admin Web Portal

Interfaces

getConfigForOrg(orgId: string): ExpenseTypeConfig
saveConfig(orgId: string, config: ExpenseTypeConfig): void
getConfigVersion(orgId: string): number
listAllTypes(): ExpenseTypeDefinition[]

Related Data Entities (1)

Data entities managed by this component