collection_logs table. ScanService validates code state (active only; used = duplicate, expired = expired, unassigned/allocated = invalid), geo proximity (≤200m from DOP via ST_Distance_Sphere), then atomically transitions code -> Used and writes a CollectionLog. Scans inside a trip context bump trip_stop.total_scans + emit qr_scanned timeline event. Bulk scan endpoint processes each scan independently for offline sync. Triggers QrBalanceLow when household active count drops below threshold. 155 feature tests passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4.9 KiB
4.9 KiB