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