/**
 * Tipos TypeScript para el dashboard
 */

export interface KPIMetric {
	label: string;
	value: number;
	previous_value?: number;
	percentage_change?: number;
	trend?: 'up' | 'down' | 'stable';
	unit?: string;
}

export interface ActivityItem {
	id: number;
	type: string;
	title: string;
	description?: string;
	timestamp: string;
	status?: string;
	icon?: string;
}

export interface ChartDataPoint {
	label: string;
	value: number;
	category?: string;
}

export interface DashboardStats {
	total_invoices: KPIMetric;
	total_pedimentos: KPIMetric;
	total_clients: KPIMetric;
	total_providers: KPIMetric;
	active_items: KPIMetric;
	pending_approvals: KPIMetric;
	total_value_imports?: number;
	total_value_exports?: number;
	invoices_by_month: ChartDataPoint[];
	operations_by_type: ChartDataPoint[];
	top_clients: ChartDataPoint[];
	top_providers: ChartDataPoint[];
	recent_activity: ActivityItem[];
	generated_at: string;
	company_id: number;
	company_name?: string;
}

export interface OperationsOverview {
	total_operations: number;
	by_type: Record<string, number>;
	by_status: Record<string, number>;
	avg_processing_time?: number;
}

export interface InventoryMetrics {
	total_items: number;
	items_in_stock: number;
	items_low_stock: number;
	total_value?: number;
	by_category: Record<string, number>;
}
