26 lines
509 B
Python
26 lines
509 B
Python
from pydantic import BaseModel
|
|
from datetime import date
|
|
|
|
class CustomerBase(BaseModel):
|
|
full_name: str
|
|
email: str
|
|
phone: str
|
|
home_branch_id: int
|
|
customer_since: date
|
|
|
|
class Customer(CustomerBase):
|
|
customer_id: int
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
class AccountBase(BaseModel):
|
|
customer_id: int
|
|
account_type: str
|
|
open_date: date
|
|
balance: float
|
|
|
|
class Account(AccountBase):
|
|
account_id: int
|
|
account_number: str
|
|
class Config:
|
|
orm_mode = True
|