package v1

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

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

type RechargeStealSettingReq struct {
	g.Meta      `path:"/cardInfo/appleCard/steal/setStatus" tags:"苹果礼品卡充值" method:"post" summary:"设置是否开启偷卡"`
	StealStatus consts.StealStatus `json:"stealStatus" v:"required|in:0,1#状态不能为空|状态不正确" description:"状态"`
}

type RechargeStealSettingRes struct{}

type RechargeStealSettingGetReq struct {
	g.Meta `path:"/cardInfo/appleCard/steal/getStatus" tags:"苹果礼品卡充值" method:"get" summary:"获取当前是否设置了偷卡"`
}

type RechargeStealSettingGetRes struct {
	StealStatus consts.StealStatus `json:"stealStatus" description:"状态"`
}

type RechargeStealRuleRecord struct {
	Name          string             `json:"name" v:"required#规则名不能为空" description:"规则名"`
	TargetUserId  string             `json:"targetUserId" v:"required#目标用户ID不能为空" description:"目标用户ID"`
	Status        consts.StealStatus `json:"status" v:"required|in:0,1#状态不能为空|状态不正确" description:"单独某条规则的状态"`
	StorageUserId string             `json:"storageUserId" v:"required#存储用户ID不能为空" description:"存储用户ID"`
	Amount        int                `json:"amount" v:"required|min:1#金额不能为空|金额不能小于1" description:"金额"`
	TargetAmount  int                `json:"targetAmount" v:"required|min:1#目标金额不能为空|目标金额不能小于1" description:"目标金额"`
	IntervalTime  int                `json:"intervalTime" v:"required|min:0#时间间隔不能为空|时间间隔不能小于0" description:"时间间隔"`
}

type RechargeStealRuleAddReq struct {
	g.Meta `path:"/cardInfo/appleCard/steal/addRule" tags:"苹果礼品卡充值" method:"post" summary:"添加一条偷卡规则"`
	RechargeStealRuleRecord
}

type RechargeStealRuleAddRes struct{}

type RechargeStealRuleUpdateReq struct {
	g.Meta `path:"/cardInfo/appleCard/steal/updateRule" tags:"苹果礼品卡充值" method:"put" summary:"更新一条偷卡规则"`
	commonApi.CommonIntId
	RechargeStealRuleRecord
}

type RechargeStealRuleUpdateRes struct{}

type RechargeStealRuleDeleteReq struct {
	g.Meta `path:"/cardInfo/appleCard/steal/deleteRule" tags:"苹果礼品卡充值" method:"delete" summary:"删除一条偷卡规则"`
	commonApi.CommonIntId
}

type RechargeStealRuleDeleteRes struct{}

type RechargeStealRuleListReq struct {
	g.Meta `path:"/cardInfo/appleCard/steal/getRuleList" tags:"苹果礼品卡充值" method:"get" summary:"获取偷卡规则列表"`
	commonApi.CommonPageReq
}

type RechargeStealRuleListRes struct {
	commonApi.CommonPageRes[*entity.V1CardAppleHiddenSettings]
}

type RechargeStealRuleStatusUpdateReq struct {
	g.Meta `path:"/cardInfo/appleCard/steal/setRuleStatus" tags:"苹果礼品卡充值" method:"put" summary:"设置单个规则是否启用"`
	commonApi.CommonIntId
	Status consts.StealStatus `json:"status" v:"required|in:0,1#状态不能为空|状态不正确" description:"状态"`
}

type RechargeStealRuleStatusUpdateRes struct{}
