Service Layer medium complexity backend
0
Dependencies
0
Dependents
7
Entities
0
Integrations

Description

Business logic layer that processes expense submissions, applies org-configured auto-approval rules, and routes claims to the appropriate approval queue. Handles threshold evaluation for km allowance and receipt requirements, and prepares data for accounting exports to HLF and Blindeforbundet.

Feature: Travel Expense Registration

expense-service

Sources & reasoning

Section 2.1 (line 65) and the Phase 2 roadmap (line 343) explicitly name travel expense registration as a Phase 2 deliverable. Priority matrix (line 148) marks it SHOULD HAVE / Phase 2, mapping to v1.0. The threshold-based auto-approval is a stated HLF requirement (line 69).

  • docs/source/likeperson.md · line 65
    Begge organisasjoner har behov for registrering av kilometergodtgjørelse, bompenger, parkering og kollektivt. Behovene er like, men HLF har mest detaljert krav:
  • docs/source/likeperson.md · line 69
    Automatisk godkjenning under 50 km / uten utlegg, manuell attestering ellers (HLF).
  • docs/source/likeperson.md · line 148
    Reiserefusjon / utleggsregistrering | - | - | ✓ | ✓ | ✓ | SHOULD HAVE | 2
  • docs/source/likeperson.md · line 343
    Reiserefusjonshåndtering (faste valg, terskelbasert godkjenning)

Responsibilities

  • Evaluate auto-approval eligibility against org-configured km threshold and receipt rules
  • Route claims exceeding thresholds to the Admin Web Portal approval queue
  • Validate expense data and enforce fixed type constraints
  • Prepare approved expenses for accounting export (HLF and Blindeforbundet formats)
  • Link expense records to their parent activity record

Interfaces

submitExpense(expense: ExpenseInput): Promise<ExpenseRecord>
evaluateAutoApproval(expense: ExpenseInput, orgConfig: OrgConfig): ApprovalStatus
routeToApprovalQueue(expenseId: string): Promise<void>
getExpensesByActivity(activityId: string): Promise<ExpenseRecord[]>
exportForAccounting(expenseIds: string[], format: AccountingFormat): Promise<ExportResult>