package com.bonus.common.biz.enums;

import lombok.Getter;

/**
 * @author : 阮世耀
 * @version : 1.0
 * @PackagePath: com.bonus.common.biz.enums
 * @CreateTime: 2024-12-23  10:42
 * @Description: 新购任务阶段枚举
 */
@Getter
public enum PurchaseTaskStageEnum {

    MANAGE(1, "管理"),
    CHECK(2, "验收"),
    BIND(3, "绑定"),
    STORE(4, "入库");

    private final int code;
    private final String name;

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

    public static PurchaseTaskStageEnum getByCode(int code) {
        for (PurchaseTaskStageEnum stageEnum : PurchaseTaskStageEnum.values()) {
            if (stageEnum.getCode() == code) {
                return stageEnum;
            }
        }
        return null;
    }

}
