from pydantic import BaseModel, ConfigDict, EmailStr

# Modèle Post
class Post(BaseModel):
    """ Post model defines in jsonplaceholder api."""
    userId: int
    title: str
    body: str

# Modèle Comment
class Comment(BaseModel):
    """ Comment model defines in jsonplaceholder api."""
    postId: int
    name: str
    email: EmailStr
    body: str
    
# Modèle de base réutilisable
class DbBaseModel(BaseModel):
    """ Generic base model for database records."""
    id: int
    model_config = ConfigDict(extra='allow')