mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
moved generate_date_range to date_util
standardized the SQLAlchemy calls refactored the endpoints in service/rest.py
This commit is contained in:
@@ -427,9 +427,9 @@ def dao_fetch_todays_stats_for_service(service_id):
|
||||
)
|
||||
|
||||
|
||||
def dao_fetch_stats_for_service_from_days(service_id, start, days):
|
||||
start_date = get_midnight_in_utc(start)
|
||||
end_date = get_midnight_in_utc(start + timedelta(days=days))
|
||||
def dao_fetch_stats_for_service_from_days(service_id, start_date, end_date):
|
||||
start_date = get_midnight_in_utc(start_date)
|
||||
end_date = get_midnight_in_utc(end_date)
|
||||
|
||||
return (
|
||||
db.session.query(
|
||||
@@ -453,9 +453,11 @@ def dao_fetch_stats_for_service_from_days(service_id, start, days):
|
||||
)
|
||||
|
||||
|
||||
def dao_fetch_stats_for_service_from_days_for_user(service_id, start, days, user_id):
|
||||
start_date = get_midnight_in_utc(start)
|
||||
end_date = get_midnight_in_utc(start + timedelta(days=days))
|
||||
def dao_fetch_stats_for_service_from_days_for_user(
|
||||
service_id, start_date, end_date, user_id
|
||||
):
|
||||
start_date = get_midnight_in_utc(start_date)
|
||||
end_date = get_midnight_in_utc(end_date)
|
||||
|
||||
return (
|
||||
db.session.query(
|
||||
|
||||
Reference in New Issue
Block a user