package com.hfkj.sysenum.order;

import lombok.Getter;

import java.util.Objects;

/**
 * 卡券编号订单状态
 * @className: OrderCouponNoStatusEnum
 * @author: HuRui
 * @date: 2024/5/11
 **/
@Getter
public enum OrderCouponNoStatusEnum {
    /**
     * 待支付
     */
    status1(1, "未派发"),

    /**
     * 已支付
     */
    status2(2, "已派发"),

    /**
     * 已完成
     */
    status3(3, "已使用"),

    /**
     * 已退款
     */
    status4(4, "已过期"),
    ;

    private final int code;

    private final String name;


    OrderCouponNoStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static OrderCouponNoStatusEnum getData(Integer type) {
        for (OrderCouponNoStatusEnum ele : values()) {
            if (Objects.equals(type,ele.getCode())) return ele;
        }
        return null;
    }
}
