Rack analysis

This commit is contained in:
CHIEFSOFT\ameye
2025-05-24 05:37:21 -04:00
parent a4ed936392
commit 0bdc11423f
3 changed files with 39 additions and 6 deletions
+4 -1
View File
@@ -81,6 +81,8 @@ class EligibilityCheckService(BaseService):
if not rac_check:
logger.error(f"Failed to save RACCheck")
return ResponseHelper.error(result_description="Failed to save RACCheck.")
rack_checks_response = response['racResponse']
# -----------------TIME FOR ANALYSIS TO REGISTER OFFER ----------------------
# eligible_offers = []
try:
@@ -88,7 +90,8 @@ class EligibilityCheckService(BaseService):
transaction_id=transactionId,
rac_check=rac_check,
validated_data=validated_data,
customer_id=customer_id
customer_id=customer_id,
rack_checks_response =rack_checks_response
)
except ValueError as ve:
logger.error(str(ve))
+22 -2
View File
@@ -32,12 +32,32 @@ class OfferAnalysis:
original_transaction = transaction_id
return transaction_offer, offer, eligible_amount, original_transaction
@staticmethod
def _analyze_rack_checks(rack_response):
# "racResponse": {
# "accountStatus": true,
# "bvnValidated": true,
# "creditBureauCheck": false,
# "crmsCheck": true,
# "hasLien": false,
# "hasPastDueLoan": false,
# "hasSalaryAccount": true,
# "isWhitelisted": true,
# "noBouncedCheck": true
# },
#
return 0
@staticmethod
def decide_offer(transaction_id, rac_check, validated_data, customer_id):
def decide_offer(transaction_id, rac_check, validated_data, customer_id, rack_checks_response):
eligible_offers = []
# if we have active offers - we have to feed off it
logger.info(f"LOOOOOOOOOOOOOOOOOO** {customer_id}")
logger.info(f"**RACK ANALYSIS** {customer_id}")
# Analyze Rack Checks
self._analyze_rack_checks(rack_checks_response)
# we can now find the origin transactions
# Find the last loan - it will have original_transaction