Skip to content

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: leaseId string.
  • Query: required format (pdf, xlsx, csv); optional includeAmortization, includeCalculations booleans.
  • 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; optional status, currency, assetType.
  • Response: Blob converted to selected report MIME.
  • Example: GET {VITE_API_BASE_URL}/reports/portfolio?format=xlsx&currency=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: leaseId string.
  • Query: format.
  • Response: Blob with MIME selected from pdf, xlsx, or csv.
  • 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: type string.
  • Query: format, provided filter entries, optional startDate and endDate.
  • Response: Blob; service selects XLSX MIME for xlsx, otherwise CSV MIME.
  • Example: GET {VITE_API_BASE_URL}/reports/export/summary?format=xlsx&currency=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, optional startDate and endDate.
  • 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 returns data when 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 returns data when successful, otherwise an empty list.
  • Exact template fields: Defined by frontend ReportTemplate type; 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.