package v1

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

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

type AccountDeleteReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/delete" tags:"携程充值卡账户" method:"delete" summary:"删除携程充值卡"`
	commonApi.BaseAccountDeleteReq
}

type AccountDeleteRes struct {
	commonApi.BaseAccountDeleteRes
}

type AccountListReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/getList" tags:"携程充值卡账户" method:"get" summary:"获取携程充值卡列表"`
	commonApi.BaseAccountListReq
	Cookie string `json:"cookie"`
}

type AccountListRecord struct {
	entity.V1CardRedeemAccountInfo
	UploadUser struct {
		Id       string `json:"id"`
		Username string `json:"username"`
		Nickname string `json:"nickname"`
	} `json:"uploadUser"`
}

type AccountListRes struct {
	commonApi.CommonPageRes[AccountListRecord]
}

type AccountRecord struct {
	Cookie         string `json:"cookie" v:"required#状态不能为空" description:"cookie不能为空"`
	Name           string `json:"name" description:"别名"`
	MaxAmountLimit int    `json:"maxAmountLimit" description:"最大充值限制" v:"required#最大充值金额不能为空"`
	MaxCountLimit  int    `json:"maxCountLimit" description:"最大充值次数" v:"required#最大充值次数不能为空"`
	Status         int    `json:"status" description:"状态"`
	Remark         string `json:"remark" description:"备注"`
}

type AccountCreateReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/create" tags:"携程充值卡账户" method:"post" summary:"创建携程账户"`
	AccountRecord
}

type AccountCookieCheckReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/checkCookie" tags:"携程充值卡账户" method:"post" summary:"检测cookie是否可用"`
	Cookie string `json:"cookie" v:"required#cookie不能为空" description:"cookie"`
}

type AccountCookieCheckRes struct {
	Username    string  `json:"username" dc:"用户名"`
	Nickname    string  `json:"nickname" dc:"昵称"`
	Balance     float64 `json:"balance" dc:"余额"`
	IsExist     bool    `json:"isExist" dc:"是否存在系统中"`
	IsAvailable bool    `json:"isAvailable" dc:"是否可用"`
}

type AccountCreateRes struct {
	commonApi.BaseAccountCreateRes
}

type AccountUpdateReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/update" tags:"携程充值卡账户" method:"put" summary:"修改携程账户"`
	commonApi.BaseAccountUpdateReq
	MaxAmountLimit int `json:"maxAmountLimit" description:"最大充值限制"`
	MaxCountLimit  int `json:"maxCountLimit" description:"最大充值次数"`
}

type AccountUpdateRes struct {
	commonApi.BaseAccountUpdateRes
}

type AccountWalletListReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/getWalletList" tags:"携程充值卡账户" method:"get" summary:"获取携程账户流水"`
	commonApi.CommonPageReq
	AccountId string `json:"accountId" v:"required#缺失ID"`
}

type AccountWalletListRes struct {
	commonApi.CommonPageRes[*entity.V1CardRedeemAccountHistory]
}

type AccountUpdateStatusReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/updateStatus" tags:"携程充值卡账户" method:"put" summary:"修改携程账户状态"`
	commonApi.BaseAccountUpdateStatusReq
	Status consts.RedeemAccountStatus `json:"status" v:"required#状态不能为空" description:"状态"`
}

type AccountUpdateStatusRes struct {
	commonApi.BaseAccountUpdateStatusRes
}

type AccountRefreshStatusReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/refreshStatus" tags:"携程充值卡账户" method:"put" summary:"刷新账号充值状态"`
	commonApi.CommonStrId
}

type AccountRefreshStatusRes struct {
}

type DownloadTemplateReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/downloadTemplate" tags:"携程充值卡账户" method:"get" summary:"下载导入模板"`
	commonApi.BaseDownloadTemplateReq
}

type DownloadTemplateRes struct {
	commonApi.BaseDownloadTemplateRes
}

type AccountCookieBatchCheckReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/check" tags:"携程充值卡账户" method:"post" summary:"检查上传礼品卡是否正常"`
	File   *ghttp.UploadFile `v:"required#文件不能为空" json:"file" type:"file" description:"选择上传文件"`
}

type AccountCookieBatchInfo struct {
	AccountCookieCheckRes
	Name           string `json:"name" dc:"别名"`
	Cookie         string `json:"cookie" dc:"cookie"`
	MaxAmountLimit int    `json:"maxAmountLimit" description:"最大充值限制"`
	MaxCountLimit  int    `json:"maxCountLimit" description:"最大充值次数"`
}

type AccountCookieBatchCheckRes struct {
	Msg  string                    `json:"msg" description:"导入结果"`
	List []*AccountCookieBatchInfo `json:"list" description:"导入结果"`
}

type AccountCookieBatchAddReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/batchAdd" tags:"携程充值卡账户" method:"post" summary:"检查礼品卡是否正常"`
	List   []*AccountCookieBatchInfo `json:"list" description:"导入结果"`
}

type AccountCookieBatchAddRes struct {
}

type DownloadReq struct {
	g.Meta `path:"/cardInfo/cTrip/account/download" tags:"携程充值卡账户" method:"get" summary:"下载充值账户"`
	commonApi.BaseDownloadReq
}

type DownloadRes struct {
	commonApi.BaseDownloadRes
}
