import 'package:equatable/equatable.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/tag.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/selected_product_model.dart';

abstract class AssignTagEvent extends Equatable {
  const AssignTagEvent();

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

class InitializeTags extends AssignTagEvent {
  final List<Tag>? initialTags;
  final List<SelectedProduct> addedProducts;

  const InitializeTags({
    required this.initialTags,
    required this.addedProducts,
  });

  @override
  List<Object> get props => [initialTags ?? [], addedProducts];
}

class UpdateTagEvent extends AssignTagEvent {
  final int index;
  final Tag tag;

  const UpdateTagEvent({required this.index, required this.tag});

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

class UpdateLocation extends AssignTagEvent {
  final int index;
  final String location;

  const UpdateLocation({required this.index, required this.location});

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

class ValidateTags extends AssignTagEvent {}

class DeleteTag extends AssignTagEvent {
  final Tag tagToDelete;
  final List<Tag> tags;

  const DeleteTag({required this.tagToDelete, required this.tags});

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