Silos/backend/app/schemas/user.py
AnuragJangid18 809235e962 feat: implement comments and activity panel in workspace
- Added CommentsPanel component for managing comments on documents.
- Integrated comment creation, deletion, and resolution functionalities.
- Implemented activity tracking for document interactions.
- Enhanced SketchPage with editing and saving capabilities.
- Introduced template management API endpoints for creating, sharing, and deleting templates.
- Added runtime validation report for frontend and backend.
- Created GettingStartedPanel for user onboarding with template options.
- Implemented Playwright E2E tests for accessibility and export functionality.
2026-10-22 21:18:10 +05:30

64 lines
1.7 KiB
Python

from datetime import datetime
from pydantic import BaseModel, ConfigDict, EmailStr, Field
class UserBase(BaseModel):
email: EmailStr
username: str = Field(min_length=3, max_length=100)
full_name: str = Field(min_length=1, max_length=255)
employee_id: str | None = Field(default=None, max_length=100)
phone: str | None = Field(default=None, max_length=50)
occupation: str | None = Field(default=None, max_length=150)
class UserCreate(UserBase):
password: str = Field(min_length=8, max_length=128)
class UserUpdate(BaseModel):
full_name: str | None = Field(default=None, min_length=1, max_length=255)
employee_id: str | None = Field(default=None, max_length=100)
phone: str | None = Field(default=None, max_length=50)
occupation: str | None = Field(default=None, max_length=150)
class ChangePasswordRequest(BaseModel):
current_password: str = Field(min_length=1, max_length=128)
new_password: str = Field(min_length=8, max_length=128)
class UserResponse(UserBase):
model_config = ConfigDict(from_attributes=True)
id: int
is_active: bool
created_at: datetime
updated_at: datetime
class LoginRequest(BaseModel):
username_or_email: str = Field(min_length=1)
password: str = Field(min_length=1)
remember_me: bool = False
class TokenResponse(BaseModel):
access_token: str
refresh_token: str
token_type: str = "bearer"
user: UserResponse
class ForgotPasswordRequest(BaseModel):
email: EmailStr
class ResetPasswordRequest(BaseModel):
token: str
new_password: str = Field(min_length=8, max_length=128)
class MessageResponse(BaseModel):
message: str
reset_token: str | None = None