From 537b6d68f9aa2f3e46f0b5e2d81850dfb0b84bdb Mon Sep 17 00:00:00 2001 From: VivianDee <115420678+VivianDee@users.noreply.github.com> Date: Wed, 12 Nov 2025 14:19:02 +0100 Subject: [PATCH] Update offer_analysis.py --- app/api/services/offer_analysis.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/api/services/offer_analysis.py b/app/api/services/offer_analysis.py index b481ca7..13f4645 100644 --- a/app/api/services/offer_analysis.py +++ b/app/api/services/offer_analysis.py @@ -225,7 +225,8 @@ class OfferAnalysis: 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.") + continue + # 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}).") @@ -255,4 +256,8 @@ class OfferAnalysis: "tenor": offer.tenor }) + if not eligible_offers: + logger.error("No eligible offers found for customer: {customer_id}.") + raise ValueError("You are not eligible for a loan at this time.") + return eligible_offers \ No newline at end of file