chore: add quantity stat
This commit is contained in:
@@ -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> => {
|
||||
|
||||
Reference in New Issue
Block a user