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

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

import java.util.Arrays;

/**
 * 分销商旅行社交易类型
 */
@Getter
@RequiredArgsConstructor
public enum DistributorTradeTypeEnum implements IntArrayValuable {


    BALANCE_RECHARGE(1, "预付款充值"),
    CREDIT_RECHARGE(2 ,"授信充值"),
    STOCK_DIRECT_RECHARGE(3, "定向库存充值"),
    BALANCE_TRANS(4, "预付款消费"),
    BALANCE_REFUND(5, "预付款退款"),
    CREDIT_TRANS(7, "授信消费"),
    CREDIT_REFUND(8, "授信退款"),
    STOCK_DIRECT_TRANS(9, "定向库存购买"),
    STOCK_DIRECT_REFUND(10, "定向库存退款"),
    BALANCE_SELF_RECHARGE(11, "预付款自助充值"),
    BALANCE_STOCK_DIRECT_RECHARGE(12, "定向库存购买"),
    BALANCE_STOCK_DIRECT_BACK(13, "定向库存回收"),
    MARKETING_RECHARGE(14, "营销政策充值"),
    MARKETING_REFUND(15, "营销政策撤回"),
    BALANCE_PAY_CREDIT_BILL(16, "预付款支付授信账单"),
    BALANCE_DISTRIBUTE_STORE(17, "给门店分配预付款"),
    CREDIT_DISTRIBUTE_STORE(18, "给门店分配授信"),
    GUIDE_REFUND_BALANCE_TRANS(19, "导游代退扣预存款"),
    GUIDE_REFUND_BALANCE_TRANS_CANCEL(20, "导游代退失败回退预存款"),
    ;

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

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

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