Staered
This commit is contained in:
@@ -30,9 +30,6 @@ class OfferAnalysis:
|
||||
if not offer:
|
||||
raise ValueError("Invalid Offer.")
|
||||
original_transaction = transaction_id
|
||||
# we can now find the origin transactions
|
||||
customer_loan = Loan.get_customer_current_active_loan(customer_id)
|
||||
|
||||
|
||||
return transaction_offer, offer, eligible_amount, original_transaction
|
||||
|
||||
@@ -40,6 +37,10 @@ class OfferAnalysis:
|
||||
def decide_offer(transaction_id, rac_check, validated_data,customer):
|
||||
# if we have active offers - we have to feed off it
|
||||
|
||||
# we can now find the origin transactions
|
||||
last_customer_loan = Loan.get_customer_last_loan(customer.id) #Find the last loan - it will have original_transaction
|
||||
logger.info(f"{last_customer_loan}")
|
||||
|
||||
"""
|
||||
Find the last loan - it will have original_transaction
|
||||
|
||||
@@ -48,6 +49,7 @@ class OfferAnalysis:
|
||||
This will give you the eligible_amount = REAL_ELIGIBLIBLE_AMOUNT
|
||||
|
||||
Sum all loans amount with same original_transaction together = Sum_active loans. = SUM_OF_ACTIVE_LOAN
|
||||
[*** we will come back to this action to make sure w dont count already paid loans *******]
|
||||
|
||||
The new eligible amount will be = REAL_ELIGIBLIBLE_AMOUNT - SUM_OF_ACTIVE_LOAN
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ class ProvideLoanService(BaseService):
|
||||
|
||||
# charges = Charge.get_offer_charges(offer.id)
|
||||
|
||||
logger.info(f"{charges}")
|
||||
# logger.info(f"{charges}")
|
||||
|
||||
loan_id = loan.id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user