import 'package:equatable/equatable.dart';

/// Enum defining the status of the profile setup process.
enum ProfileSetupStatus { initial, loading, success, failure }

/// State for the ProfileSetupBloc.
class ProfileSetupState extends Equatable {
  /// The user's full name.
  final String fullName;

  /// The user's bio or short description.
  final String bio;

  /// List of preferred work locations (e.g., cities, zip codes).
  final List<String> preferredLocations;

  /// Maximum distance in miles the user is willing to travel.
  final double maxDistanceMiles;

  /// List of skills selected by the user.
  final List<String> skills;

  /// List of industries selected by the user.
  final List<String> industries;

  /// The current status of the profile setup process.
  final ProfileSetupStatus status;

  /// Error message if the profile setup fails.
  final String? errorMessage;

  /// List of location suggestions from the API.
  final List<String> locationSuggestions;

  /// Creates a [ProfileSetupState] instance.
  const ProfileSetupState({
    this.fullName = '',
    this.bio = '',
    this.preferredLocations = const <String>[],
    this.maxDistanceMiles = 25,
    this.skills = const <String>[],
    this.industries = const <String>[],
    this.status = ProfileSetupStatus.initial,
    this.errorMessage,
    this.locationSuggestions = const <String>[],
  });

  /// Creates a copy of the current state with updated values.
  ProfileSetupState copyWith({
    String? fullName,
    String? bio,
    List<String>? preferredLocations,
    double? maxDistanceMiles,
    List<String>? skills,
    List<String>? industries,
    ProfileSetupStatus? status,
    String? errorMessage,
    List<String>? locationSuggestions,
  }) {
    return ProfileSetupState(
      fullName: fullName ?? this.fullName,
      bio: bio ?? this.bio,
      preferredLocations: preferredLocations ?? this.preferredLocations,
      maxDistanceMiles: maxDistanceMiles ?? this.maxDistanceMiles,
      skills: skills ?? this.skills,
      industries: industries ?? this.industries,
      status: status ?? this.status,
      errorMessage: errorMessage,
      locationSuggestions: locationSuggestions ?? this.locationSuggestions,
    );
  }

  @override
  List<Object?> get props => <Object?>[
        fullName,
        bio,
        preferredLocations,
        maxDistanceMiles,
        skills,
        industries,
        status,
        errorMessage,
        locationSuggestions,
      ];
}
