backend
This commit is contained in:
commit
d7666f7b2c
44 changed files with 2246 additions and 0 deletions
23
backend/schemas/user.py
Normal file
23
backend/schemas/user.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from pydantic import BaseModel, EmailStr
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
class UserBase(BaseModel):
|
||||
email: EmailStr
|
||||
|
||||
class UserCreate(UserBase):
|
||||
password: str
|
||||
name: Optional[str] = None # Conforme au PRD: nom/prénom optionnels
|
||||
|
||||
class UserLogin(UserBase):
|
||||
password: str
|
||||
|
||||
class UserResponse(UserBase):
|
||||
id: int
|
||||
is_active: bool
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
name: Optional[str] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True # Ancien orm_mode = True pour Pydantic v2+
|
Loading…
Add table
Add a link
Reference in a new issue