"""SQLAlchemy models for {{ module_name }} domain."""

from datetime import datetime
from sqlalchemy import Column, DateTime, Integer, String, Text, Boolean
from sqlalchemy.sql import func

from config.database import Base


class {{ module_name_title }}(Base):
    """{{ module_name_title }} model."""
    
    __tablename__ = "{{ module_name }}s"
    
    id = Column(Integer, primary_key=True, index=True)
    name = Column(String(100), nullable=False, index=True)
    description = Column(Text, nullable=True)
    is_active = Column(Boolean, default=True)
    created_at = Column(DateTime(timezone=True), server_default=func.now())
    updated_at = Column(DateTime(timezone=True), onupdate=func.now())
    
    def __repr__(self):
        return f"<{{ module_name_title }}(id={self.id}, name='{self.name}')>"
