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

import lombok.AllArgsConstructor;

/**
 * @Author 蔡文强
 * @Date 2023/5/25 15:56
 * @Description 优惠券类型枚举信息
 */
@AllArgsConstructor
public enum CouponRecordTypeEnum {

    COUPON_CARD(1, "优惠卡"),
    COUPON_ACTIVITY(2, "优惠活动"),
    ;

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    private String description;

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