package com.ylx.massage.enums;

import com.ylx.common.utils.StringUtils;
import lombok.Getter;
import org.apache.commons.compress.utils.Lists;

import java.util.ArrayList;
import java.util.List;

/**
 * @author jianlong
 * @date 2024-03-27 11:51
 * 业务类型枚举
 */
@Getter
public enum BillTypeEnum {

    //进行中(待接单,已接单,已到达,服务中)
    RECHARGE(1, "充值"),

    BALANCE_PAYMENT(2, "余额支付"),

    INCOME(3, "技师收益"),

    WITHDRAWAL(4, "技师提现"),

    WX_PAY(5, "微信支付"),

    DISTRIBUTION(6, "分销收益"),

    REFUSE_ACCEPT_REFUND(7, "拒绝接单退款到余额"),

    CANCEL_ACCEPT_REFUND(8, "取消订单退款到余额"),

    REFUSE_WX_REFUND(9, "拒绝接单退款到微信"),

    CANCEL_WX_REFUND(10, "取消订单退款到微信"),

    CASH_PAYMENT(11, "现金支付");



    private final Integer code;
    private final String info;

    BillTypeEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public static List<Enumproject> getStatusEnum() {

        ArrayList<Enumproject> objects = Lists.newArrayList();
        for (BillTypeEnum value : BillTypeEnum.values()) {
            Enumproject enumproject = new Enumproject();
            enumproject.setInfo(value.getInfo());
            enumproject.setCode(value.getCode());
            objects.add(enumproject);
        }
        return objects;
    }

    public static String getDescByCode(Integer code) {
        for (BillTypeEnum value : BillTypeEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getInfo();
            }
        }
        return StringUtils.EMPTY;
    }

}
