[update]: Eligibility check request

This commit is contained in:
VivianDee
2025-03-31 14:09:30 +01:00
parent 86a4b4f9b4
commit 6185c2df08
6 changed files with 84 additions and 41 deletions
+3 -3
View File
@@ -27,10 +27,10 @@ class Account(db.Model):
def is_valid_account(cls, account_id, customer_id):
account = cls.query.filter_by(id=account_id, customer_id=customer_id).first()
if not account:
return False, "Account not found or doesn't belong to customer"
return False
if account.lien_amount > 0:
return False, "Account has an existing lien"
return True, "Account is valid"
return False
return True
def __repr__(self):
return f'<Account {self.id}>'