Update rac_check.py
This commit is contained in:
@@ -3,6 +3,8 @@ from marshmallow import ValidationError
|
|||||||
from app.utils.logger import logger
|
from app.utils.logger import logger
|
||||||
from app.api.helpers.response_helper import ResponseHelper
|
from app.api.helpers.response_helper import ResponseHelper
|
||||||
from app.api.schemas.rac_check import RACCheckSchema, RACCheckResponseSchema
|
from app.api.schemas.rac_check import RACCheckSchema, RACCheckResponseSchema
|
||||||
|
from datetime import datetime
|
||||||
|
from decimal import Decimal
|
||||||
|
|
||||||
class RACCheckService:
|
class RACCheckService:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -24,18 +26,53 @@ class RACCheckService:
|
|||||||
validated_data = schema.load(data)
|
validated_data = schema.load(data)
|
||||||
|
|
||||||
# Simulated RAC check logic — create racResponse manually or via logic
|
# Simulated RAC check logic — create racResponse manually or via logic
|
||||||
|
# rac_response = {
|
||||||
|
# "hasSalaryAccount": True,
|
||||||
|
# "bvnValidated": True,
|
||||||
|
# "creditBureauCheck": False,
|
||||||
|
# "crmsCheck": True,
|
||||||
|
# "accountStatus": True,
|
||||||
|
# "hasLien": False,
|
||||||
|
# "noBouncedCheck": True,
|
||||||
|
# "isWhitelisted": True,
|
||||||
|
# "hasPastDueLoan": False
|
||||||
|
# }
|
||||||
|
|
||||||
rac_response = {
|
rac_response = {
|
||||||
"hasSalaryAccount": True,
|
"PROCESS_DATE": datetime.strptime("2025-06-05", "%Y-%m-%d").date(),
|
||||||
"bvnValidated": True,
|
"CIF_ID": "123456789",
|
||||||
"creditBureauCheck": False,
|
"CUSTOMER_id": "987654321",
|
||||||
"crmsCheck": True,
|
"SALACCT_1": "34567831",
|
||||||
"accountStatus": True,
|
"ALERT_PHONE": "2348031234567",
|
||||||
"hasLien": False,
|
"AVERAGE_SALARY": Decimal("50000"),
|
||||||
"noBouncedCheck": True,
|
"LOAN_OUSTANDING_BAL": Decimal("0"),
|
||||||
"isWhitelisted": True,
|
"EMI": Decimal("10000"),
|
||||||
"hasPastDueLoan": False
|
"ELIG_AMT": Decimal("25000"),
|
||||||
|
"rule1-45day-sal": True,
|
||||||
|
"rule2-2m-sal": True,
|
||||||
|
"rule3-no-bounced-check": True,
|
||||||
|
"rule4-current-loan-payments": True,
|
||||||
|
"rule5-no-past-due-fadv-loan": True,
|
||||||
|
"rule6--no-past-due-other-loan": True,
|
||||||
|
"rule7-consistent-salary-amount": True,
|
||||||
|
"rule8-whitelisted": True,
|
||||||
|
"rule9-regular-account": True,
|
||||||
|
"rule10-bvn-validation": True,
|
||||||
|
"rule11-CRC-no-delinquency": True,
|
||||||
|
"rule12-CRMS-no-delinquency": True,
|
||||||
|
"rule13-BVN-ignore": True,
|
||||||
|
"rule14-no-lien": True,
|
||||||
|
"rule15-null-ignore": True,
|
||||||
|
"OVERALL_ELIG": True,
|
||||||
|
"SALARYPAYMENT_1": Decimal("50000"),
|
||||||
|
"SALARYPAYMENT_2": Decimal("50000"),
|
||||||
|
"SALARYPAYMENT_3": Decimal("50000"),
|
||||||
|
"SALARYPAYMENT_4": Decimal("50000"),
|
||||||
|
"SALARYPAYMENT_5": Decimal("50000"),
|
||||||
|
"SALARYPAYMENT_6": Decimal("50000")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
full_response = {
|
full_response = {
|
||||||
"transactionId": validated_data["transactionId"],
|
"transactionId": validated_data["transactionId"],
|
||||||
"customerId": validated_data["customerId"],
|
"customerId": validated_data["customerId"],
|
||||||
|
|||||||
Reference in New Issue
Block a user