Service Layer medium complexity Shared Component backend
1
Dependencies
1
Dependents
2
Entities
0
Integrations

Description

Streaming export service that writes filtered expense records directly to the HTTP response without buffering the full result set in memory. Accepts the same filter parameters as the drill-down query and produces a structured CSV suitable for accounting system reconciliation.

Feature: Reimbursement Overview

expense-csv-export-service

Responsibilities

  • Stream SQL query results as CSV rows directly to the HTTP response using Node.js streaming
  • Apply the same filter parameters (submitter, expense type, date range) as the drill-down query
  • Format output columns including claim ID, submitter name, expense type, amount, status, submitted date, and approved date
  • Set Content-Type and Content-Disposition headers to trigger a browser file download

Interfaces

streamExport(orgId: string, filters: ExpenseFilters, res: Response): Promise<void>
buildCsvHeaders(): string[]
formatRow(record: ExpenseRecord): string

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component