import { PaginatedResponse } from '@yourcause/common'; import { WorkflowLevelPermissions } from './workflow.typing'; export enum UserTypes { MANAGER = 1, APPLICANT = 2 } export interface ClientUserSetPasswordPayload { token: string; password: string; confirmPassword: string; } export interface RootUserResetPasswordPayload { password: string; confirmPassword: string; } export interface User { firstName: string; lastName: string; active: boolean; culture: string; email: string; id: number; isNewUser: boolean; isRootUser: boolean; jobTitle: string; profileImageUrl: string; requirePasswordReset: boolean; roles: UserRole[]; workflows: { id: number; name: string; description: string; }[]; workFlowLevels: UserWorkflow[]; acceptedTermsOfService: boolean; clientHasNominations: boolean; isInNominationWorkFlow: boolean; isIntegratedWithCsrZone: boolean; affiliateId?: number; hasReports?: boolean; workflowManager?: boolean; passwordExpirationDate?: string; isSso: boolean; } export interface UserRole { policies: any[]; clientRoleId: number; clientRoleName: string; clientRoleDescription: string; } export interface UserWorkflow { id: number; name: string; description: string; workflow: { id: number; name: string; description: string; }; clientId: number; } export interface UserInfo { firstName: string; lastName: string; email: string; userType: number; impersonatedBy: string; fullName?: string; } export interface UpdateUserProfile { firstName: string; lastName: string; profileImageName?: string; existingPassword: string; password: string; confirmPassword: string; culture?: string; } export interface UserFromApi { firstName: string; lastName: string; email: string; jobTitle: string; profileImageUrl: string; isRootUser: boolean; active: boolean; requirePasswordReset: boolean; isNewUser: boolean; id: number; culture: string; roles: { policies: { clientRoleId: number; allow: boolean; permissionSetType: number; permissionType: number; }[]; clientRoleId: number; clientRoleName: string; clientRoleDescription: string; }[]; acceptedTermsOfService: boolean; dateAcceptedTermsOfService: string; fullName?: string; isDeactivated: boolean; userId: number; clientHasNominations: boolean; isInNominationWorkFlow: boolean; isIntegratedWithCsrZone: boolean; workflows: BasicUserWorkflow[]; workFlowLevels: BasicUserWorkflowLevel[]; ssoId: string; isSSO: boolean; } export interface BasicUserWorkflow { id: number; name: string; description: string; workflowManager: boolean; } export interface BasicUserWorkflowLevel { id: number; name: string; description: string; workflow: BasicUserWorkflow; clientId: number; workflowLevelUserAccessType: WorkflowLevelPermissions; } export interface UsersResponseFromApi { users: UserFromApi[]; usersAddedToAccount: number; usersWaitingForRegistration: number; activeUsers: number; inActiveUsers: number; } export interface UserStats { usersAddedToAccount: number; usersWaitingForRegistration: number; activeUsers: number; inActiveUsers: number; } export interface AddEditUser { firstName: string; lastName: string; jobTitle: string; email: string; isSSO?: boolean; id?: number; } export interface UserDragAndDrop { display: string; fullName: string; email: string; } export interface PaginatedUsersResponse { usersAddedToAccount: number; usersWaitingForRegistration: number; activeUsers: number; inActiveUsers: number; users: PaginatedResponse; } export interface ResetPasswordApiResponse { validPassword: boolean; containsUserInfo: boolean; passwordPreviouslyUsed: boolean; } export interface ClientAffiliateInfo { id: number; name: string; corpName: string; supportEmail: string; }