import { Role } from '@/service/moudles/service.dto'

export enum PostMsg {
  GET_AUTH = 'getAuth',
  RELOAD = 'reload',
  GET_PUB_KEY = 'getPubKey',
  GET_SIGN = 'getSign',
  GET_USER_INFO = 'getUserInfo',
  FOCUS_USER = 'focusUser', // 点击成员
  GET_OA_SERVER= 'getOaServer', // oaServer
  GET_PHONE = 'getPhone'
}

// 员工信息
export interface Staff {
  "email": string,
  "entId": string,
  "joinTime": number,
  "phone": string,
  "leaderId": string,
  "name": string,
  "position": string,
  "role": Role,
  "depId": string,
  "depName": string,
  "entName": string,
  "id": string,
  "workplace": string,
  "isActivated": boolean
}

// 通讯录
export interface Contacts {
  [key: string]: Array<Staff>
}

// 部门
export interface Department {
  entId: string,
  id: string,
  leaderId: string,
  leaderName?: string,
  name: string,
  parentId: string,
  hasSubDep: boolean,
  staffNum: number,
  children?: Array<Department>
}

export interface LocalStoreEnt {
  avatar:string
  description:string
  id: string
  imServer: string
  name: string
  nodeServer: string
  oaServer: string
  rootDepId:string
}

export interface LocalStoreUsr {
  entId: string,
  depId: string,
  id: string,
  joinTime: number,
  name: string,
  phone: string,
  position: string,
  role: number,
  company?: {
    avator: string,
    description: string,
    id: string,
    imServer: string,
    name: string,
    nodeServer: string,
    oaServer: string,
    rootDepId: string
  }
}

export enum ApplyStatus {
  PENDING = 0,
  REJECT = 1,
  AGREE = 2
}

export enum ApplyType {
  JOIN = 0,
  QUIT = 1
}

export interface ApplyItem {
  applyId: string,
  createTime: number,
  details: object | null,
  reason: string,
  status: ApplyStatus,
  types: ApplyType
}