package model

import (
	v1 "kami/api/card_info_t_mall_game/v1"
	"kami/internal/consts"
	"kami/internal/model/entity"

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

type RechargeTMallGameOrderListInput struct {
	*v1.TMallGameOrderListReq
}

type RechargeTMallGameShopOrderListInput struct {
	*v1.TMallGameShopOrderListReq
}

type RechargeTMallGameOrderListOutput struct {
	entity.V1RechargeTMallOrder
	AccountInfo struct {
		g.Meta        `orm:"table:recharge_t_mall_account"`
		AccountNumber string `json:"accountNumber" orm:"account_number"`
		Id            string `json:"id" orm:"id"`
	} `json:"accountInfo"   orm:"with:id=account_id"`
	ShopInfo struct {
		g.Meta       `orm:"table:recharge_t_mall_shop"`
		OrderNo      string      `json:"orderNo" orm:"order_no"`
		TMallOrderNo string      `json:"tMallOrderNo" orm:"t_mall_order_no"`
		EndTime      *gtime.Time `json:"endTime" orm:"end_time"`
	} `json:"shopInfo"   orm:"with:order_no=order_no"`
}

type RechargeTMallGameOrderCreateInput struct {
	AccountId          string                               `json:"AccountId" description:"账户ID"`
	AccountNumber      string                               `json:"accountNumber" description:"账户"`
	MerchantOrder      string                               `json:"merchantOrder" description:"第三方订单号"`
	CallbackUrl        string                               `json:"callbackUrl"  description:"回调地址"`
	CallbackType       consts.RechargeTMallGameCallBackType `json:"callBackType"`
	ThirdMerchantOrder string                               `json:"thirdMerchantOrder" dc:"三方订单号"`
	ChannelName        string                               `json:"channelName"`
	Attach             string                               `json:"attach"  description:"附加信息，附加信息会原封不动返回"`
	Amount             float64                              `json:"amount" description:"提交金额"`
}

type AssociateCreatedOrderAndStatusInput struct {
	AccountNumber string
	ShopId        int
}

// RechargeTMallGameAccountOutput 账号信息
type RechargeTMallGameAccountOutput struct {
	Id            int    `json:"id"            orm:"id"             description:""`
	OrderNo       string `json:"orderNo"       orm:"order_no"       description:"订单号，同时是ID"`
	AccountNumber string `json:"accountNumber" orm:"account_number" description:"账号"`
}
