from __future__ import annotations
from typing import Optional
from sqlalchemy import String, Text
from sqlalchemy.orm import Mapped, mapped_column
from src.database.base import BaseModel


class CmsPage(BaseModel):
    __tablename__ = "cms_pages"

    name: Mapped[str] = mapped_column(String(100), nullable=False)
    path: Mapped[str] = mapped_column(String(255), nullable=False, unique=True, index=True)
    headline: Mapped[Optional[str]] = mapped_column(String(500), nullable=True)
    subhead: Mapped[Optional[str]] = mapped_column(String(500), nullable=True)
    seo_title: Mapped[Optional[str]] = mapped_column(String(255), nullable=True)
    seo_description: Mapped[Optional[str]] = mapped_column(Text, nullable=True)
    status: Mapped[str] = mapped_column(String(20), nullable=False, default="Draft")
