package com.iformall.enums;

/**
 * Created by Stormeye on 2018/08/09.
 */
public enum EnumPosActionType {

    // 0: 检查, 1: 预核销 2: 预核销撤销 3：独立核销 4: 交易核销 5：核销撤销

    CHECK(0, "检查"),
    CALC(1, "计算"),
    PAY_VERIFY_PRE(2, "交易预核销"),
    PAY_VERIFY_PRE_CANCEL(3, "交易预核销撤销"),
    VERIFY_INDEPENT(4,"独立核销"),
    VERIFY_PAY(5,"交易核销"),
    VERIFY_CANCEL(6,"核销撤销")
    ;

    public static EnumPosActionType getEnum(Integer code) {
        for (EnumPosActionType value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    private Integer code;
    private String message;

    EnumPosActionType(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
