package v1

import (
	"kami/internal/consts"

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

	"kami/api/commonApi"
)

type AppleAccountRecord struct {
	Account        string `json:"account" description:"账户" v:"required"`
	Password       string `json:"password" description:"密码" v:"required"`
	MaxAmountLimit int    `json:"maxAmountLimit" description:"最大充值金额" v:"required#充值金额不能为空"`
	MaxCountLimit  int    `json:"maxCountLimit" description:"最大充值次数"  v:"required#最大充值次数限制不能为空"`
	Remark         string `json:"remark" description:"备注"`
}

type CardInfoListReq struct {
	g.Meta  `path:"/cardInfo/AppleCard/account/getList" tags:"苹果礼品卡账户" method:"get" summary:"获取苹果账户"`
	Account string `json:"account" description:"账户"`
	commonApi.CommonPageReq
}

type CardInfoListRes struct {
	commonApi.CommonPageRes[AppleCardListRecord]
}

type CardInfoCreateReq struct {
	g.Meta `path:"/cardInfo/AppleCard/account/create" tags:"苹果礼品卡账户" method:"post" summary:"创建苹果账户"`
	AppleAccountRecord
}

type CardInfoCreateRes struct{}

type CardInfoUpdateReq struct {
	g.Meta `path:"/cardInfo/AppleCard/account/update" tags:"苹果礼品卡账户" method:"put" summary:"修改苹果账户"`
	commonApi.CommonStrId
	AppleAccountRecord
}

type CardInfoUpdateRes struct {
	g.Meta `json:"application/json"`
}

type CardInfoDeleteReq struct {
	g.Meta `path:"/cardInfo/AppleCard/account/delete" tags:"苹果礼品卡账户" method:"delete" summary:"删除苹果账户"`
	commonApi.CommonStrId
}

type CardInfoDeleteRes struct{}

type CardInfoDownloadTemplateReq struct {
	g.Meta `path:"/cardInfo/AppleCard/account/downloadTemplate" tags:"苹果礼品卡账户" method:"get" summary:"下载导入模板"`
}

type CardInfoDownloadTemplateRes struct {
	g.Meta `mime:"application/vnd.ms-excel"`
}

type CardInfoBatchAddFromXlsxReq struct {
	g.Meta `path:"/cardInfo/AppleCard/account/batchAdd" tags:"苹果礼品卡账户" method:"post" summary:"批量导入账户"`
	File   *ghttp.UploadFile `v:"required#文件不能为空" json:"file" type:"file" description:"选择上传文件"`
}

type CardInfoBatchAddFromXlsxRes struct {
	Msg string `json:"msg" description:"导入结果"`
}

// CardInfoUpdateStatusReq 修改苹果账号状态
type CardInfoUpdateStatusReq struct {
	g.Meta `path:"/cardInfo/AppleCard/account/updateStatus" tags:"苹果礼品卡账户" method:"put" summary:"修改苹果账户状态"`
	commonApi.CommonStrId
	Status consts.AppleAccountStatus `json:"status" v:"required|in:10,20#状态不能为空|状态不正确" description:"状态"`
}

type CardInfoUpdateStatusRes struct{}

// CardInfoSuspendOrContinueReq 暂停或恢复账号充值
type CardInfoSuspendOrContinueReq struct {
	g.Meta `path:"/cardInfo/AppleCard/account/status/continueOrRestart" tags:"苹果礼品卡账户" method:"put" summary:"暂停/恢复账号充值"`
	commonApi.CommonStrId
}

type CardInfoSuspendOrContinueRes struct{}
