[update]: Loan reference with SIM prefix #70

Closed
vivian.d.simbrellang.com wants to merge 1 commits from restructure_loan_ref into master
+6 -2
View File
@@ -18,6 +18,7 @@ from app.api.integrations import EventServiceIntegration
from app.models import LoanRepaymentSchedule
from app.api.services.offer_analysis import OfferAnalysis
from app.api.helpers.response_helper import ResponseHelper
from datetime import datetime
class ProvideLoanService(BaseService):
TRANSACTION_TYPE = TransactionType.PROVIDE_LOAN
@@ -113,9 +114,12 @@ class ProvideLoanService(BaseService):
management = charges["management"]
insurance = charges["insurance"]
vat = charges["vat"]
# Generate Loan Reference
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}"
# padded_id = str(transaction_id).zfill(12)
# loan_ref = f"{padded_id}{channel}{offer.product_id}"
# Save the loan details