import {
  CHECK_TEMP_USER_SMS_KEY,
  CREATE_TEMP_USER,
  SEND_TEMP_USER_SMS_KEY
} from '../constants/temp-user';

export function createTempUser(mobile) {
  return {
    type: CREATE_TEMP_USER,
    api: true,
    payload: {
      method: 'POST',
      url: `/users/temp-users`,
      data: { mobile }
    }
  };
}

export function sendSmsKeyRequest(mobile) {
  return {
    type: SEND_TEMP_USER_SMS_KEY,
    api: true,
    payload: {
      method: 'PATCH',
      url: '/users/temp-users/send-sms-key',
      data: { mobile }
    }
  };
}

export function checkSmsKeyRequest(mobile, smsKey) {
  return {
    type: CHECK_TEMP_USER_SMS_KEY,
    api: true,
    payload: {
      method: 'PATCH',
      url: '/users/temp-users/check-sms-key',
      data: { mobile, smsKey }
    }
  };
}
