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

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 RefundFastDto {

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

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

	@NotBlank
	@ApiModelProperty(value = "退款金额", required = true)
	private String refundAmount;

	@NotBlank
	@ApiModelProperty(value = "退款原因", required = true)
	private String description;

	/**
	 * 不传则默认使用未结算资金退款,如未结算资金不足则使用支付账户余额退款
	 */
	@ApiModelProperty(value = "退款资金来源")
	private YeepayApiConstant.refundAccountType refundAccountType;

	@NotBlank
	@ApiModelProperty(value = "接收退款结果地址", required = true)
	private String notifyUrl;

	@ApiModelProperty(value = "对账备注")
	private String memo;

	@NotBlank
	@ApiModelProperty(value = "上送卡信息", required = true)
	private CardInfo cardInfo;

	@NotBlank
	@ApiModelProperty(value = "发起方商户编号。与交易下单传入的保持一致", required = true)
	private String parentMerchantNo;

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

}

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@ApiModel("上送卡信息")
class CardInfo {

	@NotBlank
	@ApiModelProperty(value = "上送持卡人卡号", required = true)
	private String remitBankCardNo;

	@NotBlank
	@ApiModelProperty(value = "上送持卡人姓名", required = true)
	private String remitCardName;

	@NotBlank
	@ApiModelProperty(value = "上送卡类型", required = true)
	private String remitCardType;
}
