diff --git a/app/api/services/eligibility_check.py b/app/api/services/eligibility_check.py index b27b9b7..65b1c5b 100644 --- a/app/api/services/eligibility_check.py +++ b/app/api/services/eligibility_check.py @@ -84,9 +84,10 @@ class EligibilityCheckService(BaseService): # eligible_offers = [] try: eligible_offers = OfferAnalysis.decide_offer( - transaction_id=transaction_id, + transaction_id=transactionId, rac_check=rac_check, - validated_data=validated_data + validated_data=validated_data, + customer=customer ) except ValueError as ve: logger.error(str(ve)) diff --git a/app/api/services/offer_analysis.py b/app/api/services/offer_analysis.py index 02dc2c9..66df567 100644 --- a/app/api/services/offer_analysis.py +++ b/app/api/services/offer_analysis.py @@ -1,6 +1,6 @@ from app.models import Offer, TransactionOffer from app.models.loan import Loan - +import random import logging logger = logging.getLogger(__name__) @@ -37,11 +37,15 @@ class OfferAnalysis: return transaction_offer, offer, eligible_amount, original_transaction @staticmethod - def decide_offer(transaction_id, rac_check, validated_data): + def decide_offer(transaction_id, rac_check, validated_data,customer): # if we have active offers - we have to feed off it + + + + # Do this if no active loan or registered offers offers = Offer.get_all_offers() eligible_offers = []