feat(F-149): completed feature
This commit is contained in:
@@ -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' },
|
||||
|
||||
@@ -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}`);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user