<commit_before>component accessors="true" extends="model.services.baseService" {

property name="settingGateway";
property name="optionGateway";
property name="notifyGateway";
property name="userGateway";
property name="pickService";
property name="settingService";
property name="userService";

/*
Author: 	
	<NAME>
Name:
	$notificationsBySchedule
Summary:
	Runs the notifications based on schedule
Returns:
	Array arNotifications
Arguments:
	Week oWeek
History:
	2014-09-19 - RLW - Created
*/
public Array function notificationsBySchedule( Required model.beans.week oWeek ){
	// get all options that have notificaiton ability
	var arNotifyOptions = variables.optionGateway.getAllForNotification();
	var itm = 1;
	var dtPicksDue = "";
	var arCompletedNotifications = [];
	try{
		// handle each of the notificaiton types
		for(itm; itm lte arrayLen(arNotifyOptions); itm++ ){
			switch( arNotifyOptions[itm].getSSchedule() ){
				// hourly
				case "hourly":
					// to do
					break;

				case "daily":
					// to do
					break;

				case "weekly":
					dtPicksDue = arguments.oWeek.getDPicksDue() & " " & arguments.oWeek.getTPicksDue();
					// make sure we are a few hours from the start of the weeks games
					if( dtPicksDue lte variables.dbService.dbDateTimeFormat(dateAdd("h", 2, now()))
						and dtPicksDue gte variables.dbService.dbDateTimeFormat(dateAdd("h", 1, now())) ){
						// handle processing for this notification type
						arrayAppend(arCompletedNotifications, processNotification(arNotifyOptions[itm], arguments.oWeek));
					}
			}
		}
	} catch (any e){
		registerError("Error trying to run the scheduled notifications", e);
	}
	return arCompletedNotifications;
}

/*
Author: 	
	<NAME>
Name:
	$processNotification
Summary:
	Handles what to do with this notification
Returns:<commit_msg>Changed weekly e-mail to be 12 hours prior to game start time<commit_after>component accessors="true" extends="model.services.baseService" {

property name="settingGateway";
property name="optionGateway";
property name="notifyGateway";
property name="userGateway";
property name="pickService";
property name="settingService";
property name="userService";

/*
Author: 	
	<NAME>
Name:
	$notificationsBySchedule
Summary:
	Runs the notifications based on schedule
Returns:
	Array arNotifications
Arguments:
	Week oWeek
History:
	2014-09-19 - RLW - Created
*/
public Array function notificationsBySchedule( Required model.beans.week oWeek ){
	// get all options that have notificaiton ability
	var arNotifyOptions = variables.optionGateway.getAllForNotification();
	var itm = 1;
	var dtPicksDue = "";
	var arCompletedNotifications = [];
	try{
		// handle each of the notificaiton types
		for(itm; itm lte arrayLen(arNotifyOptions); itm++ ){
			switch( arNotifyOptions[itm].getSSchedule() ){
				// hourly
				case "hourly":
					// to do
					break;

				case "daily":
					// to do
					break;

				case "weekly":
					dtPicksDue = arguments.oWeek.getDPicksDue() & " " & arguments.oWeek.getTPicksDue();
					// make sure we are a few hours from the start of the weeks games
					if( dtPicksDue lte variables.dbService.dbDateTimeFormat(dateAdd("h", 12, now()))
						and dtPicksDue gte variables.dbService.dbDateTimeFormat(dateAdd("h", 11, now())) ){
						// handle processing for this notification type
						arrayAppend(arCompletedNotifications, processNotification(arNotifyOptions[itm], arguments.oWeek));
					}
			}
		}
	} catch (any e){
		registerError("Error trying to run the scheduled notifications", e);
	}
	return arCompletedNotifications;
}

/*
Author: 	
	Ron West
Name:
	$processNotification
Summary:
	Handles what to do with this notification
Returns:
{'fraction_non_alphanumeric': 0.10708446866485014, 'fraction_numerical': 0.007084468664850136, 'mean_word_length': 4.320289855072463, 'pattern_counts': {'":': 6, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6686627', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1084, 'n_words': 317}