import '../../../core/usecases/usecase.dart';
import '../../../core/error/failures.dart';

class VerifyOTP extends UseCase<bool, VerifyOTPParams> {
  @override
  Future<Result<bool>> call(VerifyOTPParams params) async {
    try {
      await Future.delayed(const Duration(seconds: 1));
      
      if (params.otpCode.length == 5) {
        return const Result.success(true);
      } else {
        return const Result.success(false);
      }
    } catch (e) {
      return Result.failure(ServerFailure());
    }
  }
}

class VerifyOTPParams {
  final String otpCode;
  final String phoneNumber;

  VerifyOTPParams({
    required this.otpCode,
    required this.phoneNumber,
  });
}
