package com.prolog.cs.biz.outbound.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;

@ApiModel
public enum BILL_TYPE {

    FOUR("4","移库出库"),
    SEVEN("7","直调出库"),
    EIGHT("8","代管出库"),
    NINE("9","待检出库"),
    THIRTEEN("13","有实物出库"),
    FOURTEEN("14","无实物出库"),
    FIFTEEN("15","发货暂存"),
    SIXTEEN("16","有实物出库"),
    SEVENTEEN("17","无实物出库");

    @JsonCreator
    public static BILL_TYPE getBillTypeEnum(final String codeValue) {
        for (BILL_TYPE e : values()) {
            if (e.code.equals(codeValue)) {
                return e;
            }
        }
        return null;
    }
    public static BILL_TYPE createByValue(final String codeValue) {
        for (BILL_TYPE e : values()) {
            if (e.code.equals(codeValue)) {
                return e;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return code;
    }


    public String getCode() {
        return code;
    }

    @JsonValue
    public String getName() {
        return name;
    }

    private String code;
    private String name;

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

}