Update provide_loan.py

This commit is contained in:
VivianDee
2025-11-11 07:15:21 +01:00
parent 2a184d134d
commit e5b2d6e7b6
+6 -2
View File
@@ -18,6 +18,7 @@ from app.api.integrations import EventServiceIntegration
from app.models import LoanRepaymentSchedule from app.models import LoanRepaymentSchedule
from app.api.services.offer_analysis import OfferAnalysis from app.api.services.offer_analysis import OfferAnalysis
from app.api.helpers.response_helper import ResponseHelper from app.api.helpers.response_helper import ResponseHelper
from datetime import datetime
class ProvideLoanService(BaseService): class ProvideLoanService(BaseService):
TRANSACTION_TYPE = TransactionType.PROVIDE_LOAN TRANSACTION_TYPE = TransactionType.PROVIDE_LOAN
@@ -114,8 +115,11 @@ class ProvideLoanService(BaseService):
insurance = charges["insurance"] insurance = charges["insurance"]
vat = charges["vat"] vat = charges["vat"]
padded_id = str(transaction_id).zfill(12) # Generate Loan Reference
loan_ref = f"{padded_id}{channel}{offer.product_id}" loan_ref = f"SIM{datetime.now().strftime('%Y%m%d%H%M%S%f')}"
# padded_id = str(transaction_id).zfill(12)
# loan_ref = f"{padded_id}{channel}{offer.product_id}"
# Save the loan details # Save the loan details