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

Description

Data access layer that executes organization-scoped SQL aggregation queries against the expenses and reimbursement_approvals tables. Uses GROUP BY on status, expense_type_id, and date truncations. All queries are filtered by organization_id and indexed on organization_id and status for performance.

Feature: Reimbursement Overview

reimbursement-overview-repository

Responsibilities

  • Aggregate expense totals grouped by approval status and organization_id
  • Aggregate expense amounts grouped by expense_type_id within org scope
  • Return time-bucketed spend data for trend analysis
  • Fetch paginated raw expense records for CSV export with applied filters

Interfaces

getStatusAggregates(orgId, localAssocId, dateRange): StatusAggregate[]
getTypeBreakdown(orgId, dateRange): TypeAggregate[]
getTrendBuckets(orgId, bucketSize, dateRange): TrendBucket[]
getFilteredExpenses(orgId, filters, pagination): PaginatedExpenses

Relationships

Dependents (2)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component