import 'package:equatable/equatable.dart';

/// Represents a line item in an [Invoice].
///
/// Corresponds to the work done by one [Staff] member.
class InvoiceItem extends Equatable {

  const InvoiceItem({
    required this.id,
    required this.invoiceId,
    required this.staffId,
    required this.workHours,
    required this.rate,
    required this.amount,
  });
  /// Unique identifier.
  final String id;

  /// The [Invoice] this item belongs to.
  final String invoiceId;

  /// The [Staff] member whose work is being billed.
  final String staffId;

  /// Total billed hours.
  final double workHours;

  /// Hourly rate applied.
  final double rate;

  /// Total line item amount (workHours * rate).
  final double amount;

  @override
  List<Object?> get props => <Object?>[id, invoiceId, staffId, workHours, rate, amount];
}