import { ApplyType, ApplyStatus } from '@/Interface'

export enum Role {
  LEADER = 0,
  SUPER_ADMIN = 1,
  CUSTOMER_ADMIN = 2,
  COMMON_MEMBER = 3,
  CHILD_ADMIN = 4,
}

export enum Apply {
  PENDING = 0,
  REJECT = 1,
  PASS = 2
}
// 企业
export interface AcceptJoinDTO{
  "expiration": number,
  "inviterId": string,
  "name": string,
  "oaServer": string,
  "depId": string,
  "entId": string,
  "hash": string,
  "joinTime": number,
  "phone": string,
  "position": string,
  "shortPhone"?: string,
  "email"?: string
}

export interface CreateEnterpriseDTO {
  leaderName: string,
  name: string,
  nodeServer: string,
  oaServer: string,
  imServer: string
}

export interface DeleteEnterpriseDTO {
  id: string
}

export interface updateEnterpriseDTO {
  avatar: string,
  description: string,
  id: string,
  name: string
}

export interface UpdateLeaderDTO {
  id: string,
  newLeaderId: string
}

// 部门
export interface GetSub{
  "entId": string,
  "hasStaff"?: boolean,
  "isDirect"?: boolean,
  "parentId": string
}

export interface AddSubDTO{
  "entId": string,
  "leaderId": string,
  "name": string,
  "parentId": string,
  "hasGroup"?: boolean
}

export interface DeleteSubDTO{
  "entId": string,
  "id": string
}

export interface GetALLStaffDTO{
  "entId": string,
  "id": string,
  "isDirect"?: boolean
}

export interface GetDepDTO {
  "entId": string,
  "id": string
}

export interface UpdateDepDTO {
  "name": string,
  // "parentId": string,
  "entId": string,
  "id": string,
  "leaderId": string,
  "parentId": string
}

// 员工
export interface AddStaffDTO {
  "name": string,
  "depId": string,
  "entId": string,
  "joinTime": number,
  "phone": string,
  "position"?: string,
  "shortPhone"?: string,
  "email"?: string
}

export interface ChangeDepDTO {
  "depId": string,
  "entId": string,
  "ids": Array<string>
}

export interface ChangeRoleDTO {
  "id": string,
  "role": Role, // 1：超级管理员；2:客户管理员；3：普通人员
  "entId": string
}

export interface GetRroupDTO {
  "entId": string
}

export interface GetStaffInfoDTO {
  "id": string
}

export interface ResignDTO {
  "entId": string,
  "id": string
}

export interface UpdateStaffDTO {
  "id": string,
  "depId": string,
  "email"?: string,
  "phone": string,
  "position": string,
  "entId": string,
  "joinTime": number,
  "leaderId"?: string,
  "name": string,
  "workplace"?: string,
  "shortPhone"?: string
}

// 审核
export interface GetApplyDTO {
  "entId": string,
  "limit": number,
  "offset": number
}

export interface JoinApplyDTO {
  "applyId": string,
  "depId"?: string,
  "fromName": string,
  "joinTime"?: number,
  "phone": string,
  "position"?: string,
  "status": ApplyStatus,
  "shortPhone"?: string,
  "email"?: string
}

export interface QuitApplyDTO {
  "applyId": string,
  "status": ApplyStatus
}

export interface SubmitJoinApplyDTO {
  entId: string,
  "shortPhone"?: string,
  "email"?: string,
  "phone": string,
  "userName": string,
  types?: ApplyType,
  reason?: string
}

export interface SubmitQuitApplyDTO {
  "entId": string,
  "userName": string
}

// 账户
// export interface GetBindDTO {

// }
