import { RoleVO } from '@/api/system/role/types';
import { PostVO } from '@/api/system/params/post/types';

/**
 * 用户信息
 */
export interface UserInfo {
  user: UserVO;
  roles: string[];
  permissions: string[];
}

/**
 * 用户查询对象类型
 */
export interface UserQuery extends PageQuery {
  userNumb?: string;
  realName?: string;
  phone?: string;
  status?: string;
  deptId?: string | number;
  roleId?: string | number;
}

/**
 * 用户返回对象
 */
export interface UserVO extends BaseEntity {
  userId: string | number;
  tenantId: string;
  deptId: number;
  postId: string | number;
  userName: string;
  nickName: string;
  realName: string;
  userType: string;
  email: string;
  phone: string;
  sex: string;
  avatar: string;
  status: string;
  delFlag: string;
  loginIp: string;
  loginDate: string;
  remark: string;
  deptName: string;
  roles: RoleVO[];
  roleIds: any;
  postIds: any;
  roleId: any;
  admin: boolean;
  idNumber: string;
}

/**
 * 用户表单类型
 */
export interface UserForm {
  userId?: string;
  deptId?: number;
  postId?: number;
  userName?: string;
  userNumb?: string;
  nickName?: string;
  realName?: string;
  loginPwd?: string;
  phone?: string;
  email?: string;
  sex?: string;
  category?: string;
  status: string;
  remark?: string;
  cardType: string;
  lifespan: string;
  postIds?: string[];
  roleIds: string[];
  idNumber?: string;
}

export interface UserInfoVO {
  user: UserVO;
  roles: RoleVO[];
  roleIds: string[];
  posts: PostVO[];
  postIds: string[];
  roleGroup: string;
  postGroup: string;
}

export interface ResetPwdForm {
  oldPassword: string;
  newPassword: string;
  confirmPassword: string;
}
