mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Fetch all broadcast messages that are or were transmitted
Regardless of channel. Do not include: - broadcasts older than 25.05.2021 - stubbed broadcasts - broadcasts that were not transmitted. So only broadcasting, cancelled and completed make the list;
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from sqlalchemy import desc
|
||||
|
||||
from app import db
|
||||
from app.dao.dao_utils import autocommit
|
||||
@@ -9,6 +11,7 @@ from app.models import (
|
||||
BroadcastProviderMessage,
|
||||
BroadcastProviderMessageNumber,
|
||||
BroadcastProviderMessageStatus,
|
||||
BroadcastStatusType
|
||||
)
|
||||
|
||||
|
||||
@@ -29,6 +32,14 @@ def dao_get_broadcast_messages_for_service(service_id):
|
||||
).order_by(BroadcastMessage.created_at)
|
||||
|
||||
|
||||
def dao_get_all_broadcast_messages():
|
||||
return BroadcastMessage.query.filter(
|
||||
BroadcastMessage.starts_at >= datetime(2021, 5, 25, 0, 0, 0),
|
||||
BroadcastMessage.stubbed == False, # noqa
|
||||
BroadcastMessage.status.in_(BroadcastStatusType.LIVE_STATUSES)
|
||||
).order_by(desc(BroadcastMessage.starts_at)).all()
|
||||
|
||||
|
||||
def get_earlier_events_for_broadcast_event(broadcast_event_id):
|
||||
"""
|
||||
This is used to build up the references list.
|
||||
|
||||
Reference in New Issue
Block a user