import { Action } from 'lib/types/interfaces';

export const fetchShop = (slug?) => ({
	type: '@@shops::FETCH_SINGLE',
	slug: slug
}) as Action;

export const fetchedShop = (data?) => ({
	type: '@@shops::FETCHED_SINGLE',
	...data
}) as Action;

export const failedFetchShop = (error?) => ({
	type: '@@shops::FAILED_FETCH_SINGLE',
	...error
}) as Action;

export const createShop = (payload?) => ({
	type: '@@shops::CREATE',
	payload: payload
}) as Action;

export const createdShop = (data?) => ({
	type: '@@shops::CREATED',
	...data
}) as Action;

export const failedCreateShop = (error?) => ({
	type: '@@shops::FAILED_CREATE',
	...error
}) as Action;

export const fetchMultipleShops = () => ({
	type: '@@shops::FETCH_MULTIPLE'
}) as Action;

export const fetchedMultipleShops = (data?) => ({
	type: '@@shops::FETCHED_MULTIPLE',
	...data
}) as Action;

export const failedFetchMultipleShops = (error?) => ({
	type: '@@shops::FAILED_FETCH_MULTIPLE',
	...error
}) as Action;

export const updateShop = (payload?) => ({
	type: '@@shops::UPDATE',
	payload: payload
}) as Action;

export const updatedShop = (data?) => ({
	type: '@@shops::UPDATED',
	...data
}) as Action;

export const failedUpdateShop = (error?) => ({
	type: '@@shops::FAILED_UPDATE',
	...error
}) as Action;





// MEMBER MANAGEMENT

export const assignRole = (payload?) => ({
	type: '@@shops::ASSIGN_MEMBER_ROLE',
	payload: payload
}) as Action;

export const assignedRole = (data?) => ({
	type: '@@shops::ASSIGNED_MEMBER_ROLE',
	...data
}) as Action;

export const failedAssignRole = (error?) => ({
	type: '@@shops::FAILED_ASSIGN_MEMBER_ROLE',
	...error
}) as Action;


export const removeRole = (payload?) => ({
	type: '@@shops::REMOVE_MEMBER_ROLE',
	payload: payload
}) as Action;

export const removedRole = (data?) => ({
	type: '@@shops::REMOVED_MEMBER_ROLE',
	...data
}) as Action;

export const failedRemoveRole = (error?) => ({
	type: '@@shops::FAILED_REMOVE_MEMBER_ROLE',
	...error
}) as Action;


export const changeRole = (payload?) => ({
	type: '@@shops::CHANGE_MEMBER_ROLE',
	payload: payload
}) as Action;


export const changedRole = (data?) => ({
	type: '@@shops::CHANGED_MEMBER_ROLE',
	...data
}) as Action;


export const failedChangeRole = (error?) => ({
	type: '@@shops::FAILED_CHANGE_MEMBER_ROLE',
	...error
}) as Action;



export const fetchNoneMembers = (searchKey?) => ({
	type: '@@shops::FETCH_NONE_MEMBERS',
	searchKey: searchKey
}) as Action;


export const fetchedNoneMembers = (data?) => ({
	type: '@@shops::FETCHED_NONE_MEMBERS',
	...data
}) as Action;


export const failedFetchNoneMembers = (error?) => ({
	type: '@@shops::FAILED_FETCH_NONE_MEMBERS',
	...error
}) as Action;



export const addShopMember = (payload?) => ({
	type: '@@shops::ADD_SHOP_MEMBER',
	payload: payload
}) as Action;


export const addedShopMember = (data?) => ({
	type: '@@shops::ADDED_SHOP_MEMBER',
	...data
}) as Action;


export const failedAddShopMember = (error?) => ({
	type: '@@shops::FAILED_ADD_SHOP_MEMBER',
	...error
}) as Action;




export const fetchShopActivity = (slug?) => ({
	type: '@@shops::FETCH_SHOP_ACTIVITY',
	slug: slug
}) as Action;


export const fetchedShopActivity = (data?) => ({
	type: '@@shops::FETCHED_SHOP_ACTIVITY',
	...data
}) as Action;


export const failedFetchShopActivity = (error?) => ({
	type: '@@shops::FAILED_FETCH_SHOP_ACTIVITY',
	...error
}) as Action;

