package vo

type OrderAccountType uint8

const (
	OrderAccountTypeOpenId OrderAccountType = iota + 1
	OrderAccountTypePhone
)

var OrderAccountTypeMap = map[OrderAccountType]string{
	OrderAccountTypeOpenId: "openid/userid",
	OrderAccountTypePhone:  "手机号",
}

func (s OrderAccountType) GetText() string {
	if t, ok := OrderAccountTypeMap[s]; ok {
		return t
	}
	return "未知账号类型"
}

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

func (s OrderAccountType) IsOpenId() bool {
	return s == OrderAccountTypeOpenId
}

func (s OrderAccountType) IsPhone() bool {
	return s == OrderAccountTypePhone
}
