from sqlalchemy import Integer, String, Text
from sqlalchemy.orm import Mapped, mapped_column

from app.models.base import Base, TimestampMixin, SoftDeleteMixin


class OpenType(Base, TimestampMixin, SoftDeleteMixin):
    __tablename__ = "open_type"

    id: Mapped[str] = mapped_column(
        String(32), primary_key=True, comment="主键"
    )
    type_name: Mapped[str] = mapped_column(
        String(128), nullable=False, comment="标题名称"
    )
    open_type: Mapped[int] = mapped_column(
        Integer, nullable=False, unique=True, index=True, comment="开户方式id"
    )
    description: Mapped[str | None] = mapped_column(
        Text, nullable=True, comment="开户方式描述"
    )
    thumb: Mapped[str | None] = mapped_column(
        String(255), nullable=True, comment="缩略图"
    )