diff --git a/api/blueprints/common/otp/timed_otp.py b/api/blueprints/common/otp/timed_otp.py index fb6dd91..0b38a8d 100644 --- a/api/blueprints/common/otp/timed_otp.py +++ b/api/blueprints/common/otp/timed_otp.py @@ -359,28 +359,69 @@ 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 + # } + #) # ┳┓ # ┣┫┏┓┏┏┓┏┓┏┓┏┏┓