From 78df9e4897745af43c763acf5c7d27b9db421048 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 10 Dec 2025 21:48:31 +0000 Subject: [PATCH] Update app/models.py --- app/models.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/app/models.py b/app/models.py index b046ff0..c32d059 100644 --- a/app/models.py +++ b/app/models.py @@ -3,18 +3,32 @@ from app.database import Base class Customer(Base): __tablename__ = "customers" - customer_id = Column(Integer, primary_key=True, index=True) - full_name = Column(String, index=True) - email = Column(String, unique=True) - phone = Column(String) + + customer_id = Column(String(20), primary_key=True, index=True) # IDs are strings now + full_name = Column(String(100), index=True) + email = Column(String(100), unique=True) + phone = Column(String(50)) + date_of_birth = Column(Date) + age = Column(Integer) + gender = Column(String(20)) + street_address = Column(String(100)) + city = Column(String(50)) + state = Column(String(10)) + zip_code = Column(String(20)) home_branch_id = Column(Integer) customer_since = Column(Date) + employment_status = Column(String(50)) + annual_income = Column(Float) + credit_score = Column(Integer) + preferred_contact_method = Column(String(20)) class Account(Base): __tablename__ = "accounts" - account_id = Column(Integer, primary_key=True, index=True) - account_number = Column(String, unique=True, index=True) - customer_id = Column(Integer) - account_type = Column(String) + + account_id = Column(String(20), primary_key=True, index=True) # IDs are strings now + account_number = Column(String(20), unique=True, index=True) + customer_id = Column(String(20)) # matches Customer.customer_id + account_type = Column(String(20)) open_date = Column(Date) balance = Column(Float) + branch_id = Column(Integer) \ No newline at end of file