import store from './store';
import { mockSuperAdmin, mockClinicAdmin } from './mockUserData';
import { PROFILE_FULFILLED } from '../views/Login/loginActionTypes';

/**
 * Sets mock user data in the Redux store for testing purposes
 * @param {string} userType - 'superAdmin' or 'clinicAdmin'
 */
export const setMockUser = (userType) => {
  const userData = userType === 'superAdmin' ? mockSuperAdmin : mockClinicAdmin;
  
  // Dispatch action to set user in the login reducer
  store.dispatch({
    type: PROFILE_FULFILLED,
    payload: {
      payload: {
        data: {
          data: userData
        }
      }
    }
  });
  
  console.log(`Mock ${userType} user set in Redux store`);
};

// Export mock user types for convenience
export const MOCK_USER_ROLES = {
  SUPER_ADMIN: 'superAdmin',
  CLINIC_ADMIN: 'clinicAdmin'
};
