package org.ta.pddserver.model.enums;

import lombok.Getter;

public enum OrderRejectCode {

    ChaoDa (20, "超大", "很抱歉，您的包裹因超大原因被{}集运仓拒签，请联系卖家并申请退款", "超大"),
    ChaoZhong (21, "超重", "很抱歉，您的包裹超重原因被{}集运仓拒签，请联系卖家并申请退款", "超重"),
    JinYun(22, "海关违禁品", "很抱歉，您的包裹因运输品类限制原因被{}集运仓拒签，请联系卖家并申请退款", "海关违禁品（目的地海关政策禁止入境商品）"),
    TeHuo (23, "运输品类限制", "很抱歉，您的包裹因运输品类限制原因被{}集运仓拒签，请联系卖家并申请退款", "运输品类限制（液体、粉末、带电、带磁性、易碎品）"),
    YeWuYiChang (24, "货到付款", "很抱歉，您的包裹因货到付款原因被{}集运仓拒签，请联系卖家并申请退款", "到付件，”到付“，是指卖家拍下商品时为货到付款，仓库不承担这部分一段费用而拒收。"),
    YeWuYiChang2 (25, "非原面单/外包装", "很抱歉，您的包裹因非原面单/外包装原因被{}集运仓拒签，请联系卖家并申请退款", "非原面单/外包装"),
    ShouHou (26, "申请退货", "很抱歉，您的包裹因申请退货原因被{}集运仓拒签，请联系卖家并申请退款", "申请退货"),
    ShenQingTuiHuo (27, "破损", "很抱歉，您的包裹因破损原因被{}集运仓拒签，请联系卖家并申请退款", "破损"),
    BaoGuoWuXiao (33, "包裹无效", "很抱歉，您的包裹因包裹无效原因无法正常入库，请速与{}集运商联系。", "包裹无效（无实物）"),
    UNKNOWN (0, "异常", "异常", "异常");


    @Getter
    private int value;
    @Getter
    private String desc;
    @Getter
    private String remark;
    @Getter
    private String info;

    OrderRejectCode(int val, String desc, String remark, String info) {
        this.value = val;
        this.desc = desc;
        this.remark = remark;
        this.info = info;
    }

    // 根据状态码查询枚举（核心业务方法）
    public static OrderRejectCode getByCode(int value) {
        for (OrderRejectCode orderRejectCode : OrderRejectCode.values()) {
            if (orderRejectCode.getValue() == value) {
                return orderRejectCode;
            }
        }
        return UNKNOWN;
    }

}
