import 'package:equatable/equatable.dart';

enum RedemptionStatus { initial, loading, success, failed }

class RedemptionState extends Equatable {
  final RedemptionStatus status;
  final List<Map<String, dynamic>> recentRedemptions;
  final Map<String, dynamic>? selectedRedemption;

  const RedemptionState({
    this.status = RedemptionStatus.initial,
    this.recentRedemptions = const [],
    this.selectedRedemption,
  });

  RedemptionState copyWith({
    RedemptionStatus? status,
    List<Map<String, dynamic>>? recentRedemptions,
    Map<String, dynamic>? selectedRedemption,
  }) {
    return RedemptionState(
      status: status ?? this.status,
      recentRedemptions: recentRedemptions ?? this.recentRedemptions,
      selectedRedemption: selectedRedemption ?? this.selectedRedemption,
    );
  }

  @override
  List<Object?> get props => [status, recentRedemptions, selectedRedemption];
}
