package com.crm.rely.backend.core.entity.user.info;

import com.crm.rely.backend.core.constant.Constants;
import com.crm.rely.backend.core.constant.ManagerConstant;
import com.crm.rely.backend.core.constant.RegexpConstants;
import com.crm.rely.backend.core.entity.base.BaseUpdateEntity;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
import java.util.List;

/**
 * @program: crm-backend
 * @description:
 * @author: houn
 * @create: 2019-07-30 17:01
 */
@Data
public class UserInfoUpdateEntity extends BaseUpdateEntity {

    @NotNull(message = Constants.NAME_NOT_NULL)
    @NotBlank(message = Constants.NAME_NOT_NULL)
    private String name;

    @NotNull(message = Constants.USERNAME_NOT_NULL_ERROR)
    @NotBlank(message = Constants.USERNAME_NOT_NULL_ERROR)
    private String username;

    private String password;

    @Pattern(regexp = RegexpConstants.REGEXP_EMAIL, message = Constants.EMAIL_FORMAT_ERROR)
    @NotNull(message = Constants.EMAIL_NOT_NULL_ERROR)
    @NotBlank(message = Constants.EMAIL_NOT_NULL_ERROR)
    private String email;

    @NotNull(message = ManagerConstant.ROLE_NOT_NULL_ERROR)
    private Long roleId;

    private Long pid;

    private Long groupId;

    private Long agentLevel;

    private String ibNo;
    private String ibNoTemp;

    private Integer valid;

    private Integer hide;

    private Integer commissionApproval;

    /**
     * 是否ip限制 0否 1是
     */
    private Integer ipLimit;
    /**
     * 限制ip 如果不为空和null 则只有这个ip才能登录
     */
    private String limitIp;

    private Long areaId;
    /**
     * 销售类型
     * 1:普通销售
     * 2：销售经理
     */
    private Integer salesType;
    /**
     * 团队长ID
     */
    private Long leaderId;
    /**
     * 销售绩效规则ID
     */
    private Long salesCommissionRuleId;
    /**
     * 工资账户
     */
    private Long salaryLogin;
    /**
     * 工资账户平台
     */
    private String salaryPlatform;
    /**
     * 入职时间
     */
    private Date entryDate;
    /**
     * 国家
     */
    private String country;
    /**
     * 在职类型
     * 1. 试用期
     * 2. 正式员工
     */
    private Integer entryStatus;
    /**
     * 关联账号ID
     */
    private Long attachId;

    private List<Long> attachIds;

    private Date resignDate;

}
