package org.springblade.yeePay.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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

@Data
@Builder
@ApiModel("批量转账入参")
public class BatchTransferDto {

	@NotBlank
	@ApiModelProperty(value = "批次号",required = true)
	String batchNo;

	@NotBlank
	@ApiModelProperty(value = "到账类型：REAL_TIME:实时\n" +
		"TWO_HOUR:两小时\n" +
		"NEXT_DAY:次日",required = true	)
	String receiveType;

	@NotNull
	@ApiModelProperty(value = "订单详情",required = true,dataType="DetailList")
	@Valid
	List<DetailList> detailList;

	@ApiModelProperty("回调地址")
	String notifyUrl;

	@ApiModelProperty("后台配置，忽略")
	String parentMerchantNo;
	@ApiModelProperty("后台配置，忽略")
	String merchantNo;

	@ApiModel("DetailList")
	@Data
	@AllArgsConstructor
	@NoArgsConstructor
	private static class DetailList {

		@NotBlank
		@ApiModelProperty(value = "订单号",required = true)
		String requestNo;

		@NotBlank
		@ApiModelProperty(value = "收款方银行账号",required = true)
		String receiverAccountNo;

		@NotBlank
		@ApiModelProperty(value = "收款方账号名",required = true)
		String receiverAccountName;

		@NotBlank
		@ApiModelProperty(value = "银行卡所在开户行编号",required = true)
		String receiverBankCode;

		@NotNull
		@ApiModelProperty(value = "付款金额",required = true)
		Double orderAmount;

		@NotBlank
		@ApiModelProperty(value = "账户类型\n" +
			"可选项如下:\n" +
			"DEBIT_CARD:借记卡\n" +
			"CREDIT_CARD:贷记卡\n" +
			"QUASI_CREDIT_CARD:准贷卡\n" +
			"PASSBOOK:存折\n" +
			"UNIT_SETTLE_CARD:单位结算卡\n" +
			"PUBLIC_CARD:对公卡",required = true)
		String bankAccountType;

		@NotBlank
		@ApiModelProperty(value = "手续费承担方(若不传默认付款方)\n" +
			"可选项如下:\n" +
			"PAYER:付款方\n" +
			"PAYEE:收款方",required = true)
		String feeChargeSide;


	}
}
