[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
+2 -2
View File
@@ -20,8 +20,8 @@ class Customer(db.Model):
@classmethod
def create_customer(cls, id, msisdn, country_code, account_id, account_type='savings'):
if cls.query.filter_by(msisdn=msisdn).first():
return False, "Customer with this MSISDN already exists"
if cls.query.filter_by(id=id).first():
raise ValueError("Customer already exists")
# Create the customer
customer = cls(id=id, msisdn=msisdn, country_code=country_code)