import '../utils/sync_run_formatters.dart'; class BackfillSyncItem { const BackfillSyncItem({ required this.slotStart, required this.symbols, this.slotStartWire, }); final DateTime slotStart; final List symbols; /// Exact `slotStart` string from the sync-run API (Alpaca `start` param). final String? slotStartWire; /// Wire form for DB spot checks: `raw->>'slot_start'` and Alpaca `start`. String get fetchSlotStartWire => slotStartWire ?? formatMarketHistorySlotWire(slotStart); factory BackfillSyncItem.fromJson(Map json) { final String slotStartRaw = json['slotStart'] as String; return BackfillSyncItem( slotStart: DateTime.parse(slotStartRaw).toUtc(), slotStartWire: slotStartRaw, symbols: (json['symbols'] as List? ?? []) .map((dynamic value) => value.toString()) .toList(growable: false), ); } }