// User types
export interface User {
    id: number;
    email: string;
    name: string;
    role: 'user' | 'admin';
    created_at: Date;
    two_factor_enabled?: boolean;
    email_verified?: boolean;
    newsletter_subscribed?: boolean;
}

export interface UserWithPassword extends User {
    password_hash: string;
}

// Category types
export interface Category {
    id: number;
    name: string;
    description: string | null;
    image_url?: string | null;
    created_at: Date;
    updated_at: Date;
}

// Product types
export interface Product {
    id: number;
    category_id: number;
    name: string;
    description: string | null;
    price: number;
    stock: number;
    image_url: string | null;
    created_at: Date;
    updated_at: Date;
}

export interface ProductWithCategory extends Product {
    category_name: string;
}

// Auth types
export interface AuthResponse {
    token: string;
    user: User;
}

export interface LoginRequest {
    email: string;
    password: string;
    rememberMe?: boolean;
}

export interface RegisterRequest {
    email: string;
    username: string;
    password: string;
    name: string;
    newsletter?: boolean;
}

// API Request types
export interface CreateCategoryRequest {
    name: string;
    description?: string;
    image_url?: string;
}

export interface UpdateCategoryRequest {
    name?: string;
    description?: string;
    image_url?: string;
    show_on_homepage?: boolean;
}

export interface CreateProductRequest {
    category_id: number;
    name: string;
    description?: string;
    price: number;
    stock: number;
    image_url?: string;
}

export interface UpdateProductRequest {
    category_id?: number;
    name?: string;
    description?: string;
    price?: number;
    stock?: number;
    image_url?: string;
}
