Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dc21f41894 | |||
| 17db2cf8f9 | |||
| f07866a884 |
@@ -80,6 +80,7 @@ class ProvideLoanService(BaseService):
|
||||
# "message": "Invalid Offer."
|
||||
# }), 400
|
||||
|
||||
|
||||
# Log Transaction
|
||||
transaction = ProvideLoanService.log_transaction(validated_data=validated_data)
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ class SelectOfferService(BaseService):
|
||||
transaction_offer_id = validated_data.get("offerId")
|
||||
transaction_id = validated_data.get("transactionId")
|
||||
request_id = validated_data.get("requestId")
|
||||
|
||||
|
||||
offer_id = int(transaction_offer_id[5:]) # The last part is int
|
||||
|
||||
#"offerId": "SAL30001129",
|
||||
|
||||
if SelectOfferService.validate_account_ownership(
|
||||
account_id=account_id, customer_id=customer_id
|
||||
|
||||
@@ -6,6 +6,8 @@ from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.orm import relationship
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Loan(db.Model):
|
||||
|
||||
@@ -26,14 +26,15 @@ class TransactionOffer(db.Model):
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def is_valid_transaction_offer(cls, offer_id, customer_id, product_id):
|
||||
def is_valid_transaction_offer(cls, transaction_offer_id, customer_id, product_id):
|
||||
transaction_offer = cls.query.filter_by(
|
||||
id = str(offer_id),
|
||||
id = transaction_offer_id,
|
||||
customer_id = customer_id,
|
||||
# product_id = product_id
|
||||
# transaction_id = transaction_id,
|
||||
).first()
|
||||
|
||||
|
||||
if not transaction_offer:
|
||||
return False
|
||||
return transaction_offer
|
||||
|
||||
Reference in New Issue
Block a user