feat(F-149): completed feature

This commit is contained in:
chattie
2026-08-22 13:05:43 +02:00
parent c497d5be99
commit 6a51d1ee74
15 changed files with 551 additions and 21 deletions

View File

@@ -43,6 +43,9 @@ export interface NavItem {
export const NAV_ITEMS: NavItem[] = [
{ href: '/', label: 'Dashboard', icon: '📊', permission: 'dashboard' },
{ href: '/reporting', label: 'Reporting', icon: '📈', permission: 'reporting.read' },
{ href: '/reporting/dashboard', label: ' Dashboard', icon: '📊', permission: 'reporting.read' },
{ href: '/reporting/sales', label: ' Ventas', icon: '🧾', permission: 'reporting.read' },
{ href: '/reporting/products', label: ' Productos', icon: '📦', permission: 'reporting.read' },
{ href: '/products', label: 'Productos', icon: '📦', permission: 'products.read' },
{ href: '/orders', label: 'Pedidos', icon: '🧾', permission: 'orders.read' },
{ href: '/payments', label: 'Pagos', icon: '💳', permission: 'orders.read' },

View File

@@ -82,6 +82,19 @@ export interface SalesRow {
metrics: Metrics;
}
export interface ProductRow {
productId: string;
productName: string;
sku: string | null;
category: string | null;
brand: string | null;
metrics: Metrics;
}
export interface ProductsResponse extends Omit<SalesResponse, 'items'> {
items: ProductRow[];
}
export interface SalesResponse extends SummaryResponse {
filters: {
channel: ReportingChannel;
@@ -152,4 +165,9 @@ export const reportingClient = {
const qs = filtersToQueryString(filters);
return api.get<SalesResponse>(`/api/reporting/sales?${qs}`);
},
async fetchProducts(filters: ReportingFilters): Promise<ProductsResponse> {
const qs = filtersToQueryString(filters);
return api.get<ProductsResponse>(`/api/reporting/products?${qs}`);
},
};