package marketing

import "encoding/json"

type SendReq struct {
	ActivityId        *string `json:"activity_id"`
	StockId           *string `json:"stock_id"`
	OutRequestNo      *string `json:"out_request_no"`
	Appid             *string `json:"appid"`
	StockCreatorMchId *string `json:"stock_creator_mchid"`
}

type SendResp struct {
	CouponId *string `json:"coupon_id"`
}

// Err {"code":"INVALID_REQUEST","message":"对应单号已超出重试期;请查单确认后决定是否换单请求"}
type Err struct {
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

func BuildErr(body []byte) (*Err, error) {
	ret := &Err{}
	err := json.Unmarshal(body, &ret)
	return ret, err
}
