1
0

Analysis steps

This commit is contained in:
CHIEFSOFT\ameye
2025-05-10 06:20:03 -04:00
parent b7ae0e6baa
commit 40158b1c54
+16
View File
@@ -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
"""