package member

type Lang string

func (l Lang) ToString() string {
	return string(l)
}

type Currency string

func (c Currency) ToString() string {
	return string(c)
}

const (
	LangTW Lang = "zh-tw"
)

const (
	CurrencyTWD Currency = "TWD"
)

var genderMap = map[int64]string{
	0: "",
	1: "male",
	2: "female",
	3: "secret",
}

func GetGenderByCode(g int64) string {
	r, ok := genderMap[g]
	if !ok {
		return genderMap[0]
	}

	return r
}

var genderCodeMap = map[string]int64{
	"":       0,
	"male":   1,
	"female": 2,
	"secret": 3,
}

func GetGenderCodeByStr(g string) int64 {
	r, ok := genderCodeMap[g]
	if !ok {
		return genderCodeMap[""]
	}

	return r
}
