import 'package:equatable/equatable.dart';
import '../../models/file_item.dart';

abstract class UploadEvent extends Equatable {
  const UploadEvent();

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

class StartUpload extends UploadEvent {
  final List<FileItem> files;
  final String targetPath;
  final String orgId;

  const StartUpload({
    required this.files,
    required this.targetPath,
    required this.orgId,
  });

  @override
  List<Object> get props => [files, targetPath, orgId];
}

class UploadProgress extends UploadEvent {
  final String fileName;
  final double progress;

  const UploadProgress({required this.fileName, required this.progress});

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

class UploadPaused extends UploadEvent {
  final String fileName;

  const UploadPaused(this.fileName);

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

class UploadCompleted extends UploadEvent {
  final FileItem file;

  const UploadCompleted(this.file);

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

class UploadFailed extends UploadEvent {
  final String fileName;
  final String error;

  const UploadFailed({required this.fileName, required this.error});

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

class CancelUpload extends UploadEvent {
  final String fileName;

  const CancelUpload(this.fileName);

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

class ResetUploads extends UploadEvent {}
