package adminfinance

import "time"

type DashboardQuery struct {
	StartDate time.Time
	EndDate   time.Time
}

type DetailQuery struct {
	OrderNo          string
	UserID           uint64
	OrderStatus      string
	SettlementStatus string
	DateType         string
	StartDate        time.Time
	EndDate          time.Time
	Page             int
	PageSize         int
}

type DashboardDTO struct {
	Summary     FinanceSummaryDTO `json:"summary"`
	DailyItems  []FinanceDailyDTO `json:"daily_items"`
	GeneratedAt time.Time         `json:"generated_at"`
}

type FinanceSummaryDTO struct {
	TotalFlowAmountCent         int64 `json:"total_flow_amount_cent"`
	TotalRefundAmountCent       int64 `json:"total_refund_amount_cent"`
	PendingRefundAmountCent     int64 `json:"pending_refund_amount_cent"`
	ChannelNetAmountCent        int64 `json:"channel_net_amount_cent"`
	PlatformIncomeAmountCent    int64 `json:"platform_income_amount_cent"`
	OwnerShouldIncomeAmountCent int64 `json:"owner_should_income_amount_cent"`
	OwnerWalletIncomeAmountCent int64 `json:"owner_wallet_income_amount_cent"`
	SettlementDiffAmountCent    int64 `json:"settlement_diff_amount_cent"`
	SuccessfulPayCount          int64 `json:"successful_pay_count"`
	SuccessfulRefundCount       int64 `json:"successful_refund_count"`
	PendingRefundCount          int64 `json:"pending_refund_count"`
	SettledOrderCount           int64 `json:"settled_order_count"`
	FinancialExceptionCount     int64 `json:"financial_exception_count"`
}

type FinanceDailyDTO struct {
	Date                        string `json:"date"`
	TotalFlowAmountCent         int64  `json:"total_flow_amount_cent"`
	TotalRefundAmountCent       int64  `json:"total_refund_amount_cent"`
	PendingRefundAmountCent     int64  `json:"pending_refund_amount_cent"`
	ChannelNetAmountCent        int64  `json:"channel_net_amount_cent"`
	PlatformIncomeAmountCent    int64  `json:"platform_income_amount_cent"`
	OwnerShouldIncomeAmountCent int64  `json:"owner_should_income_amount_cent"`
	OwnerWalletIncomeAmountCent int64  `json:"owner_wallet_income_amount_cent"`
	SettlementDiffAmountCent    int64  `json:"settlement_diff_amount_cent"`
	SuccessfulPayCount          int64  `json:"successful_pay_count"`
	SuccessfulRefundCount       int64  `json:"successful_refund_count"`
	PendingRefundCount          int64  `json:"pending_refund_count"`
	SettledOrderCount           int64  `json:"settled_order_count"`
}

type PaginatedResult struct {
	Items    interface{} `json:"items"`
	Total    int64       `json:"total"`
	Page     int         `json:"page"`
	PageSize int         `json:"page_size"`
}

type FinanceDetailDTO struct {
	OrderID                     uint64     `json:"order_id"`
	OrderNo                     string     `json:"order_no"`
	OrderStatus                 string     `json:"order_status"`
	SettlementStatus            string     `json:"settlement_status"`
	RefundStatus                string     `json:"refund_status"`
	RenterID                    uint64     `json:"renter_id"`
	RenterPhone                 string     `json:"renter_phone"`
	RenterNickname              string     `json:"renter_nickname"`
	OwnerID                     uint64     `json:"owner_id"`
	OwnerPhone                  string     `json:"owner_phone"`
	OwnerNickname               string     `json:"owner_nickname"`
	OrderRentAmountCent         int64      `json:"order_rent_amount_cent"`
	OrderDepositAmountCent      int64      `json:"order_deposit_amount_cent"`
	CheckoutRentAmountCent      int64      `json:"checkout_rent_amount_cent"`
	CheckoutRenterRefundCent    int64      `json:"checkout_renter_refund_cent"`
	CheckoutOwnerIncomeCent     int64      `json:"checkout_owner_income_cent"`
	CheckoutPlatformFeeCent     int64      `json:"checkout_platform_fee_cent"`
	OwnerWalletIncomeAmountCent int64      `json:"owner_wallet_income_amount_cent"`
	PaidAmountCent              int64      `json:"paid_amount_cent"`
	RefundedAmountCent          int64      `json:"refunded_amount_cent"`
	RefundingAmountCent         int64      `json:"refunding_amount_cent"`
	FailedRefundAmountCent      int64      `json:"failed_refund_amount_cent"`
	ChannelNetAmountCent        int64      `json:"channel_net_amount_cent"`
	PlatformNetAmountCent       int64      `json:"platform_net_amount_cent"`
	SettlementDiffAmountCent    int64      `json:"settlement_diff_amount_cent"`
	FinanceStatus               string     `json:"finance_status"`
	CreatedAt                   time.Time  `json:"created_at"`
	SettledAt                   *time.Time `json:"settled_at,omitempty"`
}
