diff --git a/api/blueprints/common/otp/timed_otp.py b/api/blueprints/common/otp/timed_otp.py index 0421296..38107ad 100644 --- a/api/blueprints/common/otp/timed_otp.py +++ b/api/blueprints/common/otp/timed_otp.py @@ -220,6 +220,7 @@ async def generate_otp( seconds = inbound_data.seconds ) ) + print("OTP RESPONSE:", otp_response) # If the OTP generation failed: if not otp_response.success: return ResponseModel( @@ -329,16 +330,49 @@ async def verify_otp( ) ) + # If the OTP failed: + if not otp_response.success: return ResponseModel( + status_code = StatusCodes.FAILED, + http_code = HttpCodes.UNAUTHORIZED, + message = otp_response.message + ) + + # ┏┓ ┓ ┓ ┏┓┓• ┓ ┏• ┓ ┳┓ + # ┣┫┏┫┏┫ ┃ ┃┓┏┓┏┓╋ ┃┃┃┓╋┣┓ ┃┃┏┓╋┏┓┏ + # ┛┗┗┻┗┻ ┗┛┗┗┗ ┛┗┗ ┗┻┛┗┗┛┗ ┛┗┗┛┗┗ ┛ + + api_response = await current_app.http_client.post( + url = " https://api.thecaoffice.com/client/add/with/notes", + headers = {"X-Session-Token": inbound_headers["X-Session-Token"]}, + json = { + "email": inbound_data.email, + "clientName": inbound_data.username, + "address": None, + "phoneNo": inbound_data.phoneNo, + "city": None, + "pincode": None, + "panCard": None, + "gst": None, + "entity": None, + "country": None, + "startDate": None, + "period": None, + "amount": None + } + ) + api_json = api_response.json() + print("ADD CLIENT WITH NOTES:", json.to_string(api_json)) + # ┳┓ # ┣┫┏┓┏┏┓┏┓┏┓┏┏┓ # ┛┗┗ ┛┣┛┗┛┛┗┛┗ # ┛ # Done here: + success = api_response.is_success return ResponseModel( - status_code = StatusCodes.OK if otp_response.success else StatusCodes.FAILED, - http_code = HttpCodes.SUCCESS if otp_response.success else HttpCodes.UNAUTHORIZED, - message = otp_response.message + status_code = StatusCodes.OK if success else StatusCodes.FAILED, + http_code = HttpCodes.SUCCESS if success else HttpCodes.UNAUTHORIZED )