Service Layer medium complexity backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Backend service that orchestrates the export of approved expense and reimbursement data to the connected accounting system. Fetches eligible records based on the provided filters, communicates with the accounting API, and persists export outcomes for audit and retry purposes.

Feature: Accounting Export

accounting-export-service

Sources & reasoning

The same Fase 3 roadmap entry on line 353 covers the full accounting integration scope, which includes both the API connection and the administrator-facing export workflow. Line 72 confirms the export need originates from HLF and Blindeforbundet expense processes. Fase 3 maps to v1.1. The export UI is a distinct feature from the API client because it has its own page, service, and log components.

Responsibilities

  • Query approved expense and reimbursement records matching the given date range and filters
  • Coordinate record transfer to the external accounting system via the accounting API integration
  • Persist per-record export outcomes to the export log, including failure reasons
  • Support individual record retry by re-submitting specific failed records without affecting others
  • Enforce idempotency to prevent duplicate exports of already-transferred records

Interfaces

previewExport(filters: ExportFilters): Promise<ExportPreview>
runExport(filters: ExportFilters, adminId: string): Promise<ExportResult>
retryRecord(exportLogId: string, recordId: string): Promise<RecordExportResult>
getExportLog(orgId: string, page: number, pageSize: number): Promise<ExportLogPage>

Related Data Entities (1)

Data entities managed by this component