# Migration Guide

This document describes breaking or opt-in changes introduced in each version
and how to migrate existing consumers.

---

## Migration to 0.16.0 — Async Invoice Posting

### Summary
Invoices can now be issued without synchronously posting to external accounting
systems.

## Who should migrate
Projects that integrate with external accounting systems and require improved
transaction safety and retry capability.

## How to opt in

```ts
await financeCompany.issueInvoice(
  tx,
  invoice,
  loginUser,
  customer,
  undefined,
  tags,
  discount,
  {
    postingMode: 'ASYNC_OUTBOX',
  }
);

## Required Setup
- Background worker to process outbox events
- Accounting integration worker enabled

## Invoice Status Flow
ISSUED -> POSTING -> POSTED/POST_FAILED

## Rollback Behaviour
- Local database failures rollback safely
- Accounting system failures do not corrupt local state
