[add]: transaction offer fix
This commit is contained in:
@@ -35,10 +35,10 @@ class SelectOfferService(BaseService):
|
|||||||
transaction_offer_id = validated_data.get("offerId")
|
transaction_offer_id = validated_data.get("offerId")
|
||||||
transaction_id = validated_data.get("transactionId")
|
transaction_id = validated_data.get("transactionId")
|
||||||
request_id = validated_data.get("requestId")
|
request_id = validated_data.get("requestId")
|
||||||
|
|
||||||
|
|
||||||
offer_id = int(transaction_offer_id[5:]) # The last part is int
|
offer_id = int(transaction_offer_id[5:]) # The last part is int
|
||||||
|
|
||||||
#"offerId": "SAL30001129",
|
|
||||||
|
|
||||||
if SelectOfferService.validate_account_ownership(
|
if SelectOfferService.validate_account_ownership(
|
||||||
account_id=account_id, customer_id=customer_id
|
account_id=account_id, customer_id=customer_id
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ from sqlalchemy.exc import IntegrityError
|
|||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Loan(db.Model):
|
class Loan(db.Model):
|
||||||
|
|||||||
@@ -26,12 +26,11 @@ class TransactionOffer(db.Model):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
def is_valid_transaction_offer(cls, transaction_offer_id, customer_id, product_id):
|
||||||
def is_valid_transaction_offer(cls, transaction_offer, customer_id, product_id):
|
|
||||||
transaction_offer = cls.query.filter_by(
|
transaction_offer = cls.query.filter_by(
|
||||||
id = transaction_offer,
|
id = transaction_offer_id,
|
||||||
customer_id = customer_id,
|
customer_id = customer_id,
|
||||||
product_id = product_id
|
# product_id = product_id
|
||||||
# transaction_id = transaction_id,
|
# transaction_id = transaction_id,
|
||||||
).first()
|
).first()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user