You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lu-notifications-business.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * Created by robin on 12/11/16.
  3. */
  4. (function () {
  5. 'use strict';
  6. angular.module('luticate2Utils')
  7. .factory('luNotificationsBusiness', ['luNotificationsDataAccess', function(luNotificationsDataAccess) {
  8. var luNotificationsBusiness = {};
  9. luNotificationsBusiness.EVENT_CREATE = 'EVENT_CREATE';
  10. luNotificationsBusiness.EVENT_UPDATE = 'EVENT_UPDATE';
  11. luNotificationsBusiness.EVENT_DELETE = 'EVENT_DELETE';
  12. luNotificationsBusiness.init = function () {
  13. luNotificationsDataAccess.init();
  14. };
  15. luNotificationsBusiness.addEventCreateCallback = function (entityType, callback) {
  16. luNotificationsDataAccess.addCallback(luNotificationsBusiness.EVENT_CREATE, entityType, callback);
  17. };
  18. luNotificationsBusiness.addEventUpdateCallback = function (entityType, callback) {
  19. luNotificationsDataAccess.addCallback(luNotificationsBusiness.EVENT_UPDATE, entityType, callback);
  20. };
  21. luNotificationsBusiness.addEventDeleteCallback = function (entityType, callback) {
  22. luNotificationsDataAccess.addCallback(luNotificationsBusiness.EVENT_DELETE, entityType, callback);
  23. };
  24. luNotificationsBusiness.addEventCrudCallback = function (entityType, callback) {
  25. luNotificationsBusiness.addEventCreateCallback(entityType, callback);
  26. luNotificationsBusiness.addEventUpdateCallback(entityType, callback);
  27. luNotificationsBusiness.addEventDeleteCallback(entityType, callback);
  28. };
  29. return luNotificationsBusiness;
  30. }]);
  31. })();