removed comments
This commit is contained in:
@@ -35,30 +35,12 @@ class OfferAnalysis:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def decide_offer(transaction_id, rac_check, validated_data, customer):
|
def decide_offer(transaction_id, rac_check, validated_data, customer):
|
||||||
"""
|
|
||||||
Find the last loan - it will have original_transaction
|
|
||||||
|
|
||||||
This loan is part of the original approval where transaction_id = original_transaction for this account
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
Construct eligible_offers[]
|
|
||||||
|
|
||||||
Save eligible_offers
|
|
||||||
|
|
||||||
Return the eligible_amount
|
|
||||||
|
|
||||||
No need for fresh construct
|
|
||||||
"""
|
|
||||||
# if we have active offers - we have to feed off it
|
# if we have active offers - we have to feed off it
|
||||||
|
|
||||||
# we can now find the origin transactions
|
# 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
|
# Find the last loan - it will have original_transaction
|
||||||
|
last_customer_loan = Loan.get_customer_last_loan(customer.id)
|
||||||
logger.info(f"{last_customer_loan}")
|
logger.info(f"{last_customer_loan}")
|
||||||
|
|
||||||
new_eligible_amount = 0
|
new_eligible_amount = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user