From bcf4d7f892fa44c6720b49ea30679847e79e2af2 Mon Sep 17 00:00:00 2001 From: Bhushan Thakkar Date: Mon, 24 Mar 2025 12:01:09 +0000 Subject: [PATCH] Update 'api/blueprints/common/otp/timed_otp.py' Reverted back to original --- api/blueprints/common/otp/timed_otp.py | 83 +++++++------------------- 1 file changed, 21 insertions(+), 62 deletions(-) diff --git a/api/blueprints/common/otp/timed_otp.py b/api/blueprints/common/otp/timed_otp.py index b75fcd4..f1c6eaf 100644 --- a/api/blueprints/common/otp/timed_otp.py +++ b/api/blueprints/common/otp/timed_otp.py @@ -359,70 +359,29 @@ async def verify_otp( if phone_no.startswith("254"): phone_no = phone_no[3:] if phone_no.startswith("0"): phone_no = phone_no[1:] phone_no = "+254" + phone_no - # if client id is not none then hit update the client add with notes else - add client with notes - # 24/03/2025 - - client_id = inbound_data.id.get("idClient") - if client_id is not None: # hit Omkar's API: - api_response = await current_app.http_client.post( - url="https://api.thecaoffice.com/client/update/with/notes", - headers={"X-Session-Token": inbound_headers["X-Session-Token"]}, - json={ - "email": inbound_data.id.get("email"), - "clientName": inbound_data.id.get("clientName"), - "address": inbound_data.id.get("address"), - "phoneNo": inbound_data.id.get("phoneNo"), - "city": inbound_data.id.get("city"), - "pincode": inbound_data.id.get("pincode"), - "panCard": inbound_data.id.get("panCard"), - "gst": inbound_data.id.get("gst"), - "entity": inbound_data.id.get("entity"), - "country": inbound_data.id.get("country"), - "startDate": inbound_data.id.get("startDate"), - "period": inbound_data.id.get("period"), - "amount": inbound_data.id.get("amount"), - "idClient": inbound_data.id.get("idClient"), - "username": inbound_data.id.get("username"), - "password": inbound_data.id.get("password") - } ) - else: # hit Omkar's API: - 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": phone_no, - "city": None, - "pincode": None, - "panCard": None, - "gst": None, - "entity": None, - "country": None, - "startDate": None, - "period": None, - "amount": None } - ) + # hit Omkar's API: - #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, - # "password": inbound_data.password, - # "address": None, - # "phoneNo": phone_no, - # "city": None, - # "pincode": None, - # "panCard": None, - # "gst": None, - # "entity": None, - # "country": None, - # "startDate": None, - # "period": None, - # "amount": None - # } - #) + 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, + "password": inbound_data.password, + "address": None, + "phoneNo": phone_no, + "city": None, + "pincode": None, + "panCard": None, + "gst": None, + "entity": None, + "country": None, + "startDate": None, + "period": None, + "amount": None + } + ) # ┳┓ # ┣┫┏┓┏┏┓┏┓┏┓┏┏┓