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 org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@ApiModel("企业账户支付-下单入参")
public class EnterpriseAccountPayOrderDto {

	@NotBlank
	@ApiModelProperty(value = "业务发起方商户编号（标准商户收付款方案中此参数与商编一致，平台商户收付款方案中此参数为平台商商户编号）", required = true)
	private String parentMerchantNo;

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

	@NotBlank
	@ApiModelProperty(value = "付款方商户编号", required = true)
	private String payerMerchantNo;

	@NotBlank
	@ApiModelProperty(value = "订单信息", required = true)
	private OrderInfo orderInfo;
}

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@ApiModel("订单信息")
class OrderInfo {

	@NotBlank
	@ApiModelProperty(value = "商户请求号，需要保持在商户下唯一", required = true)
	private String orderId;

	@NotBlank
	@ApiModelProperty(value = "订单金额", required = true)
	private String orderAmount;

	/**
	 * 分账标识,默认不分账
	 * 可选项如下:
	 * DELAY_SETTLE:分账
	 * REAL_TIME:不分账
	 */
	@ApiModelProperty(value = "分账标识")
	private YeepayApiConstant.fundProcessType fundProcessType;

	@NotBlank
	@ApiModelProperty(value = "商品名称", required = true)
	private String goodsName;

	@ApiModelProperty(value = "订单有效期-截止时间 格式yyyy-MM-DD HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-DD HH:mm:ss")
	private String expiredTime;

	@ApiModelProperty(value = "回调通知地址")
	private String notifyUrl;

	@ApiModelProperty(value = "自定义对账备注")
	private String memo;
}
