package com.yonge.cooleshow.common.enums.payment;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.google.common.collect.Lists;
import lombok.Getter;

import java.util.List;

/**
 * 订单支付状态
 */
@Getter
public enum EPaymentStatus  {

    WAIT_PAY("待支付"),
    PAYING("支付中"),
    PAID("已付款"),
    TIMEOUT("订单超时"),
    FAIL("支付失败"),
    CLOSED("订单关闭"),
    REFUNDED("已退款"),
    ;

    private final String msg;

    @EnumValue
    private final String code;

    EPaymentStatus(String msg) {
        this.msg = msg;

        this.code = this.name();
    }

    /**
     * 乐团报名状态
     * @return List<EPaymentStatus>
     */
    public static List<EPaymentStatus> registerStatus() {
        return Lists.newArrayList(PAID);
    }

    /**
     * 乐团报名订单
     * WAIT_PAY, PAYING, 只能是已支付和退款中的订单
     * @return List<EPaymentStatus>
     */
    public static List<EPaymentStatus> registerOrder() {
        return Lists.newArrayList(PAID);
    }
}
