From 68669784de00cbb3b010bc727b3d5bfbdaa18abc Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 17 Jun 2025 06:58:24 -0400 Subject: [PATCH] Added Call Paths --- app/integrations/simbrella.py | 17 ++++++++++++++++- app/routes/autocall.py | 11 ++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/integrations/simbrella.py b/app/integrations/simbrella.py index d95a1c4..84c34b7 100644 --- a/app/integrations/simbrella.py +++ b/app/integrations/simbrella.py @@ -178,7 +178,22 @@ class SimbrellaClient: return 0 @staticmethod - def collect_loan(data): + def collect_loan_user_initiated(data): + # InitiatedBy = USER_INITIATED + return SimbrellaClient._collect_loan(data) + + @staticmethod + def collect_loan_user_salary_detect(data): + #InitiatedBy = SALARY_DETECT + return SimbrellaClient._collect_loan(data) + + @staticmethod + def collect_loan_user_due_payment(data): + # InitiatedBy = REPAYMENT_DUE + return SimbrellaClient._collect_loan(data) + + @staticmethod + def _collect_loan(data): api_url = f"{SimbrellaClient.BANK_CALL_BASE_URL}{SimbrellaClient.BANK_CALL_COLLECT_LOAN_ENDPOINT}" logger.info(f"Calling CollectLoan api_url==> : {api_url}") logger.info(f"Calling CollectLoan endpoint with data: {data}") diff --git a/app/routes/autocall.py b/app/routes/autocall.py index 968bea9..16d88a7 100644 --- a/app/routes/autocall.py +++ b/app/routes/autocall.py @@ -87,7 +87,7 @@ def refresh_collection(): } logger.info(f"Data being sent to Simbrella: {data}") logger.info(f"calling simbrella") - response = SimbrellaClient.collect_loan(data) + response = SimbrellaClient.collect_loan_user_initiated(data) return response @@ -107,4 +107,13 @@ def penal_charge(): response = SimbrellaClient.penal_charge(data[0]) + return response + +@autocall_bp.route("/analytic-salary-detect", methods=["POST"]) +def penal_charge(): + data = request.get_json() + logger.info(f"Calling Salary Detect Endpoints") + + response = SimbrellaClient.collect_loan_user_salary_detect(data) + return response \ No newline at end of file