package com.bonus.common.biz.enums;

import lombok.Getter;

/**
 * @author bonus
 */

@Getter
public enum PurchaseTaskStatusEnum {
    TO_NOTICE(1, "待通知"),
    TO_CHECK(2, "待验收"),
    TO_BIND(3, "待绑定"),
    TO_STORE(4, "待入库"),
    TO_CHECK_AFTER_REJECT(12, "待验收(驳回后)"),
    TO_BIND_AFTER_REJECT(13, "待绑定(驳回后)"),
    TO_STORE_AFTER_REJECT(14, "待入库(驳回后)"),
    IN_STORE(19, "已入库"),
    TASK_IN_PROGRESS(21, "入库进行中"),
    TASK_FINISHED(22, "入库已完成");

    private final Integer status;
    private final String statusName;

    PurchaseTaskStatusEnum(Integer status, String statusName) {
        this.status = status;
        this.statusName = statusName;
    }


    public static PurchaseTaskStatusEnum getByStatus(Integer status) {
        for (PurchaseTaskStatusEnum statusEnum : values()) {
            if (statusEnum.status.equals(status)) {
                return statusEnum;
            }
        }
        return null;
    }

    public Integer getStatus() {
        return status;
    }

    public String getStatusName() {
        return statusName;
    }
}
