part of 'ticket_shipping_cubit.dart';

enum TicketShippingStatus { initial, loading, success, failure }

class TicketShippingState extends Equatable {
  final TicketShippingStatus status;
  final ShippingDocumentModel document;
  final List<TicketModel> tickets;

  // Dati di supporto per la UI
  final List<ProviderModel> availableProviders;
  final List<ProviderLocationModel> availableLocations;
  final bool isAutoNumber;
  final String? errorMessage;

  const TicketShippingState({
    this.status = TicketShippingStatus.initial,
    required this.document,
    required this.tickets,
    this.availableProviders = const [],
    this.availableLocations = const [],
    this.isAutoNumber = true,
    this.errorMessage,
  });

  TicketShippingState copyWith({
    TicketShippingStatus? status,
    ShippingDocumentModel? document,
    List<ProviderModel>? availableProviders,
    List<ProviderLocationModel>? availableLocations,
    bool? isAutoNumber,
    String? errorMessage,
  }) {
    return TicketShippingState(
      status: status ?? this.status,
      document: document ?? this.document,
      tickets: tickets,
      availableProviders: availableProviders ?? this.availableProviders,
      availableLocations: availableLocations ?? this.availableLocations,
      isAutoNumber: isAutoNumber ?? this.isAutoNumber,
      errorMessage: errorMessage ?? this.errorMessage,
    );
  }

  @override
  List<Object?> get props => [
    status,
    document,
    tickets,
    availableProviders,
    availableLocations,
    isAutoNumber,
    errorMessage,
  ];
}
