feat: analytics

This commit is contained in:
ferdiansyah783
2025-08-07 23:48:31 +07:00
parent a5d22db27b
commit 687f59a9fa
10 changed files with 1651 additions and 85 deletions
+48
View File
@@ -0,0 +1,48 @@
export interface SalesSummary {
total_sales: number;
total_orders: number;
total_items: number;
average_order_value: number;
total_tax: number;
total_discount: number;
net_sales: number;
}
export interface SalesDataItem {
date: string; // ISO string, e.g., "2025-08-03T00:00:00Z"
sales: number;
orders: number;
items: number;
tax: number;
discount: number;
net_sales: number;
}
export interface SalesReport {
organization_id: string;
outlet_id: string;
date_from: string; // ISO string with timezone, e.g., "2025-08-01T00:00:00+07:00"
date_to: string; // ISO string with timezone
group_by: string; // e.g., "day", "month", etc.
summary: SalesSummary;
data: SalesDataItem[];
}
export interface ProductData {
product_id: string
product_name: string
category_id: string
category_name: string
quantity_sold: number
revenue: number
average_price: number
order_count: number
}
export interface ProductSalesReport {
organization_id: string
outlet_id: string
date_from: string
date_to: string
data: ProductData[]
}