import { FetchStateAndError, FetchedState, ID } from '../../commonStateTypes/common'; import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes'; import { User } from '../../entity/user/userState'; import { UserRole } from '../../entity/userRole/userRoleState'; import { UserRoleType } from '../../entity/userRole/userRoleType'; import { ZeniDate } from '../../zeniDayJS'; import { PeopleViewSortKey } from './peopleTypes'; export interface PeopleState extends FetchedState { personDetails: { invitePeopleState: FetchStateAndError; localData: PeopleLocalData[]; updatePeopleState: FetchStateAndError; person?: Person; selectedUserId?: ID; }; personUserIds: ID[]; uiState: PeopleUIState; updateErrorMessage: string; updates: Record; lastFetchRequestTime?: ZeniDate; } export interface PeopleUIState { mode: PeoplePageMode; searchText: string; sortKey: PeopleViewSortKey; sortOrder: SortOrder; } export type PeoplePageMode = 'all' | 'zeni_only' | 'off'; export type PersonUpdateType = 'removeUsers' | 'resendInvite'; export interface Person { user: User | undefined; userId: ID; userRole: UserRole; update?: PersonUpdateType | undefined; } export interface PeopleLocalData { email: string[]; role: UserRoleType[]; departmentId?: ID; managerId?: ID; }