forked from DigiFi/digifi-BankToProductCore
Analysis steps
This commit is contained in:
@@ -40,9 +40,25 @@ class OfferAnalysis:
|
||||
def decide_offer(transaction_id, rac_check, validated_data,customer):
|
||||
# if we have active offers - we have to feed off it
|
||||
|
||||
"""
|
||||
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
|
||||
|
||||
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
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user