porridger/back/schema.py

47 lines
751 B
Python

# import uuid
# from fastapi_users import schemas
# class UserRead(schema.BaseUser[uuid.UUID]):
# pass
# class UserCreate(schema.BaseUserCreate):
# pass
# class UserUpdate(schema.BaseUserUpdate):
# pass
from pydantic import BaseModel
from typing import Annotated, Union
class Book(BaseModel):
id: int
class Token(BaseModel):
access_token: str
# token_type: str
class TokenData(BaseModel):
email: Union[str, None] = None
class User(BaseModel):
id: int
phone: Union[int, None] = None
email: str
name: Union[str, None] = None
surname: str
disabled: Union[bool, None] = None
class Config:
orm_mode = True
class UserInDB(User):
password: str
hashed_password: str