package org.springblade.yeePay.entity.saas;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springblade.yeePay.common.YeepayProduct;
import org.springblade.yeePay.entity.MerchantInfo;

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

/**
 * @author: lianghanqiang
 * @description: 入网申请Dto
 * @since: 9/6/21 -- 10:57 AM
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("入网申请Dto")
public class InvitationDto extends MerchantInfo {

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

	@ApiModelProperty(value = "入网商户的业务角色",required = true)
	private String businessRole;

	@ApiModelProperty(value = "商户主体信息",required = true)
	private MerchantSubjectInfo merchantSubjectInfo;

	@ApiModelProperty(value = "商户法人信息",required = true)
	private MerchantCorporationInfo merchantCorporationInfo;

	@ApiModelProperty(value = "商户联系人信息",required = true)
	private MerchantContactInfo merchantContactInfo;

	@ApiModelProperty(value = "经营地址",required = true)
	private BusinessAddressInfo businessAddressInfo;

	@ApiModelProperty(value = "结算账户信息",required = false)
	private SettlementAccountInfo settlementAccountInfo;

	@ApiModelProperty(value = "开通产品信息",required = true)
	private List<ProductInfo> productInfo;

	@ApiModelProperty(value = "产品资质信息",required = false)
	private ProductQualificationInfo productQualificationInfo;

	/**
	 * 1、用于接收电子签章地址，完成协议签署；
	 * 		2、用于接收审核已驳回状态下的原因；
	 * 		3、用于接收入网完成的通知。
	 * */
	@ApiModelProperty(value = "回调地址",required = true)
	private String notifyUrl;


	/**
	 * @author: lianghanqiang
	 * @description: 商户主体信息
	 * @since: 9/6/21 -- 1:48 PM
	 */
	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	@ApiModel("商户主体信息")
	public class MerchantSubjectInfo {

		@NotBlank
		@ApiModelProperty(value = "商户签约类型",required = true)
		private String signType;

		@NotBlank
		@ApiModelProperty(value = "商户证件编号",required = true)
		private String licenceNo;

		@NotBlank
		@ApiModelProperty(value = "商户证件照片",required = true)
		private String licenceUrl;

		@NotBlank
		@ApiModelProperty(value = "商户签约名称",required = true)
		private String signName;

		@NotBlank
		@ApiModelProperty(value = "商户简称",required = true)
		private String shortName;

		@NotBlank
		@ApiModelProperty(value = "开户许可证编号",required = true)
		private String openAccountLicenceNo;

		@NotBlank
		@ApiModelProperty(value = "开户许可证照片",required = true)
		private String openAccountLicenceUrl;

		@NotBlank
		@ApiModelProperty(value = "手持营业执照在经营场所的照片",required = true)
		private String handLicenceUrl;
	}


	/**
	 * @author: lianghanqiang
	 * @description: 商户法人信息
	 * @since: 9/6/21 -- 1:59 PM
	 */
	@Data
	@ApiModel("商户法人信息")
	@NoArgsConstructor
	@AllArgsConstructor
	public class MerchantCorporationInfo {

		@ApiModelProperty(value = "法人姓名",required = true)
		private String legalName;

		@ApiModelProperty(value = "法人证件类型",required = true)
		private String legalLicenceType;

		@ApiModelProperty(value = "法人证件号码",required = true)
		private String legalLicenceNo;

		@ApiModelProperty(value = "法人身份证件正面照片",required = true)
		private String legalLicenceFrontUrl;

		@ApiModelProperty(value = "法人身份证件反面照片",required = true)
		private String legalLicenceBackUrl;
	}


	/**
	 * @author: lianghanqiang
	 * @description: 商户联系人信息
	 * @since: 9/6/21 -- 2:05 PM
	 */
	@NoArgsConstructor
	@AllArgsConstructor
	@Data
	@ApiModel("商户联系人信息")
	public class MerchantContactInfo {

		@ApiModelProperty(value = "商户联系人姓名",required = true)
		private String contactName;

		@ApiModelProperty(value = "商户联系人证件号码",required = true)
		private String contactLicenceNo;

		@ApiModelProperty(value = "商户联系人手机号",required = true)
		private String contactMobile;

		@ApiModelProperty(value = "商户联系人邮箱",required = true)
		private String contactEmail;

		@ApiModelProperty(value = "客服电话",required = false)
		private String servicePhone;
	}


	/**
	 * 	经营地址
	 * */
	@NoArgsConstructor
	@AllArgsConstructor
	@Data
	@ApiModel("经营地址")
	public class BusinessAddressInfo{

		@ApiModelProperty(value = "商户实际经营地所在省",required = true)
		private String province;

		@ApiModelProperty(value = "商户实际经营地所在市",required = true)
		private String city;

		@ApiModelProperty(value = "商户实际经营地所在区",required = true)
		private String district;

		@ApiModelProperty(value = "商户实际经营详细地址",required = true)
		private String address;
	}


	/**
	 * 	开通产品信息
	 * */
	@NoArgsConstructor
	@AllArgsConstructor
	@Data
	@ApiModel("开通产品信息")
	public static class ProductInfo{

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

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

		@ApiModelProperty(value = "单笔百分比",required = false)
		private String percentRate;

		@ApiModelProperty(value = "单笔固定值",required = false)
		private String fixedRate;

		@ApiModelProperty(value = "手续费承担方",required = false)
		private String undertaker;

		@ApiModelProperty(value = "手续费收取方式",required = false)
		private String paymentMethod;

		private String productName;

	}

	/**
	 * 	结算账户信息
	 * */
	@NoArgsConstructor
	@AllArgsConstructor
	@Data
	@ApiModel("结算账户信息")
	public class SettlementAccountInfo{

		@ApiModelProperty(value = "结算方向",required = false)
		private String settlementDirection;

		@ApiModelProperty(value = "银行账户类型",required = false)
		private String bankAccountType;

		@ApiModelProperty(value = "银行账户号码",required = false)
		private String bankCardNo;

		@ApiModelProperty(value = "银行账户开户总行编码",required = false)
		private String bankCode;

	}

	/**
	 * 	产品资质信息
	 * */
	@NoArgsConstructor
	@AllArgsConstructor
	@Data
	@ApiModel("产品资质信息")
	public class ProductQualificationInfo{

		@ApiModelProperty(value = "MCC码",required = false)
		private String mcc;

		@ApiModelProperty(value = "付款场景",required = false)
		private String paymentScene;

		@ApiModelProperty(value = "付款业务协议图片/附件",required = false)
		private String agreementPhotoUrl;

		@ApiModelProperty(value = "付款业务系统截图/附件",required = false)
		private String systemScreenshotUrl;

		@ApiModelProperty(value = "特批开通流程/截图",required = false)
		private String specialPermitProcessUrl;

	}
}
