import 'package:equatable/equatable.dart';

/// Represents a specific position requirement within a [OneTimeOrder].
///
/// Defines the role, headcount, and scheduling details for a single staffing requirement.
class OneTimeOrderPosition extends Equatable {

  const OneTimeOrderPosition({
    required this.role,
    required this.count,
    required this.startTime,
    required this.endTime,
    this.lunchBreak = 'NO_BREAK',
    this.location,
  });
  /// The job role or title required.
  final String role;

  /// The number of workers required for this position.
  final int count;

  /// The scheduled start time (e.g., "09:00 AM").
  final String startTime;

  /// The scheduled end time (e.g., "05:00 PM").
  final String endTime;

  /// The break duration enum value (e.g., NO_BREAK, MIN_15, MIN_30).
  final String lunchBreak;

  /// Optional specific location for this position, if different from the order's main location.
  final String? location;

  @override
  List<Object?> get props => <Object?>[
    role,
    count,
    startTime,
    endTime,
    lunchBreak,
    location,
  ];

  /// Creates a copy of this position with the given fields replaced.
  OneTimeOrderPosition copyWith({
    String? role,
    int? count,
    String? startTime,
    String? endTime,
    String? lunchBreak,
    String? location,
  }) {
    return OneTimeOrderPosition(
      role: role ?? this.role,
      count: count ?? this.count,
      startTime: startTime ?? this.startTime,
      endTime: endTime ?? this.endTime,
      lunchBreak: lunchBreak ?? this.lunchBreak,
      location: location ?? this.location,
    );
  }
}
