import { YES_OR_NO } from ".";

export type UserTableListType = {
  createTime: string;
  creatorId: null;
  creatorName: string;
  id: number;
  isAdmin: YES_OR_NO;
  isEnabled: number;
  nickName: string;
  phone: string;
  realName: string;
  roleId: null;
  roleName: string;
  sex: string;
  thumb: string;
  updateTime: string;
  userName: string;
};

export interface GetUserListParams {
  pageNum: number;
  searchKey?: string;
  pageSize: number;
}

export type SaveUserType = {
  id: number | null;
  userName: string;
  nickName: string;
  roleId: number;
  realName: string;
};

export type PermItemType = {
  id: number;
  name: string;
  authority: boolean;
  parentId: number | null;
  children: PermItemType[];
};

export interface SaveRoleParams {
  id?: number;
  resources?: number[];
  roleDesc?: string;
  roleName: string;
}

export interface IRoleItem extends Required<SaveRoleParams> {
  isEnabled: YES_OR_NO;
}
