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

import lombok.AllArgsConstructor;
import lombok.Getter;

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

/**
 * @author wjh
 * 2024/3/30
 */
@AllArgsConstructor
@Getter
public enum WxTransferBatchStatus {
    WAIT_PAY("WAIT_PAY", "待付款确认"),
    ACCEPTED("ACCEPTED", "已受理"),
    PROCESSING("PROCESSING", "转账中"),
    FINISHED("FINISHED", "已完成"),
    CLOSED("CLOSED", "已关闭");


    private final String status;
    private final String msg;

    public static WxTransferBatchStatus parse(String status) {
        for (WxTransferBatchStatus obj : WxTransferBatchStatus.values()) {
            if (Objects.equals(obj.getStatus(), status)) {
                return obj;
            }
        }
        return null;
    }

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