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

Description

Data access layer responsible for persisting and retrieving expense records linked to activity entries. Manages storage of expense metadata, approval state, receipt references, and org-level threshold configuration used for auto-approval decisions.

Feature: Travel Expense Registration

expense-repository

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

  • Persist new expense records with type, amount, distance, and activity linkage
  • Retrieve expenses by activity, status, and date range for reporting and export
  • Store and query org-configured threshold values for auto-approval
  • Update expense approval status and audit trail
  • Manage receipt attachment references associated with expense entries

Interfaces

createExpense(data: ExpenseRecord): Promise<string>
getExpenseById(expenseId: string): Promise<ExpenseRecord>
getExpensesByActivity(activityId: string): Promise<ExpenseRecord[]>
updateApprovalStatus(expenseId: string, status: ApprovalStatus): Promise<void>
getOrgThresholdConfig(orgId: string): Promise<ExpenseThresholdConfig>

Related Data Entities (2)

Data entities managed by this component