package com.brilliance.isc.common.quemod.vo;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum TaskStatus {

    NEW("new", "待分配"),
    RENEW("renew", "待重新分配"),
    WAITING("waiting", "待复核"),
    PENDING("pending", "暂存"),
    CORRECT("correct", "已退回"),
    REJECTED("rejected", "已删除"),
    RELEASE("release", "已复核"),
    PICKUP("pickup", "已处理"),
    DELETED("deleted", "已删除"),
    LOCKED("locked", "已锁定"),
    CONFIRM("confirm", "已确认"),
    TO_CONFIRM("to_confirm", "待柜员确认"),
    WAITING_CONFIRM("waiting_confirm", "待客户确认"),
    CUSTOMER_CONFIRM("customer_confirm", "客户已确认"),
    INCOMING("incoming", "来报"),
    HIDE("hide", "已归档"),
    ASSIGNED("assigned", "已分配"),
    FINISHED("finished", "已完成"),
    PENDING_DECLARATION("pending_declaration", "待申报");


    private final String value;
    private final String name;

    public static String getNameByValue(String value) {
        for (TaskStatus s : TaskStatus.values()) {
            if (Objects.equals(s.getValue(), value)) {
                return s.getName();
            }
        }
        return "";
    }

}
