Add app/schemas.py
This commit is contained in:
parent
dc38f256aa
commit
7a2d2daa55
1 changed files with 26 additions and 0 deletions
26
app/schemas.py
Normal file
26
app/schemas.py
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
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
|
||||||
Loading…
Reference in a new issue