fix(payment): group dashboard stats by currency

This commit is contained in:
haruka
2026-07-26 03:18:30 +08:00
parent 2730c1c43b
commit 6d99e668d2
9 changed files with 324 additions and 112 deletions
+26 -6
View File
@@ -222,13 +222,33 @@ export interface CreateOrderResult {
jsapi_payload?: WechatJSAPIPayload
}
export type CurrencyAmounts = Record<string, number>
export interface DailyPaymentStats {
date: string
amount: CurrencyAmounts
count: number
}
export interface PaymentMethodStats {
type: string
amount: CurrencyAmounts
count: number
}
export interface TopUserPaymentStats {
user_id: number
email: string
amount: number
}
export interface DashboardStats {
today_amount: number
total_amount: number
today_amount: CurrencyAmounts
total_amount: CurrencyAmounts
today_count: number
total_count: number
avg_amount: number
daily_series: { date: string; amount: number; count: number }[]
payment_methods: { type: string; amount: number; count: number }[]
top_users: { user_id: number; email: string; amount: number }[]
avg_amount: CurrencyAmounts
daily_series: DailyPaymentStats[]
payment_methods: PaymentMethodStats[]
top_users: Record<string, TopUserPaymentStats[]>
}