Data Layer medium complexity backend
0
Dependencies
3
Dependents
4
Entities
0
Integrations

Description

Data access layer for reimbursements and approval records in PostgreSQL. Provides typed query methods for the approval workflow including fetching pending queues with joined expense data, updating approval status, and inserting approval decision records with full audit metadata.

Feature: Automated & Manual Reimbursement Approval

reimbursement-repository

Responsibilities

  • Query pending reimbursements with joined expense and receipt data
  • Update reimbursement status (pending, auto-approved, approved, rejected)
  • Insert reimbursement_approvals records with approver and timestamp
  • Support filtered and paginated queue queries per organization
  • Provide approval history queries for audit trail display

Interfaces

getPendingReimbursements(organizationId, filters, pagination)
getReimbursementById(reimbursementId)
updateReimbursementStatus(reimbursementId, status)
createApprovalRecord(reimbursementId, approverId, decision, notes)
getApprovalHistory(reimbursementId)
getReimbursementsByUser(userId, filters)
getReimbursementStats(organizationId, dateRange)
countPendingByOrganization(organizationId)