Track transaction before create loan
This commit is contained in:
@@ -36,6 +36,15 @@ class ProvideLoanService(BaseService):
|
|||||||
|
|
||||||
if (ProvideLoanService.validate_account_ownership(account_id = account_id, customer_id = customer_id)):
|
if (ProvideLoanService.validate_account_ownership(account_id = account_id, customer_id = customer_id)):
|
||||||
|
|
||||||
|
# Log Transaction
|
||||||
|
transaction = ProvideLoanService.log_transaction(validated_data=validated_data)
|
||||||
|
|
||||||
|
if not transaction:
|
||||||
|
logger.error(f"Failed to log transaction")
|
||||||
|
return jsonify({
|
||||||
|
"message": "Failed to log transaction."
|
||||||
|
}), 400
|
||||||
|
|
||||||
|
|
||||||
# Save the loan details
|
# Save the loan details
|
||||||
loan = Loan.create_loan(
|
loan = Loan.create_loan(
|
||||||
@@ -54,16 +63,16 @@ class ProvideLoanService(BaseService):
|
|||||||
"message": "Failed to save loan details."
|
"message": "Failed to save loan details."
|
||||||
}), 400
|
}), 400
|
||||||
|
|
||||||
|
logger.error(f"********* We need to develop the fee array here")
|
||||||
|
|
||||||
# Log Transaction
|
# Log Transaction
|
||||||
transaction = ProvideLoanService.log_transaction(validated_data = validated_data)
|
# transaction = ProvideLoanService.log_transaction(validated_data = validated_data)
|
||||||
|
#
|
||||||
if not transaction:
|
# if not transaction:
|
||||||
logger.error(f"Failed to log transaction")
|
# logger.error(f"Failed to log transaction")
|
||||||
return jsonify({
|
# return jsonify({
|
||||||
"message": "Failed to log transaction."
|
# "message": "Failed to log transaction."
|
||||||
}), 400
|
# }), 400
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return jsonify({
|
return jsonify({
|
||||||
|
|||||||
Reference in New Issue
Block a user