from datetime import datetime, timezone
from typing import Optional
from sqlmodel import Field, SQLModel


class Tool(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    nom: str
    description: Optional[str] = None
    categorie: Optional[str] = None  # beche|fourche|griffe|arrosage|taille|autre
    photo_url: Optional[str] = None
    created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
