package org.ta.pddserver.model.enums;

import lombok.Getter;

public enum OrderProblemType {
    JinYun(1, "禁运"),
    ChaoDa (2, "超大"),
    ChaoZhong (3, "超重"),
    PinLeiXianZhi (4, "运输品类限制（特货）"),
    DiuShi (5, "丢失"),
    PoSun (6, "破损"),
    ShenQingTuiHuo (7, "申请退货"),
    BaoGuoWuXiao (8, "包裹无效（无实物）"),
    DaoFuJian (9, "到付件"),
    Other (10, "非原面单/外包装")
    ;
    @Getter
    private int value;
    @Getter
    private String desc;

    OrderProblemType(int val, String desc) {
        this.value = val;
        this.desc = desc;
    }

    public static OrderProblemType verify(Integer reasonCode) {
        for (OrderProblemType orderProblemType : OrderProblemType.values()) {
            if (orderProblemType.value == reasonCode) {
                return orderProblemType;
            }
        }
        return null;
    }
}
