From 18dda45fa16f1087368d30aa597ec8f0f452dee1 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 25 Sep 2025 10:01:36 -0400 Subject: [PATCH] bank minimum amount --- app/api/services/offer_analysis.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/api/services/offer_analysis.py b/app/api/services/offer_analysis.py index 1c2297d..a54778b 100644 --- a/app/api/services/offer_analysis.py +++ b/app/api/services/offer_analysis.py @@ -178,7 +178,11 @@ class OfferAnalysis: logger.info(f"sum_active_loans === > {sum_active_loans}") real_eligible_amount = original_loan.eligible_amount - sum_active_loans - if real_eligible_amount < original_transaction_offer.min_amount: + # if real_eligible_amount < original_transaction_offer.min_amount: + # logger.error(f"Max eligible amount ({real_eligible_amount}) is less than the minimum offer amount ({original_transaction_offer.min_amount}).") + # raise ValueError("You are not eligible for a loan at this time.") + + if real_eligible_amount < 100: logger.error(f"Max eligible amount ({real_eligible_amount}) is less than the minimum offer amount ({original_transaction_offer.min_amount}).") raise ValueError("You are not eligible for a loan at this time.") @@ -219,11 +223,14 @@ class OfferAnalysis: approved_amount = new_eligible_amount approved_amount = round(approved_amount, 2) - if approved_amount < offer.min_amount: + # if approved_amount < offer.min_amount: + # logger.error(f"Max eligible amount ({approved_amount}) is less than the minimum offer amount ({offer.min_amount}).") + # raise ValueError("You are not eligible for a loan at this time.") + + if approved_amount < 100: logger.error(f"Max eligible amount ({approved_amount}) is less than the minimum offer amount ({offer.min_amount}).") raise ValueError("You are not eligible for a loan at this time.") - transaction_offer = TransactionOffer.create_transaction_offer( customer_id=customer_id, transaction_id=transaction_id,