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

import lombok.AllArgsConstructor;

/**
 * @Author 蔡文强
 * @Date 2023/5/25 15:56
 * @Description 优惠券使用状态枚举信息
 */
@AllArgsConstructor
public enum CouponUseStatusEnum {

    NO_USED(1, "未使用"),
    USED(2, "已使用"),
    EXPIRED(3, "已过期"),
    ;

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    private String description;

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