/*
 *
 * SmsTrai actions
 *
 */

import {
  CREATE_TRAI_SMS_TEMPLATE_REQUEST,
  CLEAR_TRAI_SMS_TEMPLATE_CREATE_RESPONSE_REQUEST,
  CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_REQUEST,
  CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_SUCCESS,
} from './constants';

export function createSMSTRAITemplates(templates, callback) {
  return {
    type: CREATE_TRAI_SMS_TEMPLATE_REQUEST,
    templates,
    callback,
  };
}

export function clearCreateResponse() {
  return {
    type: CLEAR_TRAI_SMS_TEMPLATE_CREATE_RESPONSE_REQUEST,
  };
}

export function checkDuplicatesInDb(payload) {
  return {
    type: CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_REQUEST,
    payload,
  };
}

export function doneCheckingDuplicates(data) {
  return {
    type: CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_SUCCESS,
    data,
  };
}
