import 'package:equatable/equatable.dart';

class FinanceSummary extends Equatable {
  final double totalContributionsPaid;
  final double totalContributionsPending;
  final double epargneBalance;
  
  const FinanceSummary({
    required this.totalContributionsPaid,
    required this.totalContributionsPending,
    required this.epargneBalance,
  });

  @override
  List<Object?> get props => [totalContributionsPaid, totalContributionsPending, epargneBalance];
}

class FinanceTransaction extends Equatable {
  final String id;
  final String title;
  final String date;
  final double amount;
  final String status;

  const FinanceTransaction({
    required this.id,
    required this.title,
    required this.date,
    required this.amount,
    required this.status, // "Payé", "En attente"
  });

  @override
  List<Object?> get props => [id, title, date, amount, status];
}

abstract class FinanceState extends Equatable {
  const FinanceState();
  
  @override
  List<Object?> get props => [];
}

class FinanceInitial extends FinanceState {}

class FinanceLoading extends FinanceState {}

class FinanceLoaded extends FinanceState {
  final FinanceSummary summary;
  final List<FinanceTransaction> transactions;

  const FinanceLoaded({
    required this.summary,
    required this.transactions,
  });

  @override
  List<Object?> get props => [summary, transactions];
}

class FinanceError extends FinanceState {
  final String message;
  const FinanceError(this.message);

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