package cn.quant.baa.pay.model.web;

import cn.quant.baa.pay.acquirer.ChannelRequest;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Arrays;

/**
 * Created by Administrator on 2021/8/24 0024.
 */
public class PayRequestData implements ChannelRequest, Serializable{

    private static final long serialVersionUID = -8274612481658761761L;

    /**
     * 订单标题
     */
    @Size(max = 128, message = "ILLEGAL_REQ_SUBJECT")
    private String subject;

//    /**
//     * 商户ID
//     */
//    @NotNull(message = "ILLEGAL_REQ_MCH_ID")
//    private String mchId;

    private String chanId;

    private String requestIp;

    /**
     * 商户订单号
     */
    @Size(min = 6, max = 64, message = "ILLEGAL_REQ_OUT_TRADE_NO")
    @NotNull(message = "ILLEGAL_REQ_OUT_TRADE_NO")
    private String outTradeNo;

    /**
     * 原订单金额
     */
    @NotNull(message = "ILLEGAL_REQ_ORIG_AMT")
    private String originalAmount;

    /**
     *实际订单金额
     */
    @NotNull(message = "ILLEGAL_REQ_AMT")
    private String amount;

    /**
     * 优惠金额
     */
    @NotNull(message = "ILLEGAL_REQ_DISC_AMT")
    private String discounts;

    /**
     * 现金金额
     */
    @NotNull(message = "ILLEGAL_REQ_CASH_AMT")
    private String cashAmount;

    /**
     * 用信金额
     */
    @NotEmpty(message = "ILLEGAL_REQ_CREDIT_AMT")
    @NotNull(message = "ILLEGAL_REQ_CREDIT_AMT")
    private String creditAmount;

    /**
     *买家ID
     */
    @Size(min = 6, max = 32, message ="ILLEGAL_REQ_BUYER_ID" )
    @NotNull(message = "ILLEGAL_REQ_BUYER_ID")
    private String buyerId;

    @Size(min = 6, max = 128, message ="ILLEGAL_REQ_ACCT_NO" )
    @NotNull(message = "ILLEGAL_REQ_ACCT_NO")
    private String accountNo;

    /**
     * 通知地址
     */
    private String notifyUrl;

    /**
     * 附加信息
     */
    private String attach;

    /**
     * 店铺名
     */
    private String shopName;

    /**
     * 收货人名称
     */
    private String goodsSigner;

    /**
     * 联系电话
     */
    private String phoneNo;

    /**
     * 地址
     */
    private String address;

    /**
     * 商品列表
     */
    private GoodsDetail[] goodsDetail;

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

//    public String getMchId() {
//        return mchId;
//    }
//
//    public void setMchId(String mchId) {
//        this.mchId = mchId;
//    }

    public String getChanId() {
        return chanId;
    }

    public void setChanId(String chanId) {
        this.chanId = chanId;
    }

    public String getRequestIp() {
        return requestIp;
    }

    public void setRequestIp(String requestIp) {
        this.requestIp = requestIp;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getOriginalAmount() {
        return originalAmount;
    }

    public void setOriginalAmount(String originalAmount) {
        this.originalAmount = originalAmount;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getDiscounts() {
        return discounts;
    }

    public void setDiscounts(String discounts) {
        this.discounts = discounts;
    }

    public String getCashAmount() {
        return cashAmount;
    }

    public void setCashAmount(String cashAmount) {
        this.cashAmount = cashAmount;
    }

    public String getCreditAmount() {
        return creditAmount;
    }

    public void setCreditAmount(String creditAmount) {
        this.creditAmount = creditAmount;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getBuyerId() {
        return buyerId;
    }

    public void setBuyerId(String buyerId) {
        this.buyerId = buyerId;
    }

    public String getAccountNo() {
        return accountNo;
    }

    public void setAccountNo(String accountNo) {
        this.accountNo = accountNo;
    }

    public String getAttach() {
        return attach;
    }

    public void setAttach(String attach) {
        this.attach = attach;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getGoodsSigner() {
        return goodsSigner;
    }

    public void setGoodsSigner(String goodsSigner) {
        this.goodsSigner = goodsSigner;
    }

    public String getPhoneNo() {
        return phoneNo;
    }

    public void setPhoneNo(String phoneNo) {
        this.phoneNo = phoneNo;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public GoodsDetail[] getGoodsDetail() {
        return goodsDetail;
    }

    public void setGoodsDetail(GoodsDetail[] goodsDetail) {
        this.goodsDetail = goodsDetail;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("PayRequestData{");
        sb.append("subject='").append(subject).append('\'');
        sb.append(", chanId='").append(chanId).append('\'');
        sb.append(", requestIp='").append(requestIp).append('\'');
        sb.append(", outTradeNo='").append(outTradeNo).append('\'');
        sb.append(", originalAmount='").append(originalAmount).append('\'');
        sb.append(", amount='").append(amount).append('\'');
        sb.append(", discounts='").append(discounts).append('\'');
        sb.append(", cashAmount='").append(cashAmount).append('\'');
        sb.append(", creditAmount='").append(creditAmount).append('\'');
        sb.append(", buyerId='").append(buyerId).append('\'');
        sb.append(", accountNo='").append(accountNo).append('\'');
        sb.append(", notifyUrl='").append(notifyUrl).append('\'');
        sb.append(", attach='").append(attach).append('\'');
        sb.append(", shopName='").append(shopName).append('\'');
        sb.append(", goodsSigner='").append(goodsSigner).append('\'');
        sb.append(", phoneNo='").append(phoneNo).append('\'');
        sb.append(", address='").append(address).append('\'');
        sb.append(", goodsDetail=").append(goodsDetail == null ? "null" : Arrays.asList(goodsDetail).toString());
        sb.append('}');
        return sb.toString();
    }
}
