export interface IUserBasic {
  id: string;
  username: string;
  email: string | null;
  firstName: string | null;
  lastName: string | null;
}

export interface IUserAccess {
  allBorrowers?: boolean;
  borrowersAccess?: string[];
  complianceBorrowersAccess?: string[];
}

export interface IUser extends IUserBasic, IUserAccess {
  createdAt?: Date;
  updatedAt?: Date;
  passwordResetTokenHash?: string | null;
  passwordResetExpires?: Date | null;
  refreshTokenHash?: string | null;
  refreshTokenExpires?: Date | null;
  roles?: Record<string, string[]>;
  deletedAt?: Date | null;
  isEnabled?: boolean;
  lastLogin?: Date | null;
}

export interface IUserRole {
  id: string;
  name: string;
  representation: string;
  createdAt?: Date;
  updatedAt?: Date;
}

export interface IGroupedUserRoles {
  [module: string]: IUserRole[];
}
