package com.hfkj.sysenum.order;

import lombok.Getter;

import java.util.Objects;

/**
 * 交易订单状态
 * @className: OrderChildProductType
 * @author: HuRui
 * @date: 2024/4/30
 **/
@Getter
public enum OrderStatusEnum {
    /**
     * 删除
     */
    status0(0, "删除"),
    /**
     * 待支付
     */
    status1(1, "待支付"),

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

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

    /**
     * 已退款
     */
    status4(4, "已退款"),

    /**
     * 已取消
     */
    status5(5, "已取消"),
    ;

    private final int code;

    private final String name;


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

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