Files
plantillas-proyectos/backend/api/v1/modules/a76/item_presets/models.py

19 lines
796 B
Python

from typing import Any, Dict, List
from sqlalchemy import String, Integer, JSON
from sqlalchemy.orm import Mapped, mapped_column
from core.database import Base
from api.v1.common.base_models import TenantScopedMixin, TimestampMixin
class ItemPreset(Base, TenantScopedMixin, TimestampMixin):
__tablename__ = "item_presets"
__table_args__ = {"schema": "a76"}
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
name: Mapped[str] = mapped_column(String(100), nullable=False)
description: Mapped[str | None] = mapped_column(String(500), nullable=True)
items: Mapped[List[Dict[str, Any]]] = mapped_column(JSON, nullable=False, default=[])
def __repr__(self):
return f"<ItemPreset(id={self.id}, name='{self.name}')>"