'use strict';
define(function() {
  var AlertFactory = function($http) {
    var AlertFactory = {};
    /**
     * Class : AlertFactory
     * Factory WebServices
     */

    /**
     * Function: addalert
     */
    function addalert(
      name,
      description,
      datealert,
      type,
      categorie,
      user,
      color
    ) {
      var promise = $http.post(
        '/services/{portalid}/alert/add?f=json',
        senddata
      );

      return promise;
    }

    /**
     * Function: add
     */
    function add(senddata) {
      var promise = $http.post(
        '/services/{portalid}/alert/add?f=json',
        senddata
      );

      return promise;
    }
    /**
     * Function: remove
     */
    function remove(senddata, id) {
      var promise = $http.post(
        '/services/{portalid}/alert/remove?f=json' + '&id=' + id,
        senddata
      );

      return promise;
    }
    /**
     * Function: update
     */
    function update(senddata, id) {
      var promise = $http.post(
        '/services/{portalid}/alert/update?f=json' + '&id=' + id,
        senddata
      );

      return promise;
    }
    /**
     * Function: search
     */
    function search(senddata) {
      var promise = $http.post(
        '/services/{portalid}/alert/search?f=json',
        senddata
      );

      return promise;
    }
    /**
     * Function: getcount
     */
    function getcount(where) {
      var promise = $http.get(
        '/services/{portalid}/alert/count?f=json' + '&where=' + where
      );

      return promise;
    }
    /**
     * Function: getlist
     */
    function getlist(where) {
      var promise = $http.get(
        '/services/{portalid}/alert/list?f=json' + '&where=' + where
      );

      return promise;
    }
    return {
      AlertFactory: AlertFactory,
      add: add,
      remove: remove,
      update: update,
      search: search,
      getcount: getcount,
      getlist: getlist,
    };
  };
  AlertFactory.$inject = ['$http'];
  return AlertFactory;
});
