[add]: loan charges and offers. Fix RACCheck

This commit is contained in:
VivianDee
2025-04-16 21:36:26 +01:00
parent 359621dc9d
commit 93ed8b3d17
12 changed files with 161 additions and 71 deletions
+3 -3
View File
@@ -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: