export interface ApiResponse<T = any> {
    data?: T;
    message?: string;
    error?: string;
}

export interface PaginatedResponse<T> {
    users?: T[];
    data?: T[];
    pagination: {
        page: number;
        limit: number;
        total: number;
        totalPages: number;
    };
}

export interface User {
    id: string;
    email: string;
    user_name: string;
    email_verified: boolean;
    created_at: string;
    updated_at?: string;
    deleted_at?: string | null;
    roles?: Role[];
}

export interface Role {
    id: string;
    name: string;
    description?: string;
}

export interface AuthResponse {
    access_token: string;
    refresh_token: string;
    user: User;
}

export interface CorsRule {
    id: string;
    origin: string;
    description?: string;
    is_active: boolean;
    created_by?: string;
    created_at: string;
    updated_at?: string;
}

export interface RateLimitRule {
    id: string;
    name: string;
    description?: string;
    max_requests: number;
    window_seconds: number;
    is_active: boolean;
    created_at: string;
    updated_at?: string;
}

export interface Tag {
    id: string;
    tag: string; // Backend uses 'tag' instead of 'name'
    is_active: boolean;
    created_at: string;
    updated_at?: string;
}

export interface Home {
    id: string;
    title: string;
    description?: string;
    image: string;
    video: string;
    button1: string;
    button2: string;
    slug: string;
    keywords: string;
    name: string;
    is_active: boolean;
    tags?: Tag[];
    created_at: string;
    updated_at?: string;
}

export interface Contact {
    id: string;
    name: string;
    email: string;
    phone?: string;
    subject?: string;
    message?: string;
    ip?: string;
    tags?: Tag[];
    is_active: boolean;
    created_at: string;
    updated_at?: string;
}

export interface About {
    id: string;
    title: string;
    image?: string;
    image_sub?: string;
    cv?: string;
    birthday?: string;
    city?: string;
    study?: string;
    website?: string;
    phone?: string;
    age?: number;
    interests?: string;
    degree?: string;
    x?: string;
    mail?: string;
    done?: number;
    project_done?: string;
    user_h?: number;
    hapy_user?: string;
    great?: number;
    great_reviews?: string;
    team?: number;
    support_team?: string;
    is_active: boolean;
    counter_active: boolean;
    created_at?: string;
    updated_at?: string;
}

export interface Service {
    id: string;
    title: string;
    content?: string;
    image?: string;
    slug: string;
    is_active: boolean;
    created_at: string;
    updated_at?: string;
}

export interface ServiceTitle {
    id: string
    title: string
    title_sub: string
    is_active: boolean
    created_at: string
    updated_at: string
}

export interface Education {
    id: string
    between_years: string
    title: string
    content: string
    resume_id?: string
    is_active: boolean
    created_at: string
    updated_at: string
}

export interface Experience {
    id: string
    between_years: string
    title: string
    content: string
    resume_id?: string
    is_active: boolean
    created_at: string
    updated_at: string
}

export interface Skill {
    id: string
    title: string
    degree: number
    resume_id?: string
    is_active: boolean
    created_at: string
    updated_at: string
}

export interface Knowledge {
    id: string
    title: string
    resume_id?: string
    is_active: boolean
    created_at: string
    updated_at: string
}

export interface Resume {
    id: string
    title: string
    title_sub: string
    education: string
    experience: string
    coding_skills: string
    knowledge: string
    is_active: boolean
    created_at: string
    updated_at: string
    educations?: Education[]
    experiences?: Experience[]
    skills?: Skill[]
    knowledges?: Knowledge[]
}

export interface SiteInfo {
    id: string
    title: string
    w_logo: string
    b_logo: string
    phone?: string
    email?: string
    address?: string
    copyright?: string
    map_embed?: string
    created_at: string
    updated_at: string
}

export interface Banner {
    id: string
    image: string
    image_k?: string
    title?: string
    sub_title?: string
    link?: string
    is_active: boolean
    created_at: string
    updated_at: string
}

export interface SiteSettings {
    id: string
    is_active: boolean
    site_active: boolean
    created_at: string
    updated_at: string
}

export interface MainMenu {
    id: string
    home: string
    about: string
    services: string
    resume: string
    portfolio: string
    contact: string
    is_active: boolean
    created_at: string
    updated_at: string
}
