package org.springblade.common.constant;

import io.swagger.models.auth.In;
import lombok.Getter;

import java.math.BigDecimal;

/**
 * Created By lidexi in 2021/6/27
 **/
public interface SystemConstant {

	String BUSSINESS_ROLE_ID = "1413055003228176386";
	String BUSSINESS_DEPT_ID = "1413074823852171266";
	String TEST_BUSSINESS_ROLE_ID = "1448851547377025025";

	//用户一天最多提现多少次的参数key
	String USERWITHDRAWTIMES = "user_withdraw_times";
	//缓存提现次数的key
	String WITHDRAW_KEY = "withdraw_key:";
	//提现的最低额度
	String WITHDRAW_MININUM = "withdraw_minimum";
	//采购商充值服务费比例
	String BUSSINESS_SERVICE_RATE="bussiness_service_rate";

	/**
	 * 分红类型
	 */
	@Getter
	enum CommissionType{

		CITY_COMMISSION("城市分红",1),
		RECOMMEND_COMMISSION("推广分红",2);

		String name;
		Integer value;
		CommissionType(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 分红类型
	 */
	@Getter
	enum AgenterType{

		CITY_AGENTER(1L,"城市代理"),
		RECOMMEND_AGENTER(2L,"推广代理");

		Long id;
		String name;
		AgenterType(Long id, String name){
			this.id = id;
			this.name = name;
		}
	}

	/**
	 * 分佣状态
	 */
	@Getter
	enum CommissionStatus{

		CANCEL("取消",-1),
		PAYING("待结算",0),
		PAYED("已结算",1);


		String name;
		Integer value;
		CommissionStatus(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 账单支付状态billrecord
	 */
	@Getter
	enum BillRecordPayStatus{

		PAYED("已付款",1),
		PAYING("待付款",0),
		CANCEL("取消",2),
		FAIL("失败", 3),
		ERROR("系统异常", 4),
		HANDLING("处理中", 5),
		ACCOUNTING_EXCEPTION("充值处理中-入账异常", 6);


		String name;
		Integer value;
		BillRecordPayStatus(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 账单支付类型
	 */
	@Getter
	enum BillRecordType{

		//1，2，3均为用户消费
		PRODUCT_REWARD("作品打赏",1),
		AUTHOR_REWARD("作者打赏",2),
		SHOPPING("积分商品购买",3),
		AGENTER("代理费",4),
		ADS("采购商",5);


		String name;
		Integer value;
		BillRecordType(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 提现类型
	 */
	@Getter
	enum WithdrawRecordType{

		//1.用户提现 2.代理提现 3.采购商提现 4.主办方提现 5运营方提现
		USER("用户提现",1),
		AGENTER("代理提现",2),
		ADS("采购商提现",3),
		SPONSOR("主办方提现",4),
		OPERATION("运营方提现",5),
		BUSSINESS("商户提现",6),
		ADS_BONUS("采购商红利分润",7);


		String name;
		Integer value;
		WithdrawRecordType(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 提现状态
	 */
	@Getter
	enum WithdrawRecordStatus{

		//提现状态 0 处理中 1 已处理 2 提现失败
		WATTING("处理中",0),
		SUCCESS("已处理",1),
		FAIL("提现失败",2);


		String name;
		Integer value;
		WithdrawRecordStatus(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 采购商扣款类型
	 */
	@Getter
	enum BussinessDebitType{

		//扣款类型： 1-分润 2-曝光量收费 3-点击量收费
		COMMISSION("分润",1),
		SUCCESS("曝光量收费",2),
		FAIL("点击量收费",3);


		String name;
		Integer value;
		BussinessDebitType(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 采购商充值分润状态
	 */
	@Getter
	enum BussinessBonusStatus{

		//采购商充值分润状态： 0-待分配 1-待分配 2-分配成功 3-分配失败 4-系统异常
		WATING("待分配",0),
		BONUSING("分配中",1),
		SUCCESS("分配成功",2),
		FAIL("分配失败",3),
		ERROR("系统异常",4);


		String name;
		Integer value;
		BussinessBonusStatus(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 商户分润记录状态  状态: 1-待确认 2- 已确认 3-确认失败
	 */
	@Getter
	enum BussinessDebitStatus{


		WATING("待确认",1),
		SUCCESS("已确认",2),
		FAIL("失败",3),
		ERROR("系统异常",4);


		String name;
		Integer value;
		BussinessDebitStatus(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 商户状态: 1-禁用 0-正常
	 */
	@Getter
	enum BussinessStatus{
		DISABLE("禁用", 1),
		NORMAL("正常", 0);

		String name;
		Integer value;
		BussinessStatus(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 商户入网状态: 100-入网资料完善中 101-入网待审核 200-入网成功 300 入网失败
	 */
	@Getter
	enum BussinessRegisterStatus{
		DOING("资料完善中", 100),
		WAIT_SIGNING("协议待签署", 101),
		WAIT_AUDIT("审核中", 102),
		SUCCESS("审核成功", 200),
		FAIL("审核失败", 400),
		SUBMIT_SUCCESS("送审中", 98),
		SUBMIT_FAIL("送审失败", 99);

		String name;
		Integer value;
		BussinessRegisterStatus(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	@Getter
	enum BussinessContactType{
		LEGAL("法人", 10),
		CONTACT("联系人", 11);

		String name;
		Integer value;
		BussinessContactType(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 转账订单状态
	 */
	@Getter
	enum TransferOrderStatus{
		WAIT("待处理", 18),
		REQUEST_RECEIVE("正在处理", 19),
		SUCCESS("转账成功", 20),
		FAIL("转账失败", 21);

		String name;
		Integer value;
		TransferOrderStatus(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 转账场景
	 */
	@Getter
	enum TransferScene{
		FOR_SERVICE_FEE("充值转账服务费", 10),
		FOR_PAY("代付前转账", 20),
		FOR_WITHDRAW_FIRST_TRANSFER("提现前第一次转账", 30),
		FOR_WITHDRAW_SECOND_TRANSFER("提现前第二次转账", 31),
		FOR_BONUS_TRANSFER("分润前转账", 32);

		String name;
		Integer value;
		TransferScene(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}

	/**
	 * 提现状态
	 */
	@Getter
	enum WithdrawOrderStatus{
		WAIT("待发起", 10),
		REQUEST_RECEIVE("处理中", 11),
		REQUEST_ACCEPT("处理中", 12),
		REMITING("处理中", 13),
		FAIL("失败", 14),
		SUCCESS("成功", 15);

		String name;
		Integer value;
		WithdrawOrderStatus(String name, Integer value){
			this.name = name;
			this.value = value;
		}

		public static String getNameByValue(Integer value){
			for (WithdrawOrderStatus item : WithdrawOrderStatus.values()) {
				if(item.getValue().equals(value)){
					return item.getName();
				}
			}
			return null;
		}
	}

	/**
	 * 商户类型
	 */
	@Getter
	enum BussinessType{
		PLATFORM_MERCHANT("平台商", 10),
		SETTLED_MERCHANT("入驻商", 20);

		String name;
		Integer value;
		BussinessType(String name, Integer value){
			this.name = name;
			this.value = value;
		}
	}
}
