original transaction id

This commit is contained in:
CHIEFSOFT\ameye
2025-05-09 23:14:08 -04:00
parent d851222024
commit 4435ca2776
3 changed files with 33 additions and 6 deletions
+7 -1
View File
@@ -1,4 +1,6 @@
from app.models import Offer, TransactionOffer
from app.models.loan import Loan
import logging
logger = logging.getLogger(__name__)
@@ -27,5 +29,9 @@ class OfferAnalysis:
if not offer:
raise ValueError("Invalid Offer.")
original_transaction = transaction_id
# we can now find the origin transactions
customer_loan = Loan.get_customer_current_active_loan(customer_id)
return transaction_offer, offer, eligible_amount
return transaction_offer, offer, eligible_amount, original_transaction
+3 -2
View File
@@ -50,7 +50,7 @@ class ProvideLoanService(BaseService):
rac_response = RACCheck.get_rac_check(customer_id = customer_id, account_id = account_id)
try:
transaction_offer, offer, eligible_amount = OfferAnalysis.get_offer(
transaction_offer, offer, eligible_amount, original_transaction = OfferAnalysis.get_offer(
transaction_id=transaction_id,
rac_response=rac_response,
validated_data=validated_data
@@ -116,6 +116,7 @@ class ProvideLoanService(BaseService):
product_id = offer.product_id,
collection_type = collection_type,
transaction_id = validated_data.get('transactionId'),
original_transaction = validated_data.get('transactionId'),
initial_loan_amount = validated_data.get('requestedAmount'),
upfront_fee = upfront_fee,
repayment_amount = repayment_amount,
@@ -145,7 +146,7 @@ class ProvideLoanService(BaseService):
# charges = Charge.get_offer_charges(offer.id)
logger.error(f"{charges}")
logger.info(f"{charges}")
loan_id = loan.id