package v1

import (
	"kami/api/commonApi"

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

type OrderSummaryRecord struct {
	MerchantUid       string  `json:"merchantUid"`
	MerchantName      string  `json:"merchantName"`
	SucceedCount      int64   `json:"succeedCount"`
	SucceedShowAmount float64 `json:"succeedShowAmount"`
	SucceedFactAmount float64 `json:"succeedFactAmount"`
	TotalCount        int64   `json:"totalCount" dc:"订单总量"`
	TotalShowAmount   float64 `json:"totalShowAmount"`
	TotalFactAmount   float64 `json:"totalFactAmount"`
	Rate              float64 `json:"rate" dc:"比例"`
	Date              string  `json:"date"`
	FailedCount       int64   `json:"failedCount" dc:"失败的订单"`
	WaitedCount       int64   `json:"waitedCount" dc:"创建但未填写的订单"`
}

type OrderSummaryGetListReq struct {
	g.Meta  `path:"/orderInfo/summary/getList" tags:"订单汇总" method:"get" summary:"获取订单汇总"`
	RoadUid string `json:"roadUid"`
	Date    string `json:"date"`
	commonApi.CommonPageReq
}

type OrderSummaryGetListRes struct {
	commonApi.CommonPageRes[OrderSummaryRecord]
}

type OrderSummaryDailyRecord struct {
	MerchantUid       string  `json:"merchantUid"`
	MerchantName      string  `json:"merchantName"`
	RoadUid           string  `json:"roadUid"`
	RoadName          string  `json:"roadName"`
	Date              string  `json:"date"`
	SucceedCount      int64   `json:"succeedCount"`
	TotalCount        int64   `json:"totalCount" dc:"订单总量"`
	FailedCount       int64   `json:"failedCount" dc:"失败的订单"`
	WaitedCount       int64   `json:"waitedCount" dc:"创建但未填写的订单"`
	SucceedShowAmount float64 `json:"succeedShowAmount"`
	SucceedFactAmount float64 `json:"succeedFactAmount"`
	TotalShowAmount   float64 `json:"totalShowAmount"`
	TotalFactAmount   float64 `json:"totalFactAmount"`
	Rate              float64 `json:"rate" dc:"比例"`
}

type OrderSummaryDailyGetListReq struct {
	g.Meta      `path:"/orderInfo/summary/dailyStats" tags:"订单汇总" method:"get" summary:"获取订单每日汇总"`
	RoadUid     []string      `json:"roadUid[]"`
	DateRange   []*gtime.Time `json:"dateRange[]"`
	MerchantUid []string      `json:"merchantUid[]"`
}

type OrderSummaryDailyGetListRes struct {
	commonApi.CommonPageRes[*OrderSummaryDailyRecord]
}
