[add]: loan charges and offers. Fix RACCheck
This commit is contained in:
+3
-3
@@ -48,8 +48,8 @@ class Loan(db.Model):
|
||||
def create_loan(cls, customer_id, account_id, offer_id, product_id, initial_loan_amount, collection_type, transaction_id, status='pending'):
|
||||
|
||||
# Check if customer exists
|
||||
is_valid = Customer.is_valid_customer(customer_id)
|
||||
if not is_valid:
|
||||
customer = Customer.is_valid_customer(customer_id)
|
||||
if not customer:
|
||||
raise ValueError("Customer does not exist")
|
||||
|
||||
now = datetime.now(timezone.utc)
|
||||
@@ -67,7 +67,7 @@ class Loan(db.Model):
|
||||
due_date=now,
|
||||
status = status
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
db.session.add(loan)
|
||||
except IntegrityError as err:
|
||||
|
||||
Reference in New Issue
Block a user