Reports API
Implementation: front/src/services/api/reportService.ts. Download methods expect file responses (responseType: 'blob') using the configured Axios instance. Request parameters reflect what the frontend constructs; backend filtering semantics and actual file contents require backend/API contract verification.
GET /reports/lease/:leaseId
- Called from:
generateLeaseReport; page call site not confirmed in reviewed page source. - Path:
leaseIdstring. - Query: required
format(pdf,xlsx,csv); optionalincludeAmortization,includeCalculationsbooleans. - Response: Blob converted to MIME based on format.
- Example:
GET {VITE_API_BASE_URL}/reports/lease/{leaseId}?format=pdf - Failure: service logs and throws.
GET /reports/portfolio
- Called from: Reports page fallback branch when selected type is neither standardized nor compliance.
- Query:
format; optionalstatus,currency,assetType. - Response: Blob converted to selected report MIME.
- Example:
GET {VITE_API_BASE_URL}/reports/portfolio?format=xlsx¤cy=USD - Failure: logs and throws; page displays alert.
GET /reports/amortization/:leaseId
- Called from:
generateAmortizationReport; page call site not confirmed in reviewed page source. - Path:
leaseIdstring. - Query:
format. - Response: Blob with MIME selected from
pdf,xlsx, orcsv. - Example:
GET {VITE_API_BASE_URL}/reports/amortization/{leaseId}?format=xlsx - Failure: logs and throws.
GET /reports/export/:type
- Called from: Reports page for selected standardized report (
summary,monthly,liability,rou-assets). - Path:
typestring. - Query:
format, provided filter entries, optionalstartDateandendDate. - Response: Blob; service selects XLSX MIME for xlsx, otherwise CSV MIME.
- Example:
GET {VITE_API_BASE_URL}/reports/export/summary?format=xlsx¤cy=USD - Failure: logs and throws; page alerts and clears export loading state.
GET /reports/compliance
- Called from: Reports page compliance branch if selected report is
compliance; current visible report types exclude compliance. - Query:
format, optionalstartDateandendDate. - Response: Blob with MIME chosen by format.
- Example:
GET {VITE_API_BASE_URL}/reports/compliance?format=csv - Failure: logs and throws.
GET /reports/formats
- Called from:
getReportFormats; call in Reports page is commented out. - Response type:
ApiResponse<ReportFormat[]>; service returnsdatawhen successful, otherwise an empty list. - Fields declared:
format,name,description,mimeType,extension. - Example:
GET {VITE_API_BASE_URL}/reports/formats
GET /reports/templates
- Called from:
getReportTemplates; call in Reports page is commented out. - Response type:
ApiResponse<ReportTemplate[]>; service returnsdatawhen successful, otherwise an empty list. - Exact template fields: Defined by frontend
ReportTemplatetype; backend contract unverified. - Example:
GET {VITE_API_BASE_URL}/reports/templates
Request and response notes
JSON requests use Content-Type: application/json; report file calls set responseType: 'blob'. The client interceptor adds bearer authorization when a token exists. HTTP 401 follows the shared refresh flow. Other response statuses and report-generation error bodies are not specified in frontend source.