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

Description

Data access layer for expense claim records and their approval lifecycle. Handles filtered paginated queries, atomic status updates, and retrieval of associated receipt attachments for the approval workflow.

Feature: Expense Approval Queue

expense-approval-repository

Sources & reasoning

Source lines 68-70 establish that HLF requires threshold-based manual attestation for expenses above the auto-approval limit, implying a manual review queue is needed in the admin portal. Line 342 places reimbursement handling in Phase 2 (v1.0). The blueprint lists this as an admin-web-portal feature under admin-expense-approval.

  • docs/source/likeperson.md · line 68-70
    Begge organisasjoner har behov for registrering av kilometergodtgjørelse, bompenger, parkering og kollektivt. Behovene er like, men HLF har mest detaljert krav: - Automatisk godkjenning under 50 km / uten utlegg, manuell attestering ellers (HLF).
  • docs/source/likeperson.md · line 342
    Reiserefusjonshåndtering (faste valg, terskelbasert godkjenning)

Responsibilities

  • Query expense claims by status, date range, org unit, and expense type with pagination
  • Atomically update claim status and record reviewer ID, decision reason, and timestamp
  • Fetch receipt attachment references linked to a given claim
  • Retrieve aggregate counts per status for queue badge display
  • Enforce optimistic locking to prevent concurrent double-approval of the same claim

Interfaces

findPendingClaims(filters: QueueFilters, page: number, pageSize: number): PagedResult<ExpenseClaim>
updateClaimStatus(claimId: string, status: ClaimStatus, reviewerId: string, note?: string): ExpenseClaim
findById(claimId: string): ExpenseClaimDetail
countByStatus(orgUnitId: string): Record<ClaimStatus, number>
findReceiptsByClaimId(claimId: string): ReceiptAttachment[]

Related Data Entities (1)

Data entities managed by this component