Expense Rules Service
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
4
Entities
0
Integrations
Description
Backend service that owns the expense-type catalogue and its governing rules per tenant. Exposes endpoints for clients to fetch the active catalogue at bootstrap and for admins to maintain types, thresholds, and role eligibility.
expense-rules-service
Sources & reasoning
Section 2.1 and 3.3 describe a per-tenant configurable expense-type catalog with exclusion rules and threshold-based auto-approval, distinct from the user-facing registration flow. It sits in Phase 2 (Core Product) alongside the rest of the reimbursement stack.
-
docs/source/likeperson.md · line 40-43Faste valg for utleggstype - ikke fritekst - for å hindre feilkombinasjon (f.eks. både km og bussbillett). ... Automatisk godkjenning under 50 km / uten utlegg, manuell attestering ellers (HLF).
-
docs/source/likeperson.md · line 71Detaljert refusjonsstyring med faste valg som gjør feilkombinasjon teknisk umulig (f.eks. km + bussbillett kan ikke velges samtidig). Automatisk godkjenning under terskel.
Responsibilities
- Serve the tenant-specific expense type catalogue to clients
- Validate CRUD operations on expense types from admin portal
- Enforce role eligibility and mutual exclusivity rule consistency
- Version the catalogue so client bootstrap can detect changes
- Apply tenant-level policy isolation between HLF and Blindeforbundet
Interfaces
getCatalogue(tenantId: string): ExpenseTypeCatalogue
createExpenseType(tenantId: string, type: ExpenseTypeInput): ExpenseType
updateExpenseType(typeId: string, changes: Partial<ExpenseTypeInput>): ExpenseType
deleteExpenseType(typeId: string): void
validateRules(type: ExpenseTypeInput): ValidationResult
Related Data Entities (4)
Data entities managed by this component