<s> from celery . schedules import crontab <EOL> from celery . task import task , periodic_task <EOL> from custom . ewsghana . alerts . ongoing_non_reporting import OnGoingNonReporting <EOL> from custom . ewsghana . alerts . ongoing_stockouts import OnGoingStockouts , OnGoingStockoutsRMS <EOL> from custom . ewsghana . alerts . urgent_alerts import UrgentNonReporting , UrgentStockoutAlert <EOL> from custom . ewsghana . models import EWSGhanaConfig <EOL> from custom . ewsghana . reminders . first_soh_reminder import FirstSOHReminder <EOL> from custom . ewsghana . reminders . rrirv_reminder import RRIRVReminder <EOL> from custom . ewsghana . reminders . second_soh_reminder import SecondSOHReminder <EOL> from custom . ewsghana . reminders . stockout_reminder import StockoutReminder <EOL> from custom . ewsghana . reminders . third_soh_reminder import ThirdSOHReminder <EOL> from custom . ewsghana . reminders . visit_website_reminder import VisitWebsiteReminder <EOL> @ periodic_task ( run_every = crontab ( hour = <NUM_LIT:10> , minute = <NUM_LIT> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def on_going_non_reporting ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> OnGoingNonReporting ( domain ) . send ( ) <EOL> @ periodic_task ( run_every = crontab ( hour = <NUM_LIT:10> , minute = <NUM_LIT> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def on_going_stockout ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> OnGoingStockouts ( domain ) . send ( ) <EOL> OnGoingStockoutsRMS ( domain ) . send ( ) <EOL> @ periodic_task ( run_every = crontab ( day_of_week = <NUM_LIT:1> , day_of_month = "<STR_LIT>" , hour = <NUM_LIT:8> , minute = <NUM_LIT:20> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def urgent_non_reporting ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> UrgentNonReporting ( domain ) . send ( ) <EOL> @ periodic_task ( run_every = crontab ( day_of_week = <NUM_LIT:1> , day_of_month = "<STR_LIT>" , hour = <NUM_LIT:8> , minute = <NUM_LIT:20> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def urgent_stockout ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> UrgentStockoutAlert ( domain ) . send ( ) <EOL> @ periodic_task ( run_every = crontab ( day_of_week = <NUM_LIT:4> , hour = <NUM_LIT> , minute = <NUM_LIT> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def first_soh_reminder ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> FirstSOHReminder ( domain ) . send ( ) <EOL> @ periodic_task ( run_every = crontab ( day_of_week = <NUM_LIT:1> , hour = <NUM_LIT> , minute = <NUM_LIT> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def second_soh_reminder ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> SecondSOHReminder ( domain ) . send ( ) <EOL> @ periodic_task ( run_every = crontab ( day_of_week = <NUM_LIT:3> , hour = <NUM_LIT> , minute = <NUM_LIT> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def third_soh_to_super ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> ThirdSOHReminder ( domain ) . send ( ) <EOL> @ periodic_task ( run_every = crontab ( day_of_week = <NUM_LIT:3> , hour = <NUM_LIT> , minute = <NUM_LIT:6> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def stockout_notification_to_web_supers ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> StockoutReminder ( domain ) . send ( ) <EOL> @ periodic_task ( run_every = crontab ( day_of_month = "<STR_LIT>" , hour = <NUM_LIT> , minute = <NUM_LIT:15> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def reminder_to_submit_rrirv ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> RRIRVReminder ( domain ) . send ( ) <EOL> @ periodic_task ( run_every = crontab ( month_of_year = '<STR_LIT>' , day_of_month = <NUM_LIT:4> , hour = <NUM_LIT:10> , minute = <NUM_LIT:3> ) , <EOL> queue = '<STR_LIT>' ) <EOL> def reminder_to_visit_website ( ) : <EOL> domains = EWSGhanaConfig . get_all_enabled_domains ( ) <EOL> for domain in domains : <EOL> VisitWebsiteReminder ( domain ) . send ( ) <EOL> @ task ( queue = '<STR_LIT>' ) <EOL> def send_soh_messages_task ( alerts_obj , parser , stockouts , transactions ) : <EOL> alerts_obj . send_messages ( parser , stockouts , transactions ) </s>
