OTP added to daily limit

This commit is contained in:
2025-12-05 12:37:38 +05:30
parent 4a8c69bb1e
commit 974f42bf95
6 changed files with 186 additions and 22 deletions

View File

@@ -54,4 +54,34 @@ class LimitService {
throw Exception('Unexpected error: ${e.toString()}');
}
}
}
Future getOtpTLimit({
required String mobileNumber,
}) async {
final response = await _dio.post(
'/api/otp/send',
data: {'mobileNumber': mobileNumber, 'type': "TLIMIT"},
);
if (response.statusCode != 200) {
throw Exception("Invalid Mobile Number/Type");
}
print(response.toString());
return response.toString();
}
Future validateOtp({
required String otp,
required String mobileNumber,
}) async {
final response = await _dio.post(
'/api/otp/verify?mobileNumber=$mobileNumber',
data: {
'otp': otp,
},
);
if (response.statusCode != 200) {
throw Exception("Wrong OTP");
}
return response.toString();
}
}