package com.haha.common.enums;

public enum RecognizeActionType {

    IN("IN", "放入"),
    OUT("OUT", "取出");

    private final String code;
    private final String description;

    RecognizeActionType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static RecognizeActionType fromCode(String code) {
        if (code == null) {
            return null;
        }
        for (RecognizeActionType type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}
