from datetime import datetime from pydantic import BaseModel, ConfigDict, Field from app.models import Role class LoginRequest(BaseModel): username: str = Field(min_length=1, max_length=255) password: str = Field(min_length=1, max_length=1024) class UserOut(BaseModel): model_config = ConfigDict(from_attributes=True) id: int username: str role: Role is_active: bool created_at: datetime class PasswordChangeRequest(BaseModel): current_password: str = Field(min_length=1, max_length=1024) new_password: str = Field(min_length=1, max_length=1024) class SessionOut(BaseModel): model_config = ConfigDict(from_attributes=True) id: int created_at: datetime last_seen_at: datetime expires_at: datetime ip: str | None user_agent: str | None current: bool = False class RevokedResponse(BaseModel): revoked: int