feat: user init & refactors

This commit is contained in:
swve 2023-11-12 23:16:34 +01:00
parent b4dcc14749
commit a50fc67104
25 changed files with 356 additions and 358 deletions

43
apps/api/src/db/users.py Normal file
View file

@ -0,0 +1,43 @@
from typing import Optional
from sqlmodel import Field, SQLModel
class UserBase(SQLModel):
username: str
first_name: str
last_name: str
email: str
avatar_image: Optional[str] = ""
bio: Optional[str] = ""
class UserCreate(UserBase):
password: str
class UserUpdate(UserBase):
username: str
first_name: Optional[str]
last_name: Optional[str]
email: str
avatar_image: Optional[str] = ""
bio: Optional[str] = ""
class UserUpdatePassword(SQLModel):
user_id: int
old_password: str
new_password: str
class UserRead(UserBase):
id: int
class User(UserBase, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
password: str = ""
user_uuid: str = ""
email_verified: bool = False
creation_date: str = ""
update_date: str = ""