package models

import (
	"github.com/shopspring/decimal"
	"time"
)

type CreateMerchantCardRequest struct {
	MerchantCardName  string  `json:"merchant_card_name"`  // 商户卡名称
	MerchantOpenID    string  `json:"open_id"`             // openid
	CardProjectData   []int64 `json:"card_project_data"`   // 项目
	CardPrice         string  `json:"card_price"`          // 单价
	CardTotalPrice    string  `json:"card_total_price"`    // 价格
	ActivityEndTime   string  `json:"activity_end_time"`   // 活动结束时间
	ActivityStartTime string  `json:"activity_start_time"` // 活动开始时间
	MerchantCardTime  string  `json:"merchant_card_time"`  // 商户卡有效期
	Inventory         string  `json:"inventory"`           // 库存数量
	QuotaNum          string  `json:"quota_num"`           // 限购数量
	UseRule           string  `json:"use_rule"`            // 使用规则
	Picture           string  `json:"picture"`             // 图片
	RebateRate        string  `json:"rebate_rate"`         // 佣金比例
	CancelNumber      string  `json:"cancel_number"`       //核销次数
	BackgroundImage   string  `json:"background_image"`    //背景图
}

type GetMerchantCardRequest struct {
	MerchantId int64  `json:"merchant_card_id"` //商户卡id
	Code       string `json:"code"`             //b邀请码
}

type GetMerchantCardReply struct {
	MerchantCardName  string `json:"merchant_card_name"`  // 商户卡名称
	MerchantOpenID    string `json:"merchant_open_id"`    // openid
	CardProjectData   string `json:"card_project_data"`   // 项目
	CardPrice         string `json:"card_price"`          // 单价
	ActivityEndTime   string `json:"activity_end_time"`   // 活动结束时间
	ActivityStartTime string `json:"activity_start_time"` // 活动开始时间
	MerchantCardTime  string `json:"merchant_card_time"`  // 商户卡有效期
	Inventory         int64  `json:"inventory"`           // 库存数量
	QuotaNum          int64  `json:"quota_num"`           // 限购数量
	UseRule           string `json:"use_rule"`            // 使用规则
	Picture           string `json:"picture"`             // 图片
	RebateRate        int64  `json:"rebate_rate"`
	BackgroundImage   string `json:"background_image"` //背景图
	W                 string `json:"w"`                // w
	H                 string `json:"h"`                // h
	X                 string `json:"x"`                // x
	Y                 string `json:"y"`                // y
	CardTotalPrice    string `json:"card_total_price"` // 总价

}

// 画布详情
type GetMerchantCanvasCardReply struct {
	Static                 Static          `json:"static"`
	SwiperList             []SwiperList    `json:"swiperList"`
	RightButton            []RightButton   `json:"rightButton"`
	DataList               []DataList      `json:"dataList"`
	BuyKnowList            []BuyKnowList   `json:"buyKnowList"`
	ShopData               ShopData        `json:"shopData"`
	Base64Img              string          `json:"base64Img"`
	FenxiangShow           bool            `json:"fenxiangShow"`
	MerchantAmount         decimal.Decimal `json:"merchantAmount"`
	MerchantOriginalAmount decimal.Decimal `json:"merchantOriginalAmount"`
	Inventory              int64           `json:"inventory"`
	IsShare                bool            `json:"isShare"`
	InvitationCode         string          `json:"invitationCode"`
	QRUrl                  string          `json:"qrUrl"`
}
type Static struct {
	Background string `json:"background"`
}
type SwiperList struct {
	ID  int    `json:"id"`
	URL string `json:"url"`
}
type RightButton struct {
	ImageURL string `json:"imageUrl"`
}
type DataList struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
	Price string `json:"price"`
}
type BuyKnowList struct {
	Icon  string `json:"icon"`
	Title string `json:"title"`
	Text  string `json:"text"`
}
type ShopData struct {
	ImageURL   string `json:"imageUrl"`
	Name       string `json:"name"`
	StarRating int    `json:"starRating"`
	Address    string `json:"address"`
	Distance   string `json:"distance"`
}

type MerchantCardListRequest struct {
	OpenId    string `json:"open_id"`
	PageSize  int    `json:"page_size"`
	PageIndex int    `json:"page_index"`
	TypeList  int    `json:"type_list"` //1-未开始 2-进行中 3-已结束
}

type MerchantCardListReply struct {
	ID                int64     `json:"id"`
	MerchantCardName  string    `json:"merchant_card_name"`  // 商户卡名称
	MerchantOpenID    string    `json:"merchant_open_id"`    // openid
	CardProjectData   string    `json:"card_project_data"`   // 项目
	CardPrice         string    `json:"card_price"`          // 单价
	ActivityEndTime   int64     `json:"activity_end_time"`   // 活动结束时间
	ActivityStartTime int64     `json:"activity_start_time"` // 活动开始时间
	MerchantCardTime  int64     `json:"merchant_card_time"`  // 商户卡有效期
	Inventory         int64     `json:"inventory"`           // 库存数量
	QuotaNum          int64     `json:"quota_num"`           // 限购数量
	UseRule           string    `json:"use_rule"`            // 使用规则
	Picture           string    `json:"picture"`             // 图片
	RebateRate        int64     `json:"rebate_rate"`         // 佣金比例
	CreateBy          int64     `json:"create_by"`           // 创建者
	UpdateBy          int64     `json:"update_by"`           // 更新者
	CreatedAt         time.Time `json:"created_at"`          // 创建时间
	UpdatedAt         time.Time `json:"updated_at"`          // 最后更新时间
	DeletedAt         time.Time `json:"deleted_at"`
	RebateAmount      string    `json:"rebate_amount"` // 佣金

}

type UpdateMerchantCardRequest struct {
	ID                int64  `json:"id"`
	ActivityEndTime   int64  `json:"activity_end_time"`   // 活动结束时间
	ActivityStartTime int64  `json:"activity_start_time"` // 活动开始时间
	Inventory         int64  `json:"inventory"`           // 库存数量
	QuotaNum          int64  `json:"quota_num"`           // 限购数量
	UseRule           string `json:"use_rule"`            // 使用规则
	Picture           string `json:"picture"`             // 图片
}

type UpdateMerchantCardWHXYRequest struct {
	Whxy           string `json:"whxy"` //坐标
	MerchantCardId int64  `json:"merchant_card_id"`
}

type WHXYStr struct {
	Type string          `json:"type"`
	URL  string          `json:"url"`
	Y    decimal.Decimal `json:"y,omitempty"`
	X    decimal.Decimal `json:"x,omitempty"`
	W    decimal.Decimal `json:"w,omitempty"`
	H    decimal.Decimal `json:"h,omitempty"`
	//Rotate   int             `json:"rotate,omitempty"`
	//SourceID any `json:"sourceId,omitempty"`
}