package org.springblade.yeePay.entity.saas.changeservice;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springblade.yeePay.common.YeepayApiConstant;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * @author July
 * @version 1.0.0
 * @ClassName ProductFeeModifyDto.java
 * @Description 商户产品费率变更DTO
 * @createTime 2021年09月30日 11:04:00
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@ApiModel("商户产品费率变更入参")
public class ProductFeeModifyDto {

	@NotBlank
	@ApiModelProperty(value = "请求号", required = true)
	private String requestNo;

	@NotBlank
	@ApiModelProperty(value = "如果为平台商拓展商户（入驻商户），此为平台商商户编号；如为saas服务商拓展商户（平台商/标准商户），此为saas服务商商户编号。", required = true)
	private String parentMerchantNo;

	@NotBlank
	@ApiModelProperty(value = "需要变更产品的商户编号", required = true)
	private String merchantNo;

	@NotBlank
	@ApiModelProperty(value = "1、用于接收电子签章地址，完成协议签署；2、用于接收变更完成的通知。", required = true)
	private String notifyUrl;

	@NotBlank
	@ApiModelProperty(value = "变更产品信息", required = true)
	private List<ModifyProductInfo> productInfo;

	@NoArgsConstructor
	@AllArgsConstructor
	@Getter
	@Setter
	@ApiModel("商户产品费率变更入参")
	public static class ModifyProductInfo {

		@NotBlank
		@ApiModelProperty(value = "产品码", required = true)
		private String productCode;

		@NotBlank
		@ApiModelProperty(value = "计费策略", required = true)
		private YeepayApiConstant.rateType rateType;

		/**
		 * 计费策略为SINGLE_PERCENT、FIXED_MIX_PERCENT、PERCENT_MIX_CAP时，必填。
		 * 1、该字段单位：%；如0.5%，上传0.5即可。
		 * 2、规则:0<=rate<=100,整数位最多3位，小数位最多保留2位。
		 */
		@NotBlank
		@ApiModelProperty(value = "单笔百分比(计费策略为SINGLE_PERCENT、FIXED_MIX_PERCENT、PERCENT_MIX_CAP时，必填。\n" +
			"1、该字段单位：%；如0.5%，上传0.5即可。\n" +
			"2、规则:0<=rate<=100,整数位最多3位，小数位最多保留2位。)", required = true)
		private String percentRate;

		@NotBlank
		@ApiModelProperty(value = "单笔固定值(计费策略为SINGLE_FIXED、FIXED_MIX_PERCENT、PERCENT_MIX_CAP时，必填。\n" +
			"1、单位：元/笔；如5元/笔，上传5即可。\n" +
			"2、规则:0<=rate,整数位最多6位，小数位最多保留2位)", required = true)
		private String fixedRate;

		@NotBlank
		@ApiModelProperty(value = "手续费承担方", required = true)
		private YeepayApiConstant.undertaker undertaker;

		@NotBlank
		@ApiModelProperty(value = "手续费收取方式", required = true)
		private YeepayApiConstant.paymentMethod paymentMethod;

	}
}
