from __future__ import annotations
from typing import List
from sqlalchemy import String, Text, Integer, Index
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.orm import Mapped, mapped_column
from src.database.base import BaseModel


class WhoWeServeCategory(BaseModel):
    """A fixed persona category card on the public Who We Serve marketing page."""

    __tablename__ = "who_we_serve_categories"
    __table_args__ = (
        Index("ix_who_we_serve_categories_sort_order", "sort_order"),
    )

    category_key: Mapped[str] = mapped_column(String(30), nullable=False, unique=True, index=True)
    badge_label: Mapped[str] = mapped_column(String(50), nullable=False)
    heading: Mapped[str] = mapped_column(String(200), nullable=False)
    intro: Mapped[str] = mapped_column(Text, nullable=False)
    points: Mapped[List[str]] = mapped_column(JSONB, nullable=False)
    sort_order: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
