package com.ywt.outpatient.domain.models.enums;


/**
 * 订单状态：0-待支付；1-已支付；2-已退款
 */
public enum GoodsOrdersStatusEnum {

    PendingPayment("待支付", 0),
    AlreadyPaid("已支付", 1),
    Refunded("已退款", 2);

    private final String displayName;

    private final int value;

    GoodsOrdersStatusEnum(String displayName, int value) {
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static GoodsOrdersStatusEnum valueOf(int value){
        switch (value){
            case 1:
                return AlreadyPaid;
            case 2:
                return Refunded;
            default:
                return PendingPayment;
        }
    }
}
