Service Layer high complexity backend
0
Dependencies
0
Dependents
6
Entities
0
Integrations

Description

Handles all outbound data synchronization to the Xledger accounting platform used by Blindeforbundet. Communicates via Xledger's REST API with OAuth2 authentication, mapping approved reimbursements and honorariums to the correct Xledger ledger accounts with retry logic and exponential backoff.

Feature: Accounting System Integration

xledger-sync-service

Responsibilities

  • Authenticate with Xledger REST API using OAuth2 tokens retrieved server-side
  • Map approved travel reimbursements and honorariums to Xledger ledger account structures
  • Implement retry logic with exponential backoff for failed sync attempts
  • Write sync results and error details to the sync_logs table for audit trail
  • Respect per-organization feature flag before initiating sync

Interfaces

syncApprovedReimbursement(reimbursementId)
syncHonorarium(honorariumId)
authenticate(orgCredentials)
retryFailedRecords(orgId)
getSyncStatus(orgId)
mapToXledgerPayload(record)
handleApiError(error)
refreshOAuthToken(orgId)