import 'login_response_dto.dart';

class ChangePasswordResponseDto {
  final int statusCode;
  final bool isSuccess;
  final String message;
  final LoginDataDto? data;

  ChangePasswordResponseDto({
    required this.statusCode,
    required this.isSuccess,
    required this.message,
    this.data,
  });

  factory ChangePasswordResponseDto.fromJson(Map<String, dynamic> json) {
    return ChangePasswordResponseDto(
      statusCode: json['statusCode'] ?? 0,
      isSuccess: json['isSuccess'] ?? false,
      message: json['message'] ?? '',
      data:
          json['data'] != null && json['data'] is Map<String, dynamic>
              ? LoginDataDto.fromJson(json['data'])
              : null,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'statusCode': statusCode,
      'isSuccess': isSuccess,
      'message': message,
      'data': data?.toJson(),
    };
  }
}
