import 'package:equatable/equatable.dart';

/// Login request model for authentication
///
/// Contains the credentials required for user login
class LoginRequestModel extends Equatable {
  /// Username for authentication
  final String username;

  /// Password for authentication
  final String password;

  const LoginRequestModel({
    required this.username,
    required this.password,
  });

  /// Convert to JSON for API request
  Map<String, dynamic> toJson() {
    return {
      'EmailPhone': username,
      'Password': password,
    };
  }

  /// Create a copy with modified fields
  LoginRequestModel copyWith({
    String? username,
    String? password,
  }) {
    return LoginRequestModel(
      username: username ?? this.username,
      password: password ?? this.password,
    );
  }

  @override
  List<Object?> get props => [username, password];

  @override
  String toString() => 'LoginRequestModel(username: $username)';
}
