Nuevos cambios en el backend
This commit is contained in:
@@ -125,3 +125,18 @@ class ExportResponse(BaseModel):
|
||||
template_id: uuid.UUID
|
||||
format: ExportFormat
|
||||
content: str
|
||||
|
||||
|
||||
class ExamHistoryItem(BaseModel):
|
||||
id: uuid.UUID
|
||||
title: str
|
||||
subject: str
|
||||
educational_level: str
|
||||
language: str
|
||||
question_count: int
|
||||
export_count: int
|
||||
last_export_at: datetime | None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, EmailStr, Field
|
||||
|
||||
|
||||
class UserRegister(BaseModel):
|
||||
email: EmailStr
|
||||
password: str = Field(min_length=8, max_length=128)
|
||||
full_name: str | None = Field(default=None, max_length=200)
|
||||
|
||||
|
||||
class UserLogin(BaseModel):
|
||||
email: EmailStr
|
||||
password: str = Field(min_length=1, max_length=128)
|
||||
|
||||
|
||||
class UserRead(BaseModel):
|
||||
id: uuid.UUID
|
||||
email: EmailStr
|
||||
full_name: str | None
|
||||
created_at: datetime
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class GoogleLoginRequest(BaseModel):
|
||||
"""ID token obtenido en el frontend con Google Identity Services (Sign in with Google)."""
|
||||
|
||||
id_token: str = Field(min_length=10, max_length=8_000)
|
||||
|
||||
|
||||
class TokenResponse(BaseModel):
|
||||
access_token: str
|
||||
token_type: str = "bearer"
|
||||
Reference in New Issue
Block a user