chore: add quantity stat

This commit is contained in:
2026-05-17 14:54:59 +02:00
parent 94fa9de6a7
commit a8696b12fa
4 changed files with 158 additions and 4 deletions
+15
View File
@@ -90,6 +90,20 @@ export interface ProductStat {
category_color: string;
}
export interface QuantityStat {
quantity: number;
order_count: number;
total_sold: number;
revenue: number;
}
export interface ProductQuantityBreakdown {
product_id: number;
name: string;
category_color: string;
total_orders: number;
quantities: QuantityStat[];
}
export interface AdminStats {
summary: StatsSummary;
by_weekday: WeekdayStat[];
@@ -97,6 +111,7 @@ export interface AdminStats {
by_day_revenue: DayRevenueStat[];
by_hour: HourStat[];
top_products: ProductStat[];
by_quantity: ProductQuantityBreakdown[];
}
export const getAdminStats = async (): Promise<AdminStats> => {