[add]: transaction fix
This commit is contained in:
@@ -65,6 +65,7 @@ class ProvideLoanService(BaseService):
|
|||||||
"message": "Invalid Offer."
|
"message": "Invalid Offer."
|
||||||
}), 400
|
}), 400
|
||||||
|
|
||||||
|
|
||||||
# Log Transaction
|
# Log Transaction
|
||||||
transaction = ProvideLoanService.log_transaction(validated_data=validated_data)
|
transaction = ProvideLoanService.log_transaction(validated_data=validated_data)
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,15 @@ class TransactionOffer(db.Model):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_valid_transaction_offer(cls, offer_id):
|
|
||||||
transaction_offer = cls.query.filter_by(id=str(offer_id)).first()
|
def is_valid_transaction_offer(cls, transaction_offer, customer_id, product_id):
|
||||||
|
transaction_offer = cls.query.filter_by(
|
||||||
|
id = transaction_offer,
|
||||||
|
customer_id = customer_id,
|
||||||
|
product_id = product_id
|
||||||
|
# transaction_id = transaction_id,
|
||||||
|
).first()
|
||||||
|
|
||||||
|
|
||||||
if not transaction_offer:
|
if not transaction_offer:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user