package vo

type Channel uint8

const (
	OrderChannelWechat Channel = iota + 1
	OrderChannelAlipay
)

var OrderChannelMap = map[Channel]string{
	OrderChannelWechat: "微信",
	OrderChannelAlipay: "支付宝",
}

func (s Channel) GetText() string {
	if t, ok := OrderChannelMap[s]; ok {
		return t
	}
	return "未知商品渠道类型"
}

func (s Channel) GetValue() uint8 {
	return uint8(s)
}

func (s Channel) IsWeChat() bool {
	return s == OrderChannelWechat
}

func (s Channel) IsAlipay() bool {
	return s == OrderChannelAlipay
}
