Fix loan id
This commit is contained in:
@@ -47,7 +47,9 @@ class ProvideLoanService(BaseService):
|
|||||||
|
|
||||||
if (ProvideLoanService.validate_account_ownership(account_id = account_id, customer_id = customer_id)):
|
if (ProvideLoanService.validate_account_ownership(account_id = account_id, customer_id = customer_id)):
|
||||||
|
|
||||||
transaction_offer = TransactionOffer.is_valid_transaction_offer(offer_id = offer_id)
|
transaction_offer_id = int(offer_id[5:]) # The last part is int
|
||||||
|
|
||||||
|
transaction_offer = TransactionOffer.is_valid_transaction_offer(transaction_offer_id)
|
||||||
if not transaction_offer:
|
if not transaction_offer:
|
||||||
logger.error(f"Invalid Transaction Offer")
|
logger.error(f"Invalid Transaction Offer")
|
||||||
return jsonify({
|
return jsonify({
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ class TransactionOffer(db.Model):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_valid_transaction_offer(cls, offer_id):
|
def is_valid_transaction_offer(cls, offer_id):
|
||||||
offer = cls.query.filter_by(id=str(offer_id)).first()
|
transaction_offer = cls.query.filter_by(id=str(offer_id)).first()
|
||||||
|
|
||||||
if not offer:
|
if not transaction_offer:
|
||||||
return False
|
return False
|
||||||
return offer
|
return transaction_offer
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_transaction_offer(cls, customer_id, transaction_id, offer_id, min_amount, max_amount, eligible_amount=None, product_id=None, tenor=None):
|
def create_transaction_offer(cls, customer_id, transaction_id, offer_id, min_amount, max_amount, eligible_amount=None, product_id=None, tenor=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user