/// Événements pour le BLoC des approbations
library approval_event;

import 'package:equatable/equatable.dart';

abstract class ApprovalEvent extends Equatable {
  const ApprovalEvent();

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

/// Charger les approbations en attente
class LoadPendingApprovals extends ApprovalEvent {
  final String? organizationId;

  const LoadPendingApprovals({this.organizationId});

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

/// Charger une approbation spécifique
class LoadApprovalById extends ApprovalEvent {
  final String approvalId;

  const LoadApprovalById(this.approvalId);

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

/// Approuver une transaction
class ApproveTransactionEvent extends ApprovalEvent {
  final String approvalId;
  final String? comment;

  const ApproveTransactionEvent({
    required this.approvalId,
    this.comment,
  });

  @override
  List<Object?> get props => [approvalId, comment];
}

/// Rejeter une transaction
class RejectTransactionEvent extends ApprovalEvent {
  final String approvalId;
  final String reason;

  const RejectTransactionEvent({
    required this.approvalId,
    required this.reason,
  });

  @override
  List<Object?> get props => [approvalId, reason];
}

/// Rafraîchir les approbations
class RefreshApprovals extends ApprovalEvent {
  final String? organizationId;

  const RefreshApprovals({this.organizationId});

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