Infrastructure low complexity mobile
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Infrastructure adapter that serialises submitted expense mutations into the shared Mutation Outbox Service queue, ensuring offline-created expense records are reliably delivered to the backend when connectivity is restored. Handles retry, backoff, and conflict detection specific to expense payloads.

Feature: Travel Expense Registration

expense-sync-outbox

Sources & reasoning

The feature is implemented offline-first with Drift. Expense submissions made without connectivity must be reliably queued and flushed to the backend; this outbox adapter isolates that concern from the Expense Service and reuses the shared mutation outbox infrastructure.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Enqueue expense create/update mutations to the shared outbox
  • Serialise expense payload including type, distance, and receipt refs
  • Handle retry and exponential backoff on sync failure
  • Emit sync-status events consumed by the confirmation screen

Interfaces

enqueue(expense: Expense): Future<void>
onSyncSuccess(id: int): void
onSyncFailure(id: int, error: ApiException): void
retryFailed(): Future<void>