[add]: loan_repayment event

This commit is contained in:
VivianDee
2025-04-10 17:02:54 +01:00
parent edd19b9a39
commit 7cea5390c0
7 changed files with 101 additions and 33 deletions
+3 -3
View File
@@ -43,9 +43,9 @@ class KafkaIntegration:
@staticmethod
def send_loan_request(loan_data, request_id):
def send_loan_request(loan_data, request_id, topic):
"""
Send loan request to PROCESS_PAYMENT topic
Send loan request to topic
Args:
loan_data: Loan request payload as dict
@@ -58,7 +58,7 @@ class KafkaIntegration:
# Sending loan request message to Kafka
producer.produce(
topic="PROCESS_PAYMENT",
topic=topic,
key=str(request_id),
value=json.dumps(loan_data).encode("utf-8"),
callback=KafkaIntegration.delivery_report,