Log added
This commit is contained in:
@@ -88,6 +88,7 @@ def loan_status():
|
|||||||
@jwt_required()
|
@jwt_required()
|
||||||
def repayment():
|
def repayment():
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
|
logger.error(f"HERE 0000a **** ")
|
||||||
# logger.info(f"Repayment request received: {data}")
|
# logger.info(f"Repayment request received: {data}")
|
||||||
response = RepaymentService.process_request(data)
|
response = RepaymentService.process_request(data)
|
||||||
return response
|
return response
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class RepaymentService(BaseService):
|
|||||||
try:
|
try:
|
||||||
with db.session.begin():
|
with db.session.begin():
|
||||||
validated_data = RepaymentService.validate_data(data, RepaymentSchema())
|
validated_data = RepaymentService.validate_data(data, RepaymentSchema())
|
||||||
|
|
||||||
customer_id = validated_data.get('customerId')
|
customer_id = validated_data.get('customerId')
|
||||||
request_id = validated_data.get('requestId')
|
request_id = validated_data.get('requestId')
|
||||||
loan_id = validated_data.get('debtId')
|
loan_id = validated_data.get('debtId')
|
||||||
@@ -37,9 +38,9 @@ class RepaymentService(BaseService):
|
|||||||
# customer = Customer.get_customer_with_loan_list(customer_id)
|
# customer = Customer.get_customer_with_loan_list(customer_id)
|
||||||
transaction_id = validated_data.get('transactionId')
|
transaction_id = validated_data.get('transactionId')
|
||||||
initiated_by = validated_data.get('initiatedBy')
|
initiated_by = validated_data.get('initiatedBy')
|
||||||
|
logger.error(f"HERE 0002a **** ")
|
||||||
if(RepaymentService.validate_account_ownership(account_id = account_id, customer_id = customer_id)):
|
if(RepaymentService.validate_account_ownership(account_id = account_id, customer_id = customer_id)):
|
||||||
|
logger.error(f"HERE 0001a **** ")
|
||||||
# Check loan exists
|
# Check loan exists
|
||||||
loan = Loan.get_customer_loan(loan_id = loan_id, customer_id = customer_id)
|
loan = Loan.get_customer_loan(loan_id = loan_id, customer_id = customer_id)
|
||||||
|
|
||||||
@@ -61,7 +62,8 @@ class RepaymentService(BaseService):
|
|||||||
if not transaction:
|
if not transaction:
|
||||||
logger.error(f"Failed to log transaction")
|
logger.error(f"Failed to log transaction")
|
||||||
return ResponseHelper.error(result_description="Failed to log transaction.")
|
return ResponseHelper.error(result_description="Failed to log transaction.")
|
||||||
else:
|
else:
|
||||||
|
logger.error(f"Invalid Customer or AccountID {account_id} to CustomerID{customer_id} ")
|
||||||
return ResponseHelper.error(result_description="Invalid Customer or Account")
|
return ResponseHelper.error(result_description="Invalid Customer or Account")
|
||||||
|
|
||||||
# Simulated processing logic
|
# Simulated processing logic
|
||||||
|
|||||||
Reference in New Issue
Block a user