Files
boursecu_admin/src/model/dashboard.ts
T

243 lines
6.4 KiB
TypeScript
Raw Normal View History

2026-06-21 20:27:13 +03:30
import type { Order } from '@/model/order'
export interface DashboardMaster {
price?: number
pricem?: number
update_date?: string
is_gateway_open?: boolean
prices?: Array<{ id?: string | number; name?: string; price?: number; profit?: number }>
2026-01-24 17:45:54 +03:30
new_customer_major?: number
new_customer_single?: number
all_customer_major?: number
all_customer_single?: number
archive_customer_major?: number
archive_customer_single?: number
all_gold?: number
all_gold_single?: number
2026-06-21 20:27:13 +03:30
await_order?: Order[]
best_customer?: Array<{ customer_id?: number; amount?: number; customer?: { name?: string; mobile?: string } }>
best_customer_single?: Array<{ gold?: number; customer?: { name?: string; mobile?: string } }>
GT_all_customers?: number
GT_no_login_customers?: number
GT_no_valid_customers?: number
GT_active_customers?: number
GT_deActive_customers?: number
GT_products_report?: Array<{
id?: number
title?: string
transaction_sum_gold_buy?: number
total_negative_gold_sell?: number
total_gold?: number
}>
2026-01-24 17:45:54 +03:30
}
2026-07-23 12:28:48 +03:30
export interface DashboardQuantityProductProfit {
product_id: number
title: string
group_type?: string | null
/** کارمزد کسرشده از کیف همان محصول (گرم/واحد) */
grams: number
value_rial: number
unit?: string
}
export interface DashboardDailyProductProfit {
product_id: number
title: string
grams: number
}
2026-07-10 23:25:40 +03:30
export interface DashboardDailyProfit {
date: string
2026-07-23 12:28:48 +03:30
/** سود فلزی روز: کارمزد کسرشده از فلز (گرم) */
2026-07-10 23:25:40 +03:30
profit_gold: number
/** سود ریالی روز: کارمزد کسرشده از ریال */
profit_rial: number
/** سود اختلاف قیمت روز (ریال) */
spread_rial: number
order_count: number
2026-07-23 12:28:48 +03:30
/** تفکیک سود مقداری به‌ازای هر محصول در همان روز */
profit_by_product?: DashboardDailyProductProfit[]
2026-07-10 23:25:40 +03:30
}
2026-06-21 20:27:13 +03:30
export interface DashboardFinance {
fullPriceM1?: number
fullPriceM2?: number
fullPriceSood?: number
fullPriceKarmozd?: number
fullPriceKaermozd?: number
2026-07-02 01:25:29 +03:30
/** سود اختلاف قیمت + کارمزد */
2026-07-01 22:28:09 +03:30
totalTradingProfit?: number
2026-06-21 20:27:13 +03:30
orderCount?: number
Gifts?: string
GiftsPrise?: number
sumAll?: number
2026-07-23 12:28:48 +03:30
/** سود طلایی/فلزی: مجموع کارمزدهای کسرشده از فلز (گرم) */
2026-07-10 23:25:40 +03:30
profitGoldGrams?: number
/** سود ریالی: مجموع کارمزدهای کسرشده از ریال */
profitRial?: number
2026-07-11 22:31:45 +03:30
/** سود ریالی قبل از کسر سندهای تبدیل */
profitRialGross?: number
/** سود طلایی قبل از افزودن سندهای تبدیل */
profitGoldGramsGross?: number
/** جمع ریالی تبدیل‌شده به طلا در بازه */
profitRialConverted?: number
/** جمع گرم تبدیل‌شده از سود ریالی در بازه */
profitGoldConvertedGram?: number
2026-07-10 23:25:40 +03:30
/** ارزش ریالی سود طلایی با قیمت روز */
profitGoldValueRial?: number
2026-07-23 12:28:48 +03:30
/** سود کارمزد فلزی به‌ازای هر محصول مقداری/آبشده */
profitQuantityProducts?: DashboardQuantityProductProfit[]
2026-07-10 23:25:40 +03:30
/** تفکیک روزانهٔ سود طلایی/ریالی */
daily?: DashboardDailyProfit[]
}
export interface ProfitConversion {
id: number
user_id?: number | null
rial_amount: number
gram_amount: number
unit_price: number
converted_at?: string | null
description?: string | null
created_at?: string
}
export interface ProfitConversionsResponse {
items: ProfitConversion[]
totalRial: number
totalGram: number
2026-01-24 17:45:54 +03:30
}
2026-06-21 20:27:13 +03:30
export interface DashboardFlowPoint {
date?: string
'1'?: number
'2'?: number
1?: number
2?: number
}
2026-06-21 21:55:54 +03:30
export interface DashboardOrderPeakHour {
hour: number
buy: number
sell: number
total: number
}
export interface DashboardOrderPeakHours {
hours: DashboardOrderPeakHour[]
peak_hour: number | null
peak_count: number
days: number
total_orders: number
}
2026-06-21 20:27:13 +03:30
export interface PriceChartPoint {
timestamp: number
value: number
}
export interface DashboardWalletSums {
gold?: number
goldToCash?: number
cash?: number
cashToCash?: number
2026-01-24 17:45:54 +03:30
}
2026-08-03 22:22:39 +03:30
export interface MontzarReconcileMandeh {
gold: number
cash: number
gold_abs: number
cash_abs: number
gold_state: string
rial_state: string
gold_unit: string
cash_unit: string
}
export interface MontzarSiteSummary {
buy_gold: number
sell_gold: number
buy_rial: number
sell_rial: number
net_gold: number
net_rial: number
}
export interface MontzarColleagueRow {
index?: number
id?: number | string | null
doc_id?: number | string | null
date?: string | null
date_ymd?: string | null
desc?: string
kind?: string
bed_gold?: number
bes_gold?: number
bed_rial?: number
bes_rial?: number
net_gold?: number
net_rial?: number
remain_gold?: number
remain_rial?: number
gold_state?: string | null
rial_state?: string | null
}
export interface MontzarLocalItem {
id: number
type: string
direction?: number
direction_label?: string
amount: number
cash: number
montzar_cash?: number
covered?: boolean
provider_id?: number | string | null
product_id?: number | string | null
product_title?: string | null
customer_name?: string | null
note?: string
created_at?: string | null
date_ymd?: string | null
}
export interface MontzarReconcileDiff {
code: string
reason: string
colleague?: MontzarColleagueRow | null
local?: MontzarLocalItem | null
}
export interface MontzarReconcilePayload {
mandeh: MontzarReconcileMandeh | null
colleague_available?: boolean
colleague_error?: string | null
last_table_remain?: { gold: number; rial: number } | null
summary: {
local_all: MontzarSiteSummary
local_covered: MontzarSiteSummary
local_uncovered: MontzarSiteSummary
local_matched: MontzarSiteSummary
colleague_site: MontzarSiteSummary
diff_site_gold: number
diff_site_rial: number
order_count: number
covered_count: number
uncovered_count: number
matched_count: number
diff_count: number
gift_count?: number
colleague_row_count: number
local_order_count: number
}
colleague_rows: MontzarColleagueRow[]
local_orders: MontzarLocalItem[]
local_uncovered_orders?: MontzarLocalItem[]
local_gifts: MontzarLocalItem[]
matched: Array<{ code: string; colleague: MontzarColleagueRow; local: MontzarLocalItem }>
diffs: MontzarReconcileDiff[]
colleague_other?: MontzarReconcileDiff[]
range: { start: string; end: string }
}