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

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.YeepayApiConstant;

import javax.validation.constraints.NotBlank;

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@ApiModel("付款到供应商--申请添加供应商入参")
public class SupplierApplyDto {

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

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

	@NotBlank
	@ApiModelProperty(value = "供应商账户信息", required = true)
	private SupplierAccountInfo supplierAccountInfo;

	@NotBlank
	@ApiModelProperty(value = "供应商资质信息，其中文件信息请先通过子商户入网资质上传接口上传。", required = true)
	private SupplierQualInfo supplierQualInfo;

	@ApiModelProperty("商户通知地址，不传则不通知")
	private String notifyUrl;

	/**
	 * YeepayApiConstant---reasonType
	 * 可选项如下:
	 * SHFY:商户返佣,
	 * GYSDK:供应商打款,
	 * XJDWDK:下级单位打款,
	 * QT:其他
	 */
	@ApiModelProperty("商户通知地址，不传则不通知")
	private YeepayApiConstant.reasonType reasonType;

	@ApiModelProperty("付款原因;当付款原因类型为其他时，需商户写具体原因")
	private String reason;

}

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@ApiModel("供应商账户信息")
class SupplierAccountInfo {

	@NotBlank
	@ApiModelProperty(value = "供应商名称，个人为法人姓名，企业为商户签约名", required = true)
	private String supplierName;

	/**
	 * 可选项如下:
	 * PERSON:个人
	 * BUSINESS:企业
	 */
	@NotBlank
	@ApiModelProperty(value = "供应商类型；企业：收款供应商为对公账户请选择企业 个人：收款供应商为个人银行卡请选择个人", required = true)
	private YeepayApiConstant.supplierType supplierType;

}

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@ApiModel("供应商资质信息")
class SupplierQualInfo {

	@NotBlank
	@ApiModelProperty(value = "资质编码;供应商类型=个人时必填（供应商类型=个人时请填身份证号码；供应商类型=企业时请填营业执照号码）", required = true)
	private String supplierQualLicenceNo;

	/**
	 * 资质照片地址 供应商类型=个人时必填（供应商类型=个人时请填上传身份证照片；供应商类型=企业时请上传营业执照）
	 */
	@NotBlank
	@ApiModelProperty(value = "资质照片储存url;上传到易宝返回的资质存储地址", required = true)
	private String supplierQualLicenceUrl;

	@NotBlank
	@ApiModelProperty(value = "资质文件地址  请上传付款商户与收款供应商授权协议", required = true)
	private String supplierQualFileUrl;
}
