package com.yc.ship.module.trade.enums;


import com.yc.ship.framework.common.core.IntArrayValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
 * 支付来源
 *
 */
@RequiredArgsConstructor
@Getter
public enum PaySourceEnum implements IntArrayValuable {
    STOCK_DIRECT_ORDER(100, "定向库存购买"),
    DISTRIBUTOR_RECHARGE_ORDER(101, "分销商在线充值"),
    CREDIT_BILL_REPAYMENT(102, "授信账单还款"),
    DXKC_BILL_REPAYMENT(103, "对公充值预存款"),
    SUPP_TICKET_PAY(104, "补票支付"),
    GUIDE_REFUND_PLAT_CHARGEBACK(105, "导游代退平台扣款");



    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PaySourceEnum::getType).toArray();

    /**
     * 类型值
     */
    private final Integer type;
    /**
     * 状态名
     */
    private final String name;


    @Override
    public int[] array() {
        return ARRAYS;
    }

    public static PaySourceEnum valueOf(Integer type){
        return Arrays.stream(PaySourceEnum.values()).filter(item->item.type.equals(type)).findFirst().get();
    }

}
