import 'package:equatable/equatable.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/factory_reset_model.dart';
import 'package:syncrow_web/pages/device_managment/water_leak/model/water_leak_status_model.dart';

abstract class WaterLeakEvent extends Equatable {
  const WaterLeakEvent();

  @override
  List<Object> get props => [];
}

class FetchWaterLeakStatusEvent extends WaterLeakEvent {
  final String deviceId;

  const FetchWaterLeakStatusEvent(this.deviceId);

  @override
  List<Object> get props => [deviceId];
}

class StatusUpdated extends WaterLeakEvent {
  final WaterLeakStatusModel deviceStatus;
  const StatusUpdated(this.deviceStatus);
  @override
  List<Object> get props => [deviceStatus];
}

class WaterLeakControlEvent extends WaterLeakEvent {
  final String deviceId;
  final String code;
  final dynamic value;

  const WaterLeakControlEvent({
    required this.deviceId,
    required this.code,
    required this.value,
  });

  @override
  List<Object> get props => [deviceId, code, value];
}

class WaterLeakBatchControlEvent extends WaterLeakEvent {
  final List<String> deviceIds;
  final String code;
  final dynamic value;

  const WaterLeakBatchControlEvent({
    required this.deviceIds,
    required this.code,
    required this.value,
  });

  @override
  List<Object> get props => [deviceIds, code, value];
}

class FetchWaterLeakBatchStatusEvent extends WaterLeakEvent {
  final List<String> deviceIds;

  const FetchWaterLeakBatchStatusEvent(this.deviceIds);

  @override
  List<Object> get props => [deviceIds];
}

class FetchWaterLeakReportsEvent extends WaterLeakEvent {
  final String deviceId;
  final String code;
  final int from;
  final int to;

  const FetchWaterLeakReportsEvent({
    required this.deviceId,
    required this.code,
    required this.from,
    required this.to,
  });

  @override
  List<Object> get props => [deviceId, code, from, to];
}

class WaterLeakFactoryResetEvent extends WaterLeakEvent {
  final String deviceId;
  final FactoryResetModel factoryReset;

  const WaterLeakFactoryResetEvent({
    required this.deviceId,
    required this.factoryReset,
  });

  @override
  List<Object> get props => [deviceId];
}
