export interface Product {
    id: number;
    package_name_id: number;
    title: string | null;
    price: number | null;
    type: number | null;
    uuid: string;
    created_at: string;
    updated_at: string;
    descriptions: string[] | null;
}

export interface CreateProductData {
    title: string;
    price: number;
    type: number;
    descriptions?: string[];
}

export interface UpdateProductData {
    title?: string;
    price?: number;
    type?: number;
    descriptions?: string[];
}

export interface ApiResponse<T> {
    data: T;
    message?: string;
    status?: number;
}

// Product types mapping
export const PRODUCT_TYPES = {
    1: 'دائمی',
    2: 'سالیانه',
    3: '۶ ماهه',
    4: 'ماهیانه'
} as const;

export type ProductType = keyof typeof PRODUCT_TYPES;

export const getProductTypeLabel = (type: number | null): string => {
    if (!type) return 'نامشخص';
    return PRODUCT_TYPES[type as ProductType] || 'نامشخص';
};