45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { store } from "./store";
|
|
|
|
export type RootState = ReturnType<typeof store.getState>;
|
|
export type AppDispatch = typeof store.dispatch;
|
|
|
|
// Generic helper types for Redux thunks that return a user-facing message
|
|
export type ThunkSuccess<T extends object = object> = { message: string } & T;
|
|
export type ThunkError = string;
|
|
|
|
export interface IUserResponse {
|
|
token: string;
|
|
id: string;
|
|
name: string | null;
|
|
email: string;
|
|
firstName: string | null;
|
|
lastName: string | null;
|
|
merchantId?: number | null;
|
|
username?: string | null;
|
|
phone?: string | null;
|
|
jobTitle?: string | null;
|
|
enabled?: boolean;
|
|
authorities?: string[];
|
|
allowedMerchantIds?: number[];
|
|
created?: string;
|
|
disabledBy?: string | null;
|
|
disabledDate?: string | null;
|
|
disabledReason?: string | null;
|
|
incidentNotes?: boolean;
|
|
lastLogin?: string | null;
|
|
lastMandatoryUpdated?: string | null;
|
|
marketingNewsletter?: boolean;
|
|
releaseNotes?: boolean;
|
|
requiredActions?: string[];
|
|
twoFactorCondition?: string | null;
|
|
twoFactorCredentials?: string[];
|
|
mustChangePassword?: boolean;
|
|
}
|
|
|
|
export interface ILoginResponse {
|
|
user: IUserResponse;
|
|
success: boolean;
|
|
message: string;
|
|
must_change_password: boolean;
|
|
}
|