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 }> 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 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 }> } 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 } export interface DashboardDailyProfit { date: string /** سود فلزی روز: کارمزد کسرشده از فلز (گرم) */ profit_gold: number /** سود ریالی روز: کارمزد کسرشده از ریال */ profit_rial: number /** سود اختلاف قیمت روز (ریال) */ spread_rial: number order_count: number /** تفکیک سود مقداری به‌ازای هر محصول در همان روز */ profit_by_product?: DashboardDailyProductProfit[] } export interface DashboardFinance { fullPriceM1?: number fullPriceM2?: number fullPriceSood?: number fullPriceKarmozd?: number fullPriceKaermozd?: number /** سود اختلاف قیمت + کارمزد */ totalTradingProfit?: number orderCount?: number Gifts?: string GiftsPrise?: number sumAll?: number /** سود طلایی/فلزی: مجموع کارمزدهای کسرشده از فلز (گرم) */ profitGoldGrams?: number /** سود ریالی: مجموع کارمزدهای کسرشده از ریال */ profitRial?: number /** سود ریالی قبل از کسر سندهای تبدیل */ profitRialGross?: number /** سود طلایی قبل از افزودن سندهای تبدیل */ profitGoldGramsGross?: number /** جمع ریالی تبدیل‌شده به طلا در بازه */ profitRialConverted?: number /** جمع گرم تبدیل‌شده از سود ریالی در بازه */ profitGoldConvertedGram?: number /** ارزش ریالی سود طلایی با قیمت روز */ profitGoldValueRial?: number /** سود کارمزد فلزی به‌ازای هر محصول مقداری/آبشده */ profitQuantityProducts?: DashboardQuantityProductProfit[] /** تفکیک روزانهٔ سود طلایی/ریالی */ 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 } export interface DashboardFlowPoint { date?: string '1'?: number '2'?: number 1?: number 2?: number } 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 } export interface PriceChartPoint { timestamp: number value: number } export interface DashboardWalletSums { gold?: number goldToCash?: number cash?: number cashToCash?: number } 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 } }