"""
Testimonials section component schemas.

Mirrors lightwave-ui/src/components/marketing/testimonials/.
"""

from pydantic import BaseModel, ConfigDict, Field

from lightwave.schema.pydantic.ui.types import CompanyInfo, CTAProps, PersonInfo


class TestimonialProps(BaseModel):
    """
    Single testimonial props.

    Matches TypeScript:
        interface TestimonialProps {
            id?: string;
            quote: string;
            author: PersonInfo;
            company?: CompanyInfo;
            rating?: number;
        }
    """

    id: str | None = Field(None, description="Unique identifier")
    quote: str = Field(..., description="Testimonial quote")
    author: PersonInfo = Field(..., description="Author information")
    company: CompanyInfo | None = Field(None, description="Company information")
    rating: int | None = Field(None, ge=1, le=5, description="Star rating 1-5")

    model_config = ConfigDict(
        populate_by_name=True,
        extra="forbid",
    )


class ReviewProps(BaseModel):
    """
    Social review/card props.

    Matches TypeScript:
        interface ReviewProps {
            id?: string;
            quote?: string;
            author: string;
            cite?: string;
            imageUrl?: string;
            industry?: string;
            platform?: string;
            verified?: boolean;
        }
    """

    id: str | None = Field(None, description="Unique identifier")
    quote: str | None = Field(None, description="Review quote")
    author: str = Field(..., description="Author name")
    cite: str | None = Field(None, description="Citation (job title)")
    image_url: str | None = Field(None, serialization_alias="imageUrl", description="Author photo URL")
    industry: str | None = Field(None, description="Industry/category")
    platform: str | None = Field(None, description="Platform (twitter, linkedin, etc.)")
    verified: bool = Field(False, description="Verified review")

    model_config = ConfigDict(
        populate_by_name=True,
        extra="forbid",
    )


class TestimonialsSectionProps(BaseModel):
    """
    Base testimonials section props.
    """

    eyebrow: str | None = Field(None, description="Small text above heading")
    headline: str | None = Field(None, description="Section headline")
    description: str | None = Field(None, description="Section description")
    testimonials: list[TestimonialProps] | None = Field(None, description="List of testimonials")
    reviews: list[ReviewProps] | None = Field(None, description="List of reviews")
    cta: CTAProps | None = Field(None, description="Optional CTA")
    secondary_cta: CTAProps | None = Field(None, serialization_alias="secondaryCta", description="Secondary CTA")

    model_config = ConfigDict(
        populate_by_name=True,
        extra="forbid",
    )


class TestimonialGlassmorphicCards01Props(TestimonialsSectionProps):
    """
    Testimonials with glassmorphic card design.

    Component uses a carousel of cards with glassmorphic overlay.
    """

    show_carousel_controls: bool | None = Field(
        True,
        serialization_alias="showCarouselControls",
        description="Show carousel nav buttons",
    )


__all__ = [
    "TestimonialProps",
    "ReviewProps",
    "TestimonialsSectionProps",
    "TestimonialGlassmorphicCards01Props",
]
