package com.iformall.enums;

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

    // 0-待付款;1-已支付;2-已取消(限定时间内未付款);3-待退款;4-已退款;5-退款失败

    ORDER_STATUS_PENDING_PAYMENT(0, "待付款"),//占库存
    ORDER_STATUS_PAYMENT_SUCCESS(1, "已支付"),//占库存
    ORDER_STATUS_OVERTIME_CANCEL(2, "已取消"),
    ORDER_STATUS_PENDING_REFUND(3, "待退款"),//占库存
    ORDER_STATUS_REFUND_SUCCESS(4,"已退款"),
    ORDER_STATUS_REFUND_FAILD(5, "退款失败"),//占库存
    ORDER_STATUS_PRESSING(6, "砍价中"),//占库存
    ORDER_STATUS_PRESS_COMPLETE(7, "砍价完成"),//占库存
    ORDER_STATUS_PRESS_OVERTIME(8, "砍价已过期"),
    ORDER_STATUS_PRESS_CANCEL(9, "砍价已取消"),
    ORDER_STATUS_COOPERATING(10, "拼团中"),//占库存
    ORDER_STATUS_COOPERATING_COMPLETE(11, "拼团完成"),//占库存
    ORDER_STATUS_COOPERATING_OVERTIME(12, "拼团已过期"),
    ORDER_STATUS_COOPERATING_CANCEL(13, "拼团失败"),
    ORDER_STATUS_COOPERATING_FAILD(14, "参团失败"),
    ORDER_STATUS_COOPERATING_UNPAID(15, "拼团待付款"),//占库存
    ORDER_STATUS_COOPERATING_BREAK(16, "拼团取消")
    ;

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

    private Integer code;
    private String message;

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

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
