package com.sonic.lion.domain.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * @author: code
 * @date: 2025/05/07
 * @Description: 交易类型
 * @version: 1.0.0
 */
public enum BillStatus {

    INIT(0, "提交中"),

    PROCESSING(1, "处理中"),

    SUCC(2, "成功"),

    FAIL(3, "失败"),

    CANCEL(4, "取消"),

    UNKNOW(5, "未知(或异常)状态");

    private final int value;

    private final String desc;

    BillStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static BillStatus get(int value) {
        for (BillStatus billStatus : values()) {
            if (billStatus.getValue() == value) {
                return billStatus;
            }
        }
        return null;
    }
}
