Update app/schemas.py
This commit is contained in:
parent
78df9e4897
commit
6a5d9e5f8e
1 changed files with 25 additions and 6 deletions
|
|
@ -1,26 +1,45 @@
|
|||
from pydantic import BaseModel
|
||||
from datetime import date
|
||||
from typing import Optional
|
||||
|
||||
# -----------------------
|
||||
# Customer Schemas
|
||||
# -----------------------
|
||||
class CustomerBase(BaseModel):
|
||||
full_name: str
|
||||
email: str
|
||||
phone: str
|
||||
home_branch_id: int
|
||||
customer_since: date
|
||||
phone: Optional[str] = None
|
||||
date_of_birth: Optional[date] = None
|
||||
age: Optional[int] = None
|
||||
gender: Optional[str] = None
|
||||
street_address: Optional[str] = None
|
||||
city: Optional[str] = None
|
||||
state: Optional[str] = None
|
||||
zip_code: Optional[str] = None
|
||||
home_branch_id: Optional[int] = None
|
||||
customer_since: Optional[date] = None
|
||||
employment_status: Optional[str] = None
|
||||
annual_income: Optional[float] = None
|
||||
credit_score: Optional[int] = None
|
||||
preferred_contact_method: Optional[str] = None
|
||||
|
||||
class Customer(CustomerBase):
|
||||
customer_id: int
|
||||
customer_id: str # now a string
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
# -----------------------
|
||||
# Account Schemas
|
||||
# -----------------------
|
||||
class AccountBase(BaseModel):
|
||||
customer_id: int
|
||||
customer_id: str # now a string
|
||||
account_type: str
|
||||
open_date: date
|
||||
balance: float
|
||||
branch_id: Optional[int] = None
|
||||
|
||||
class Account(AccountBase):
|
||||
account_id: int
|
||||
account_id: str # now a string
|
||||
account_number: str
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
|
|
|||
Loading…
Reference in a new issue