Looking for customer
This commit is contained in:
@@ -29,7 +29,6 @@ class LoanStatusService(BaseService):
|
|||||||
# Validate data
|
# Validate data
|
||||||
validated_data = LoanStatusService.validate_data(data, LoanStatusSchema())
|
validated_data = LoanStatusService.validate_data(data, LoanStatusSchema())
|
||||||
|
|
||||||
|
|
||||||
customer_id = validated_data.get('customerId')
|
customer_id = validated_data.get('customerId')
|
||||||
customer = Customer.get_customer(customer_id)
|
customer = Customer.get_customer(customer_id)
|
||||||
transactionId = validated_data.get('transactionId')
|
transactionId = validated_data.get('transactionId')
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
|
|
||||||
|
from app.api.services.offer_analysis import logger
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.models.account import Account
|
from app.models.account import Account
|
||||||
from sqlalchemy.exc import IntegrityError
|
from sqlalchemy.exc import IntegrityError
|
||||||
from sqlalchemy.sql import func
|
from sqlalchemy.sql import func
|
||||||
|
from app.utils.logger import logger
|
||||||
|
|
||||||
class Customer(db.Model):
|
class Customer(db.Model):
|
||||||
__tablename__ = 'customers'
|
__tablename__ = 'customers'
|
||||||
@@ -73,6 +76,7 @@ class Customer(db.Model):
|
|||||||
"""
|
"""
|
||||||
Get customer by ID.
|
Get customer by ID.
|
||||||
"""
|
"""
|
||||||
|
logger.error(f"Looking for customer *** {customer_id}")
|
||||||
customer = cls.query.filter_by(id=customer_id).first()
|
customer = cls.query.filter_by(id=customer_id).first()
|
||||||
|
|
||||||
if not customer:
|
if not customer:
|
||||||
|
|||||||
Reference in New Issue
Block a user