/**
 * Tipe model konten — dipakai halaman publik & admin.
 * Disesuaikan dengan skema docs-ai/07-database-schema.md.
 */

export type HeroSlide = {
    id: number;
    title: string;
    subtitle: string | null;
    description: string | null;
    badge: string | null;
    cta_label: string | null;
    cta_link: string | null;
    cta_secondary_label: string | null;
    cta_secondary_link: string | null;
    usp1: string | null;
    usp2: string | null;
    usp3: string | null;
    image: string | null;
};

/** Preview section about di Home (deskripsi + visi/misi dinamis dari modul About, support Tiptap HTML). */
export type AboutPreview = {
    title: string;
    description: string;
    description_html?: string | null;
    vision: string | null;
    mission: string | null;
    vision_html?: string | null;
    mission_html?: string | null;
    image: string | null;
    url: string;
};

export type AboutSectionTranslation = {
    title: string;
    description: string;
    vision: string;
    mission: string;
};

export type AboutStat = {
    id: number;
    value: string;
    icon: string | null;
    sort_order: number;
    created_at: string | null;
    updated_at: string | null;
    translations: {
        id: { label: string };
        en: { label: string };
    };
};

/** Section about untuk halaman admin (form edit + daftar stats). */
export type AboutSectionAdmin = {
    id: number;
    is_active: boolean;
    cover_url: string | null;
    gallery: { id: number; url: string }[];
    translations: {
        id: AboutSectionTranslation;
        en: AboutSectionTranslation;
    };
    stats: AboutStat[];
};

/** Section about untuk halaman publik /{locale}/tentang. */
export type AboutSectionPublic = {
    id: number;
    title: string;
    description: string;
    vision: string | null;
    mission: string | null;
    image: string | null;
    gallery: { id: number; url: string }[];
    stats: {
        id: number;
        value: string;
        icon: string | null;
        label: string;
    }[];
};

/** Layanan untuk halaman publik /{locale}/layanan. */
export type ServicePublic = {
    id: number;
    icon: string;
    name: string;
    slug: string;
    short_description: string | null;
    description: string | null;
    image: string | null;
};

/** Preview layanan di Home (3 pertama). */
export type ServicePreview = {
    id: number;
    icon: string;
    name: string;
    slug: string;
    short_description: string | null;
};

/** Testimoni untuk carousel di Home. */
export type TestimonialPublic = {
    id: number;
    rating: number;
    author_name: string;
    author_position: string | null;
    company: string | null;
    content: string;
    avatar: string | null;
    gallery: { id: number; url: string }[];
};

/** Testimoni untuk halaman admin (form edit + DataTable) — non-translatable. */
export type TestimonialAdmin = {
    id: number;
    author_name: string;
    author_position: string | null;
    company: string | null;
    content: string;
    rating: number;
    is_active: boolean;
    sort_order: number;
    avatar_url: string | null;
    gallery: { id: number; url: string }[];
    created_at: string | null;
    updated_at: string | null;
};

/** Kategori blog untuk admin (DataTable + dialog). */
export type BlogCategory = {
    id: number;
    name: string;
    sort_order: number;
    posts_count: number;
    created_at: string | null;
    updated_at: string | null;
    translations: {
        id: { name: string; slug: string };
        en: { name: string; slug: string };
    };
};

/** Postingan untuk halaman admin (form edit + DataTable). */
export type PostAdmin = {
    id: number;
    title: string;
    status: 'draft' | 'scheduled' | 'published';
    published_at: string | null;
    reading_time: number;
    category_ids: number[];
    categories: string[];
    author_name: string | null;
    cover_url: string | null;
    translations: {
        id: {
            title: string;
            slug: string;
            excerpt: string;
            body: string;
        };
        en: {
            title: string;
            slug: string;
            excerpt: string;
            body: string;
        };
    };
};

/** Postingan untuk halaman publik (list + detail). */
export type PostPublic = {
    id: number;
    title: string;
    slug: string;
    excerpt: string | null;
    body: string;
    published_at: string | null;
    categories: { name: string; slug: string }[];
    author: string | null;
    image: string | null;
    views: number;
    reading_time: number;
};

/** Preview postingan di Home (3 terbaru). */
export type PostPreview = {
    id: number;
    title: string;
    slug: string;
    excerpt: string | null;
    published_at: string | null;
    categories: { name: string; slug: string }[];
    author_name: string | null;
    image: string | null;
    views?: number;
};

/** Kategori untuk filter di halaman blog publik. */
export type BlogCategoryPublic = {
    id: number;
    name: string;
    slug: string;
};
