Infrastructure medium complexity backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Handles low-level HTTP communication with external accounting system endpoints, including Xledger and the Dynamics-based HLF portal. It manages authentication credential lifecycle, request signing, and response parsing for each supported backend. The client exposes a normalized interface so upstream callers do not interact with vendor-specific transport details.

Feature: Accounting API

accounting-api-client

Sources & reasoning

Lines 72 and 353 both explicitly name accounting system integration as a Fase 3 deliverable for HLF and Blindeforbundet. Fase 3 is the third development phase, mapping to v1.1. The API client is the foundational piece required before any export can occur, so it is a distinct feature from the export UI.

Responsibilities

  • Authenticate with each external accounting system using the appropriate credential scheme
  • Serialize mapped expense and reimbursement payloads into vendor-specific request formats
  • Execute HTTP requests and parse vendor-specific responses into normalized result types
  • Refresh or rotate authentication tokens before expiry
  • Surface structured error details for downstream retry and audit handling

Interfaces

authenticate(config: AccountingBackendConfig): Promise<AuthSession>
postExpense(session: AuthSession, payload: VendorExpensePayload): Promise<VendorResponse>
postReimbursement(session: AuthSession, payload: VendorReimbursementPayload): Promise<VendorResponse>
refreshToken(session: AuthSession): Promise<AuthSession>
parseVendorError(response: VendorResponse): AccountingApiError