UNPKG

flaglib

Version:

Ignition event 15 added.

105 lines (71 loc) 2.2 kB
var util = require('util'); module.exports = ActiveGroupManager; /* * This function is a constructor. * */ function ActiveGroupManager() { console.log("ActiveGroupManager const called"); } /* * This function is a destructor of the group. * */ ActiveGroupManager.prototype.deleteGroup = function() { console.log("ActiveGroupManager deleteGroup start: "); /* 1. Get data from memcache, using profile id. * 2. Construct Active group, reset data * 3. Store back the data into memcache */ console.log("ActiveGroupManager deleteGroup end: "); }; /* * This function is a constructor of the group. * */ ActiveGroupManager.prototype.createGroup = function(pid, gid, data) { console.log("ActiveGroupManager createGroup start: "); /* 1. Get data from memcache, using profile id. * 2. Construct Active group, set data * 3. Store back the data into memcache */ console.log("ActiveGroupManager createGroup end: "); }; /* * This function check the nearby pickup point to send alert. * input: current location, total time and total distance to calculate avg speed. * */ ActiveGroupManager.prototype.checkUpdate = function(flag, next) { console.log("ActiveGroupManager checkUpdate start: "); /* 1. Get data from memcache, using profile id. * 2. Construct Active group, check update with data, set new data to active group * 3. Store back the data into memcache */ if (next!=null){ next(); } console.log("ActiveGroupManager checkUpdate end: "); }; /* * This function send alert to the whole group. * input: alert message * */ ActiveGroupManager.prototype.sendGroupAlert = function(alert, next) { console.log("ActiveGroupManager sendGroupAlert start: "); /* 1. Get data from memcache, using profile id. * 2. Construct Active group. * 3. get Urns and send the alert using push. * 4. get mobile numbers (for users not registered with ELLII) send SMS alert */ if (next!=null){ next(); } console.log("ActiveGroupManager sendGroupAlert end: "); }; /* * private function to inject data for automate test suite */ ActiveGroupManager.prototype.injectData = function injectData(pid, gid){ }