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.entity.VideoLessonGroupLog;
import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.Optional;

import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotNull;

/**
 * 机构入驻申请记录
 * 2023-07-21 17:32:49
 */
@ApiModel(value = "TenantApplyRecordWrapper对象", description = "机构入驻申请记录查询对象")
public class TenantApplyRecordWrapper {

    @Data
	@Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" TenantApplyRecordQuery-机构入驻申请记录")
    public static class TenantApplyRecordQuery implements QueryInfo {
        @ApiModelProperty("id")
        private Long Id;
    
    	@ApiModelProperty("当前页")
        private Integer page;
        
        @ApiModelProperty("分页行数")
        private Integer rows;
        
        @ApiModelProperty("关键字匹配")
		private String keyword;

        @ApiModelProperty("省份编码")
        private Integer provinceCode;

        @ApiModelProperty("城市编码")
        private Integer cityCode;

        @ApiModelProperty("地区街道编码")
        private Integer regionCode;
        
        public String getKeyword() {
            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
        }
        
        public String jsonString() {
            return JSON.toJSONString(this);
        }

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

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
	@ApiModel(" TenantApplyRecord-机构入驻申请记录")
    public static class TenantApplyRecord {
        @ApiModelProperty("id")
        private Long id;

        @ApiModelProperty("机构申请记录id")
        private Long tenantApplyRecordId;

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

        @ApiModelProperty("logo")
        private String logo;

        @ApiModelProperty("省份编码")
        private Integer provinceCode;

        @ApiModelProperty("城市编码")
        private Integer cityCode;

        @ApiModelProperty("地区/街道")
        private Integer regionCode;

        @ApiModelProperty("联系人")
        private String username;

        @ApiModelProperty("手机号")
        @NotNull(message = "手机号不能为空")
        private String phone;

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

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

        @ApiModelProperty("地区街道名称")
        private String regionName;

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

        @ApiModelProperty("审核理由")
        private String reason;

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

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

        @ApiModelProperty("简介")
        private String briefIntroduction;

        @ApiModelProperty("上一次的修改记录")
        private LastRecord lastApplyRecord;

        @ApiModelProperty("认证人Id")
        private Long verifyUserId;

        @ApiModelProperty("认证人姓名")
        private String verifyUserName;

        @ApiModelProperty("验证码")
        @NotNull(message = "验证码不能为空")
        private String code;

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

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

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" TenantApply-上一次的修改记录")
    public static class LastRecord {
        @ApiModelProperty("id")
        private Long id;

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

        @ApiModelProperty("logo")
        private String logo;

        @ApiModelProperty("省份编码")
        private Integer provinceCode;

        @ApiModelProperty("城市编码")
        private Integer cityCode;

        @ApiModelProperty("地区/街道")
        private Integer regionCode;

        @ApiModelProperty("联系人")
        private String username;

        @ApiModelProperty("手机号")
        @NotNull(message = "手机号不能为空")
        private String phone;

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

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

        @ApiModelProperty("地区街道名称")
        private String regionName;

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

        @ApiModelProperty("审核理由")
        private String reason;

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

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

        @ApiModelProperty("简介")
        private String briefIntroduction;

        @ApiModelProperty("审核人Id")
        private Long verifyUserId;

        @ApiModelProperty("审核表申请Id")
        private Long tenantApplyRecordId;


    }




    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" TenantApply-机构历史审核记录")
    public static class TenantApply {
        @ApiModelProperty("id")
        private Long id;

        @ApiModelProperty("机构申请记录id")
        private Long tenantApplyRecordId;

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

        @ApiModelProperty("logo")
        private String logo;

        @ApiModelProperty("省份编码")
        private Integer provinceCode;

        @ApiModelProperty("城市编码")
        private Integer cityCode;

        @ApiModelProperty("地区/街道")
        private Integer regionCode;

        @ApiModelProperty("联系人")
        private String username;

        @ApiModelProperty("手机号")
        @NotNull(message = "手机号不能为空")
        private String phone;

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

        @ApiModelProperty("认证人Id")
        private Long verifyUserId;

        @ApiModelProperty("审核理由")
        private String reason;

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

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

        @ApiModelProperty("地区街道名称")
        private String regionName;

        @ApiModelProperty("验证码")
        @NotNull(message = "验证码不能为空")
        private String code;

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

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

        @ApiModelProperty("认证人姓名")
        private String verifyUserName;

        @ApiModelProperty("群简介")
        private String briefIntroduction;

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

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


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel("机构审核")
    public static class TenantEntry {
        @ApiModelProperty("审核理由")
        @NotNull
        private String reason;

        @ApiModelProperty("是否通过")
        private Boolean IfPass;

        @ApiModelProperty("id")
        private Long id;
    }



}