# Scanner Offline Sync

Scanner devices validate online when possible and can cache assigned event ticket validation data for offline mode.

The offline manifest uses `manifest_version: 2` and matches scanned QR payloads by `sha256_qr_token`. The scanner cache stores token hashes, public ticket references, ticket status, order status, ticket type, and seat labels. It does not need raw internal ticket, order, organiser, or event database IDs for local offline decisions.

Offline sync must resolve:

- valid unused ticket
- already scanned
- wrong event
- cancelled/refunded ticket
- fake or invalid QR token
- duplicate offline scans

The server remains authoritative. Sync uploads local scan logs with device ID, scanned QR token, timestamps, and local result. The server resolves the token against stored token hashes, writes authoritative scan logs, updates valid tickets to checked in, and returns public ticket references plus final statuses. Conflicts are recorded in `scan_logs`.
