/// Queues HR attendance actions when offline; syncs on reconnect.
class SyncEngine {
  final List<Map<String, dynamic>> _queue = [];

  List<Map<String, dynamic>> get pending => List.unmodifiable(_queue);

  void enqueueAttendance({
    required String action,
    required String cafeId,
    required String employeeId,
  }) {
    _queue.add({
      'type': 'attendance',
      'action': action,
      'cafeId': cafeId,
      'employeeId': employeeId,
      'at': DateTime.now().toUtc().toIso8601String(),
    });
  }

  void clear() => _queue.clear();
}
