package org.enfi.modules.visitor.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.*;

/**
 * <p>
 * (申请)邀请记录表
 * </p>
 *
 * @author WANG HAO
 * @since 2021-11-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("visitor_invited_to_record")
@ApiModel(value = "InvitedToRecord对象", description = "(申请)邀请来访记录表")
public class InvitedToRecord extends Model<InvitedToRecord> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "(申请)邀请人id")
    @TableField("inviter_id")
    private String inviterId;

    @ApiModelProperty(value = "(申请)邀请人姓名")
    @TableField("inviter_name")
    private String inviterName;

    @ApiModelProperty(value = "(申请)邀请人邮箱")
    @TableField("inviter_email")
    //@Pattern(regexp = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", message = "(申请)邀请人邮箱格式不正确")
    private String inviterEmail;

    @ApiModelProperty(value = "(申请)邀请人部门id")
    @TableField("inviter_dept_id")
    private String inviterDeptId;

    @ApiModelProperty(value = "(申请)邀请人部门名称")
    @TableField("inviter_dept_name")
    private String inviterDeptName;

    @ApiModelProperty(value = "来访原因")
    @TableField("visit_the_reason")
    @NotBlank(message = "来访原因不能为空")
    private String visitTheReason;

    @ApiModelProperty(value = "接待地点")
    @TableField("reception_site")
    @NotBlank(message = "接待地点不能为空")
    private String receptionSite;

    @ApiModelProperty(value = "(来访)接待人数")
    @TableField("number_of_reception")
    @NotNull(message = "(来访)接待人数不能为空")
    @Min(value = 1, message = "(来访)接待人数不能小于1人")
    private Integer numberOfReception;

    @ApiModelProperty(value = "到来时间(来访访人到来时间)")
    @TableField("begin_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @NotNull(message = "到来时间不能为空")
    private Date beginTime;

    @ApiModelProperty(value = "离开时间(来访人离开时间)")
    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @NotNull(message = "离开时间不能为空")
    private Date endTime;

    @ApiModelProperty(value = "来访部门")
    @TableField("visit_dept_name")
    @NotBlank(message = "来访部门不能为空")
    private String visitDeptName;

    @ApiModelProperty(value = "邀请码")
    @TableField(exist = false)
    private String yaoQiCode;

    @ApiModelProperty(value = "创建人")
    @TableField("create_by")
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField("update_by")
    private String updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private Date updateTime;

    @Override
    public Serializable pkVal() {
        return this.id;
    }


}
