part of 'raise_ticket_bloc.dart';

enum RaiseTicketStatus { initial, loading, success, failure }

class RaiseTicketState extends Equatable {
  final RaiseTicketStatus status;
  final String subject;
  final String description;
  final File? attachment;
  final bool fileSizeExceeded;
  final String? errorMessage;

  const RaiseTicketState({
    this.status = RaiseTicketStatus.initial,
    this.subject = '',
    this.description = '',
    this.attachment,
    this.fileSizeExceeded = false,
    this.errorMessage,
  });

  RaiseTicketState copyWith({
    RaiseTicketStatus? status,
    String? subject,
    String? description,
    File? attachment,
    bool clearAttachment = false,
    bool? fileSizeExceeded,
    String? errorMessage,
  }) {
    return RaiseTicketState(
      status: status ?? this.status,
      subject: subject ?? this.subject,
      description: description ?? this.description,
      attachment: clearAttachment ? null : attachment ?? this.attachment,
      fileSizeExceeded: fileSizeExceeded ?? this.fileSizeExceeded,
      errorMessage: errorMessage,
    );
  }

  @override
  List<Object?> get props => [status, subject, description, attachment, fileSizeExceeded, errorMessage];
}