package consts

import "quyun/v2/app/requests"

// swagger:enum CouponType
// ENUM( fix_amount, discount )
type CouponType string

// Description returns the Chinese label for the specific enum value.
func (t CouponType) Description() string {
	switch t {
	case CouponTypeFixAmount:
		return "满减"
	case CouponTypeDiscount:
		return "折扣"
	default:
		return "未知类型"
	}
}

// CouponTypeItems returns the KV list for FE dropdowns.
func CouponTypeItems() []requests.KV {
	values := CouponTypeValues()
	items := make([]requests.KV, 0, len(values))
	for _, v := range values {
		items = append(items, requests.NewKV(string(v), v.Description()))
	}
	return items
}

// swagger:enum UserCouponStatus
// ENUM( unused, used, expired )
type UserCouponStatus string

// Description returns the Chinese label for the specific enum value.
func (t UserCouponStatus) Description() string {
	switch t {
	case UserCouponStatusUnused:
		return "未使用"
	case UserCouponStatusUsed:
		return "已使用"
	case UserCouponStatusExpired:
		return "已过期"
	default:
		return "未知状态"
	}
}

// UserCouponStatusItems returns the KV list for FE dropdowns.
func UserCouponStatusItems() []requests.KV {
	values := UserCouponStatusValues()
	items := make([]requests.KV, 0, len(values))
	for _, v := range values {
		items = append(items, requests.NewKV(string(v), v.Description()))
	}
	return items
}
