package com.cool.store.request;

import com.cool.store.entity.PlatformBuildDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author: WangShuo
 * @Date: 2024/10/09/下午9:27
 * @Version 1.0
 * @注释:
 */
@Data
public class PlatformBuildRequest {

    @NotNull
    private Long shopId;

    @NotNull
    @ApiModelProperty(value = "'1-抖音，2-快手，3-美团团购，4-饿了么，5-美团外卖',")
    private Integer type;

    @NotBlank
    @Length(max = 250 , message = "结算人身份证正面 长度不能超过250")
    @ApiModelProperty("结算人身份证正面（图片）")
    private String settlerIdCardFront;

    @NotBlank
    @Length(max = 250 , message = "结算人身份证反面 长度不能超过250")
    @ApiModelProperty("结算人身份证反面（图片）")
    private String settlerIdCardReverse;

    @NotBlank
    @Length(max = 64 , message = "结算人身份证号 长度不能超过64")
    @ApiModelProperty("结算人身份证号")
    private String settlerIdCardNo;

    @NotBlank
    @Length(max = 250, message = "结算人银行卡照片 长度不能超过250")
    @ApiModelProperty("结算人银行卡照片")
    private String settlerBankPhotoUrl;

    @NotBlank
    @Length(max = 64 , message = "结算人银行卡号 长度不能超过64")
    @ApiModelProperty("结算人银行卡号")
    private String settlerBankNumber;

    @NotBlank
    @Length(min = 11,max = 11 , message = "结算人银行卡预留手机号 长度必须为11")
    @ApiModelProperty("结算人银行卡预留手机号")
    private String settlerBankMobile;

    @NotBlank
    @Length(max =100, message = "结算开户银行支行 长度不能超过100")
    @ApiModelProperty("结算开户银行支行")
    private String settlerBankName;

    @Length(max =1020, message = "门店定位截图 长度不能超过1020")
    @ApiModelProperty("门店定位截图（快手&抖音）")
    private String storePositioningUrl;

    @Length(max =1020, message = "授权书 长度不能超过1020")
    @ApiModelProperty("授权书(抖音&快手非法人结算需要)")
    private String authorizationUrl;

    @Length(max =250, message = "平台账号 长度不能超过250")
    @ApiModelProperty("平台账号(快手，需要)")
    private String account;



    public PlatformBuildDO toDO(){
        PlatformBuildDO platformBuildDO = new PlatformBuildDO();
        platformBuildDO.setShopId(this.shopId);
        platformBuildDO.setType(this.type);
        platformBuildDO.setSettlerIdCardFront(this.settlerIdCardFront);
        platformBuildDO.setSettlerIdCardReverse(this.settlerIdCardReverse);
        platformBuildDO.setSettlerIdCardNo(this.settlerIdCardNo);
        platformBuildDO.setSettlerBankPhotoUrl(this.settlerBankPhotoUrl);
        platformBuildDO.setSettlerBankNumber(this.settlerBankNumber);
        platformBuildDO.setSettlerBankMobile(this.settlerBankMobile);
        platformBuildDO.setSettlerBankName(this.settlerBankName);
        platformBuildDO.setStorePositioningUrl(this.storePositioningUrl);
        platformBuildDO.setAuthorizationUrl(this.authorizationUrl);
        platformBuildDO.setAccount(this.account);
        return platformBuildDO;

    }
}
