package com.ruoyi.ss.timeBill.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author wjh
 * 2024/7/24
 */
@Getter
@AllArgsConstructor
public enum TimeBillStatus {

    USING("1", "使用中"),
    WAIT_PAY("2", "待付款"),
    PAYING("3", "付款中"),
    PAY_SUCCESS("4", "支付成功"),
    FREE_CANCEL("5", "免费取消");

    private final String status;
    private final String msg;


    public static List<String> asList(TimeBillStatus ...statuses) {
        return Arrays.stream(statuses).map(TimeBillStatus::getStatus).collect(Collectors.toList());
    }

    /**
     * 可进行支付的状态列表
     */
    public static List<String> getCanPayList() {
        return asList(WAIT_PAY, PAYING);
    }
}
