import { IRole, IUser } from "@ax/types";
import {
	SET_CURRENT_PERMISSIONS,
	SET_CURRENT_USER,
	SET_GLOBAL_PERMISSIONS,
	SET_ROLES,
	SET_USERS,
	SET_USER_FORM,
} from "./constants";

export interface ISetUsers {
	type: typeof SET_USERS;
	payload: { users: IUser[] };
}

export interface ISetCurrentUser {
	type: typeof SET_CURRENT_USER;
	payload: { currentUser: IUser };
}

export interface ISetUserForm {
	type: typeof SET_USER_FORM;
	payload: { userForm: IUser };
}

export interface ISetRoles {
	type: typeof SET_ROLES;
	payload: { roles: IRole[] };
}

export interface ISetCurrentPermissions {
	type: typeof SET_CURRENT_PERMISSIONS;
	payload: { currentPermissions: string[] };
}

export interface ISetGlobalPermissions {
	type: typeof SET_GLOBAL_PERMISSIONS;
	payload: { globalPermissions: string[] };
}

export type UsersActionsCreators = ISetUsers & ISetCurrentUser & ISetUserForm & ISetRoles & ISetCurrentPermissions;
