Files
notifications-api/app/performance_platform/total_sent_notifications.py
Cliff Hill 4429e48221 More changes are done.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:56:32 -05:00

32 lines
1.0 KiB
Python

from app import performance_platform_client
from app.dao.fact_notification_status_dao import (
get_total_sent_notifications_for_day_and_type,
)
from app.enums import NotificationType
# TODO: is this obsolete? it doesn't seem to be used anywhere
def send_total_notifications_sent_for_day_stats(start_time, notification_type, count):
payload = performance_platform_client.format_payload(
dataset="notifications",
start_time=start_time,
group_name="channel",
group_value=notification_type,
count=count,
)
performance_platform_client.send_stats_to_performance_platform(payload)
# TODO: is this obsolete? it doesn't seem to be used anywhere
def get_total_sent_notifications_for_day(day):
email_count = get_total_sent_notifications_for_day_and_type(
day, NotificationType.EMAIL
)
sms_count = get_total_sent_notifications_for_day_and_type(day, NotificationType.SMS)
return {
NotificationType.EMAIL: email_count,
NotificationType.SMS: sms_count,
}