import 'package:equatable/equatable.dart';

/// Status of a staff payout.
enum PaymentStatus {
  /// Payout calculated but not processed.
  pending,

  /// Submitted to banking provider.
  processing,

  /// Successfully transferred to staff.
  paid,

  /// Transfer failed.
  failed,
}

/// Represents a payout to a [Staff] member for a completed [Assignment].
class StaffPayment extends Equatable {

  const StaffPayment({
    required this.id,
    required this.staffId,
    required this.assignmentId,
    required this.amount,
    required this.status,
    this.paidAt,
  });
  /// Unique identifier.
  final String id;

  /// The recipient [Staff].
  final String staffId;

  /// The [Assignment] being paid for.
  final String assignmentId;

  /// Amount to be paid.
  final double amount;

  /// Processing status.
  final PaymentStatus status;

  /// When the payment was successfully processed.
  final DateTime? paidAt;

  @override
  List<Object?> get props => <Object?>[id, staffId, assignmentId, amount, status, paidAt];
}