import 'package:equatable/equatable.dart';

/// The status of a staff [Assignment].
enum AssignmentStatus {
  /// Staff member has been assigned but hasn't confirmed.
  assigned,

  /// Staff member has accepted the assignment.
  confirmed,

  /// Work is currently in progress (Clocked In).
  ongoing,

  /// Work completed successfully (Clocked Out).
  completed,

  /// Staff rejected the assignment offer.
  declinedByStaff,

  /// Staff canceled after accepting.
  canceledByStaff,

  /// Staff did not show up.
  noShowed,
}

/// Represents the link between a [Staff] member and an [EventShiftPosition].
class Assignment extends Equatable {

  const Assignment({
    required this.id,
    required this.positionId,
    required this.staffId,
    required this.status,
    this.clockIn,
    this.clockOut,
  });
  /// Unique identifier.
  final String id;

  /// The job position being filled.
  final String positionId;

  /// The staff member filling the position.
  final String staffId;

  /// Current status of the assignment.
  final AssignmentStatus status;

  /// Actual timestamp when staff clocked in.
  final DateTime? clockIn;

  /// Actual timestamp when staff clocked out.
  final DateTime? clockOut;

  @override
  List<Object?> get props => <Object?>[id, positionId, staffId, status, clockIn, clockOut];
}