import { AdminTypeEnum, AuthTypeEnum, StatusEnum, YesNoEnum } from 'nsn-enum';
import { NEntity, Tree } from '../core';
import { Member } from './Member';
import { Resource } from './Resource';
import { Role } from './Role';

/** 系统-用户 */
export interface User extends NEntity {

  /** 登录账号 */
  account: string;

  /** 密码 */
  password: string;

  /** 会员 */
  memberId: string;

  /** 用户类型(字典类别dict_user_type) */
  userType: string;

  /** 管理员类型 */
  mgrType: AdminTypeEnum;

  /** 权重 */
  weight: number;

  /** 同意协议 */
  agreemented: YesNoEnum;

  /** 首次登录时间 yyyy-MM-dd HH:mm:SS */
  firstVisitDate: Date;

  /** 最后登录时间 yyyy-MM-dd HH:mm:SS */
  lastVisitDate: Date;

  /** 最后登录IP */
  lastVisitIp: string;

  /** 允许访问开始时间 yyyy-MM-dd HH:mm:SS */
  allowStartTime: Date;

  /** 允许访问结束时间 yyyy-MM-dd HH:mm:SS */
  allowEndTime: Date;

  /** 状态 */
  status: StatusEnum;

  /** 首页报表资源ID */
  welcomeReportId: string;

  /** dto 当前用户所属角色 */
  role: Role;

  /** dto 用户拥有的所有角色 */
  roleList: Array<Role>;

  /** dto 会员的标签 */
  tagList: Array<Tags>;

  /** dto 当前用户拥有的所有资源 */
  resourceList: Array<Resource>;

  /** dto 新密码 */
  newPassword: string;

  /** dto 确认密码 */
  rePassword: string;

  /** dto 验证码 */
  captcha: string;

  /** dto 验证方式 */
  authType: AuthTypeEnum;

  /** dto 部门主键集合 */
  deptIdList: Array<string>;

  /** dto 会员信息 */
  member: Member;

  /** dto 通知条数 */
  notifyCount: number;

  /** dto 未读消息 */
  unreadCount: number;

  /** dto 菜单树 */
  menus: Array<Tree>;

  /** dto 菜单 与 操作 的映射 */
  resmap: Map<string, Array<string>>;

  /** dto 是否超级管理员 */
  isAdminSuper: boolean;

  /** dto 多角色模式 */
  multiRoleMode: boolean;

  /** dto 多租户模式 */
  multiTenantMode: boolean;

  /** dto socket连接地址 */
  socketConnect: string;
}