""" App A Models - Database models using SQLModel. """ from typing import Optional from datetime import datetime from sqlmodel import SQLModel, Field class UserBase(SQLModel): """Base user model with shared fields.""" username: str = Field(index=True, max_length=50) email: str = Field(index=True, max_length=100) full_name: Optional[str] = Field(default=None, max_length=100) is_active: bool = Field(default=True) class User(UserBase, table=True): """ User table model. Represents users in the system. """ __tablename__ = "users" id: Optional[int] = Field(default=None, primary_key=True) hashed_password: str = Field(max_length=255) created_at: datetime = Field(default_factory=datetime.utcnow) updated_at: datetime = Field(default_factory=datetime.utcnow) class Config: json_schema_extra = { "example": { "username": "john_doe", "email": "john@example.com", "full_name": "John Doe", "is_active": True, } }