package com.freemud.sdk.api.assortment.order.enums;

/**
 * 老订单状态
 *
 * @author guolm
 */

/**
 * 过期请使用OldOrderStatus
 */
@Deprecated
public enum QueryOrderStatus {

    TAKE_ORDER("TAKE_ORDER", "下单"),
    WAIT_PAY("WAIT_PAY", "待支付"),
    RECEIPT("RECEIPT", "接单"),
    DISTRIBUTION("DISTRIBUTION", "配送中"),
    COMPLETE("COMPLETE", "完成"),
    CALCEL("CALCEL", "取消"),
    REFUSE("REFUSE", "拒单"),
    COMPLETE_MAKE("COMPLETE_MAKE", "制作完成");

    private String code;
    private String desc;

    QueryOrderStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String[] getAllCodes() {
        String[] codeArray = new String[values().length];
        int i = 0;
        for (QueryOrderStatus oldOrderStatus : values()) {
            codeArray[i] = oldOrderStatus.getCode();
            i++;
        }
        return codeArray;
    }

    public static QueryOrderStatus getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (QueryOrderStatus oldOrderStatus : values()) {
            if (oldOrderStatus.getCode().equals(code)) {
                return oldOrderStatus;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
