package com.yonge.cooleshow.biz.dal.wrapper;


import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.microsvc.toolkit.common.response.paging.QueryInfo;
import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
import com.yonge.cooleshow.common.enums.EPayerType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.File;
import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;

/**
 * @Author：haonan
 * @Date：2023/8/10 13:45
 * @Filename：TenantMemberWrapper
 */

/**
 * 机构子账户表
 * 2023-08-10 13:36:39
 */
@ApiModel(value = "TenantMemberWrapper对象", description = "机构子账户表查询对象")
public class TenantMemberWrapper {

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" TenantMemberQuery-机构子账户表")
    public static class TenantMemberQuery implements QueryInfo {

        @ApiModelProperty("当前页")
        private Integer page;

        @ApiModelProperty("分页行数")
        private Integer rows;

        @ApiModelProperty("商户号")
        private String memberId;

        @ApiModelProperty("公司名称")
        private String name;

        @ApiModelProperty("类型")
        private EPayerType payerType;

        @ApiModelProperty("状态")
        private AuthStatusEnum status;


        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static TenantMemberQuery from(String json) {
            return JSON.parseObject(json, TenantMemberQuery.class);
        }
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" TenantMember-机构子账户表")
    public static class TenantMember {

        private Long id;

        @ApiModelProperty("支付渠道 ADAPAY,YEEPAY")
        private String payerName;

        @ApiModelProperty("商户ID")
        private String appId;

        @ApiModelProperty("请求id")
        private String requestNo;

        @ApiModelProperty("机构ID")
        private Long tenantId;

        @ApiModelProperty("公司名称")
        private String name;

        @ApiModelProperty("商户号")
        private String memberId;

        @ApiModelProperty("商家类型（企业-ENTERPRISE，个体户-INDIVIDUAL）")
        private String merchantType;

        @ApiModelProperty("省份编号")
        private String provCode;

        @ApiModelProperty("省份名称")
        private String provName;

        @ApiModelProperty("城市编号")
        private String areaCode;

        @ApiModelProperty("城市名称")
        private String areaName;

        @ApiModelProperty("区编号")
        private String districtCode;

        @ApiModelProperty("区名称")
        private String districtName;

        @ApiModelProperty("公司地址")
        private String address;

        @ApiModelProperty("统一社会信用码")
        private String socialCreditCode;

        @ApiModelProperty("统一社会信用码有效期")
        private String socialCreditCodeExpires;

        @ApiModelProperty("经营范围")
        private String businessScope;

        @ApiModelProperty("法人")
        private String legalPerson;


        @ApiModelProperty("证照文件")
        private String multipartFile;


        @ApiModelProperty("法人证件人像面照片 请上传带有人像面的法人证件照片")
        private String legalLicenceFrontUrl;

        @ApiModelProperty("法人证件非人像面照片")
        private String legalLicenceBackUrl;

        @ApiModelProperty("法人证件类型")
        private String legalLicenceType;

        @ApiModelProperty("商户证件照片")
        private String licenceUrl;

        @ApiModelProperty("开户许可证照片")
        private String openAccountLicenceUrl;

        @ApiModelProperty("法人身份证号")
        private String legalCertId;

        @ApiModelProperty("身份证有效期")
        private String legalCertIdExpires;

        @ApiModelProperty("法人手机号")
        private String legalMp;

        @ApiModelProperty("邮编")
        private String zipCode;

        @ApiModelProperty("企业银行卡号")
        private String cardNo;

        @ApiModelProperty("银行编码")
        private String bankCode;

        @ApiModelProperty("结算账户id")
        private String settleAccountId;

        @ApiModelProperty("备注")
        private String memo;

        @ApiModelProperty("状态 DOING 审核中 PASS 审核通过 UNPASS 审核拒绝")
        private AuthStatusEnum status;

        @ApiModelProperty("每月最大收款金额,0不限制")
        private BigDecimal monthMaxReceipt;

        @ApiModelProperty("银行账户类型：1-对公；2-对私，如果需要自动开结算账户，本字段必填")
        private String bankAcctType;

        @ApiModelProperty("银行卡对应的户名，如果需要自动开结算账户，本字段必填；若银行账户类型是对公，必须与企业名称一致")
        private String cardName;

        @ApiModelProperty("联系人邮箱")
        private String contactEmail;

        @ApiModelProperty("联系人证件号码")
        private String contactLicenceNo;

        @ApiModelProperty("联系人姓名")
        private String contactName;

        @ApiModelProperty("联系人手机号码")
        private String contactMobile;

        @ApiModelProperty("创建时间")
        private Date createTime;

        @ApiModelProperty("更新时间")
        private Date updateTime;


        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static TenantMember from(String json) {
            return JSON.parseObject(json, TenantMember.class);
        }
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" TenantMember-机构子账户表新增/修改数据")
    public static class InsertOrUpdateTenantMember {
        private Long id;

        @ApiModelProperty("机构ID")
        @NotNull(message = "机构ID不能为空")
        private Long tenantId;



        @ApiModelProperty("支付类型 ADAPAY,YEEPAY")
        private EPayerType payerType;

        @NotNull(message = "支付渠道不能为空")
        @ApiModelProperty("支付渠道 ADAPAY,YEEPAY")
        private String payerName;

        @ApiModelProperty("请求id")
        private String requestNo;

        @ApiModelProperty("商户号")
//        @NotNull(message = "商户号不能为空")
        private String memberId;

        @ApiModelProperty("公司名称")
        @NotNull(message = "公司名称不能为空")
        private String name;

        @ApiModelProperty("统一社会信用码")
        private String socialCreditCode;

        @ApiModelProperty("统一社会信用码有效期")
        private String socialCreditCodeExpires;

        @ApiModelProperty("法人")
        private String legalPerson;

        @ApiModelProperty("证照文件")
        private MultipartFile multipartFile;

        @ApiModelProperty(hidden = true)
        private File file;

        @ApiModelProperty("法人手机号")
        private String legalMp;

        @ApiModelProperty("法人身份证号")
        private String legalCertId;

        @ApiModelProperty("身份证有效期")
        private String legalCertIdExpires;

        @ApiModelProperty("经营范围")
        private String businessScope;

        @ApiModelProperty("公司地址")
        private String address;

        @ApiModelProperty("法人证件类型")
        private String legalLicenceType;

        @ApiModelProperty("邮编")
        private String zipCode;

        @ApiModelProperty("企业银行卡号")
        private String cardNo;

        @ApiModelProperty("银行编码")
        private String bankCode;

        @ApiModelProperty("银行账户类型：1-对公；2-对私，如果需要自动开结算账户，本字段必填")
        private String bankAcctType;

        @ApiModelProperty("银行卡对应的户名，如果需要自动开结算账户，本字段必填；若银行账户类型是对公，必须与企业名称一致")
        private String cardName;

        @ApiModelProperty("省份编号")
        private String provCode;

        @ApiModelProperty("省份名称")
        private String provName;

        @ApiModelProperty("城市编号")
        private String areaCode;

        @ApiModelProperty("城市名称")
        private String areaName;

        @ApiModelProperty("区编号")
        private String districtCode;

        @ApiModelProperty("商家类型（企业-ENTERPRISE，个体户-INDIVIDUAL）")
        private String merchantType;

        @ApiModelProperty("商户证件照片")
        private String licenceUrl;

        @ApiModelProperty("开户许可证照片")
        private String openAccountLicenceUrl;


        @ApiModelProperty("法人证件人像面照片 请上传带有人像面的法人证件照片")
        private String legalLicenceFrontUrl;

        @ApiModelProperty("法人证件非人像面照片")
        private String legalLicenceBackUrl;

        @ApiModelProperty("联系人姓名")
        private String contactName;

        @ApiModelProperty("联系人证件号码")
        private String contactLicenceNo;


        @ApiModelProperty("联系人手机号码")
        private String contactMobile;

        @ApiModelProperty("联系人邮箱")
        private String contactEmail;


        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static InsertOrUpdateTenantMember from(String json) {
            return JSON.parseObject(json, InsertOrUpdateTenantMember.class);
        }
    }



    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" TenantMember-机构子账户表修改银行信息")
    public static class UpdateCount {
        private Long id;

        @ApiModelProperty("企业银行卡号")
        private String cardNo;

        @ApiModelProperty("银行编码")
        private String bankCode;


        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static TenantMember from(String json) {
            return JSON.parseObject(json, TenantMember.class);
        }
    }

}