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

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum TaskFlowStatus {

    BRANCH_HANDLE("branch_handle","分行经办"),
    BRANCH_FIRST_RELEASE("branch_first_release","分行一级复核"),
    BRANCH_SECOND_RELEASE("branch_second_release","分行二级复核"),
    HEADQUARTER_HANDLE("headquarter_handle ","总行经办"),
    HEADQUARTER_FIRST_RELEASE("headquarter_first_release ","总行一级复核"),
    HEADQUARTER_SECOND_RELEASE("headquarter_second_release ","总行二级复核"),
    HEADQUARTER_SDH_HANDLE("headquarter_sdh_handle  ","总行收单行经办"),
    HEADQUARTER_SDH_FIRST_RELEASE("headquarter_sdh_first_release ","总行收单行一级复核"),
    HEADQUARTER_SDH_SECOND_RELEASE("headquarter_sdh_second_release ","总行收单行二级复核");

    private final String value;
    private final String name;

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

}
