package v1

import (
	"kami/api/commonApi"
	"kami/internal/consts"

	"github.com/gogf/gf/v2/frame/g"
)

// TMallGameDailyOrderSummaryReq 获取订单每日统计
type TMallGameDailyOrderSummaryReq struct {
	g.Meta `path:"/recharge/tMallGame/workspace/orderSummary" tags:"天猫游戏订单" method:"get" summary:"获取每日订单统计"`
	commonApi.CommonPageReq
	ChannelName  string                               `json:"channelName" description:"渠道名称"`
	CallBackType consts.RechargeTMallGameCallBackType `json:"callbackType" description:"回调类型"`
}

type TMAllGameSummaryListRecord struct {
	Count         int     `json:"count" description:"订单数量"`
	SucceedCount  int     `json:"succeedCount" description:"订单成功数量"`
	SucceedAmount float64 `json:"succeedAmount" description:"订单成功金额"`
	Amount        float64 `json:"amount" description:"总支付金额"`
	Rate          float64 `json:"rate" description:"今日订单成功率"`
	Date          string  `json:"date" description:"日期"`
}

type TMallGameDailyOrderSummaryRes struct {
	commonApi.CommonPageRes[TMAllGameSummaryListRecord]
}

// TMallGameStatsReq 获取基本统计信息
type TMallGameStatsReq struct {
	g.Meta      `path:"/recharge/tMallGame/workspace/stats" tags:"天猫游戏订单" method:"get" summary:"获取基本统计信息"`
	ChannelName string `json:"channelName" description:"渠道名称"`
}

type TMallGameStatsRes struct {
	TotalCount         int     `json:"totalCount" description:"总订单数量"`
	TotalSucceedCount  int     `json:"totalSucceedCount" description:"总订单成功数量"`
	TotalAmount        float64 `json:"totalAmount" description:"总支付金额"`
	TotalSucceedAmount float64 `json:"totalSucceedAmount" description:"总成功订单总额"`
	TodayCount         int     `json:"todayCount" description:"今日订单数量"`
	TodaySucceedCount  int     `json:"todaySucceedCount" description:"今日订单成功数量"`
	TodayAmount        float64 `json:"todayAmount" description:"今日支付金额"`
	TodaySucceedAmount float64 `json:"TodaySucceedAmount" description:"今日成功订单总额"`
	TotalRate          float64 `json:"totalRate" description:"总订单成功率"`
	TodayRate          float64 `json:"todayRate" description:"今日订单成功率"`
}
