package com.liquidnet.service.adam.dto;

import com.liquidnet.commons.lang.constant.LnsRegex;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

@ApiModel(value = "AdamMemberOrderParam", description = "购买会员入参")
@Data
public class AdamMemberOrderParam implements Serializable {
    private static final long serialVersionUID = -2605176979349053352L;
    @ApiModelProperty(position = 10, required = true, value = "会员类型ID[50]", example = "1")
    @NotBlank(message = "会员类型ID不能为空")
    private String memberId;
    @ApiModelProperty(position = 11, required = true, value = "会员价格ID", example = "1")
    @NotBlank(message = "会员价格ID不能为空")
    private String memberPriceId;
    @ApiModelProperty(position = 12, required = true, value = "类型:0-购买会员,1-购买会员码", allowableValues = "0,1")
    @Min(value = 0, message = "类型无效")
    @Max(value = 1, message = "类型无效")
    private Integer mode;
    @ApiModelProperty(position = 13, required = true, value = "应付金额", example = "0.01")
    @DecimalMin(value = "0.01", message = "应付金额有误")
    private BigDecimal price;
    @ApiModelProperty(position = 14, required = true, value = "实付金额", example = "0.01")
    @DecimalMin(value = "0.01", message = "实付金额有误")
    private BigDecimal pricePaid;
    @ApiModelProperty(position = 15, required = true, value = "用户生日", example = "2021-05-27")
    @Pattern(regexp = LnsRegex.Valid.DATETIME_YMD, message = "生日格式有误")
    @NotBlank(message = "生日不能为空")
    private String birthday;
    @ApiModelProperty(position = 16, required = true, value = "常住地/区域[100]", example = "北京 北京市 朝阳区")
    @NotBlank(message = "常住地不能为空")
    private String area;
    @ApiModelProperty(position = 16, required = true, value = "收获地址")
    @Size(min = 1, max = 64, message = "收获地址长度限制1-64位字符")
    @NotBlank(message = "收获地址不能为空")
    private String addressId;
    @ApiModelProperty(position = 17, required = true, value = "支付终端", allowableValues = "app,wap,js,applet")
    @Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_PAY_TERMINAL, message = "支付终端类型无效")
    @NotBlank(message = "支付终端不能为空")
    private String deviceFrom;
    @ApiModelProperty(position = 20, required = true, value = "支付方式", allowableValues = "alipay,wepay")
    @Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_PAY, message = "支付方式无效")
    @NotBlank(message = "支付方式不能为空")
    private String payType;
    @ApiModelProperty(position = 21, required = false, value = "App内Apple支付必传")
    private String productId;
    @ApiModelProperty(position = 22, required = false, value = "微信内网页及小程序支付必传")
    private String openId;
    @ApiModelProperty(position = 23, required = false, value = "取消支付，点击取消支付宝回调地址")
    private String showUrl;
    @ApiModelProperty(position = 24, required = false, value = "支付成功，点击完成支付宝回调地址")
    private String returnUrl;
    @ApiModelProperty(position = 30, required = false, value = "姓名[未实名时必传]", example = "王武")
    private String name;
    @ApiModelProperty(position = 31, required = false, value = "身份证件号[未实名时必传]", example = "111111111111111111")
    private String idCard;
}
