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 AssignTagModelEvent extends Equatable {
  const AssignTagModelEvent();

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

class InitializeTagModels extends AssignTagModelEvent {
  final List<Tag> initialTags;
  final List<SelectedProduct> addedProducts;

  const InitializeTagModels({
    this.initialTags = const [],
    required this.addedProducts,
  });

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

class UpdateTag extends AssignTagModelEvent {
  final int index;
  final Tag tag;

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

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

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

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

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

class ValidateTagModels extends AssignTagModelEvent {}

class DeleteTagModel extends AssignTagModelEvent {
  final Tag tagToDelete;
  final List<Tag> tags;

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

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