package com.starry.admin.modules.shop.module.enums;

/**
 * 优惠券领取条件类型
 */
public enum CouponClaimConditionType {
    ALL("0"),
    FILTER("1"),
    WHITELIST("2");

    private final String code;

    CouponClaimConditionType(String code) {
        this.code = code;
    }

    public String code() { return code; }

    public static CouponClaimConditionType of(String code) {
        for (CouponClaimConditionType t : values()) {
            if (t.code.equals(code)) return t;
        }
        return ALL;
    }
}
