import 'package:equatable/equatable.dart';

/// The lifecycle status of a [Staff] account.
enum StaffStatus {
  /// Account created but profile not started.
  registered,

  /// Profile submitted and awaiting verification.
  pending,

  /// Profile information filled but not submitted for verification.
  completedProfile,

  /// Profile verified by admin.
  verified,

  /// Staff is currently active and eligible for work.
  active,

  /// Account is temporarily suspended.
  blocked,

  /// Account is permanently inactive.
  inactive,
}

/// Represents a worker profile.
///
/// Contains all personal and professional details of a staff member.
/// Linked to a [User] via [authProviderId].
class Staff extends Equatable {
  const Staff({
    required this.id,
    required this.authProviderId,
    required this.name,
    required this.email,
    this.phone,
    this.avatar,
    required this.status,
    this.address,
    this.totalShifts,
    this.averageRating,
    this.onTimeRate,
    this.noShowCount,
    this.cancellationCount,
    this.reliabilityScore,
    this.preferredLocations,
  });
  /// Unique identifier for the staff profile.
  final String id;

  /// Link to the [User] authentication record.
  final String authProviderId;

  /// Full display name.
  final String name;

  /// Contact email.
  final String email;

  /// Contact phone number.
  final String? phone;

  /// Profile picture URL.
  final String? avatar;

  /// Current workflow status of the staff member.
  final StaffStatus status;

  /// The user's physical address.
  ///
  /// Can be used for location-based job matching.
  final String? address;

  /// The total number of shifts completed.
  final int? totalShifts;

  /// The average rating from businesses.
  final double? averageRating;

  /// The percentage of shifts arrived on time.
  final int? onTimeRate;

  /// The number of no-shows.
  final int? noShowCount;

  /// The number of cancellations within 24h.
  final int? cancellationCount;

  /// The reliability score (0-100).
  final int? reliabilityScore;

  /// Preferred work locations.
  final List<String>? preferredLocations;

  @override
  List<Object?> get props => <Object?>[
        id,
        authProviderId,
        name,
        email,
        phone,
        avatar,
        status,
        address,
        totalShifts,
        averageRating,
        onTimeRate,
        noShowCount,
        cancellationCount,
        reliabilityScore,
        preferredLocations,
      ];
}
