package com.cwhelp.admin.business.validator;

import com.cwhelp.modules.business.domain.BssDept;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author yan.y
 * @date 2019/07/31
 */
@Data
public class BssEmployeeValid implements Serializable {
    @NotEmpty(message = "名称不能为空")
    private String name;
    @NotNull(message = "部门不能为空")
    private BssDept bssDept;
    @NotEmpty(message = "职位不能为空")
    private String position;
    @NotEmpty(message = "手机号码不能为空")
    @Pattern(regexp = "^((17[0-9])|(14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$", message = "手机号码格式不正确")
    private String phoneNum;
    @NotEmpty(message = "身份证号码不能为空")
    @Pattern(regexp = "(^(\\d{14}|\\d{17})(\\d|[xX])$)?", message = "身份证号码错误")
    private String card;
    @NotEmpty(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;
    @NotEmpty(message = "学历不能为空")
    private String education;
}