package com.yuchen.saas.parking.api.enums;

import lombok.AllArgsConstructor;

/**
 * @Author 蔡文强
 * @Date 2023/5/25 15:56
 * @Description 优惠方式枚举信息
 */
@AllArgsConstructor
public enum CouponDiscountModeEnum {

    LIMITED_DISCOUNT(1, "限免优惠"),
    FREE_DISCOUNT(2, "全免优惠"),
    ;

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    private String description;

    public static String getDescByCode(Integer code) {
        CouponDiscountModeEnum[] enumArray = CouponDiscountModeEnum.values();
        for (CouponDiscountModeEnum e : enumArray) {
            if (e.getCode().equals(code)) {
                return e.getDescription();
            }
        }
        return "";
    }
}
