mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
Add endpoint to get billable units/financial year
`/services/ef7a665d-11a4-425a-a180-a67ca00b69d7/billable-units?year=2016` Pretty much just passes through to the DAO layer. Validates that year is: - present (there’s no need for unbounded queries on this endpoint) - an integer
This commit is contained in:
@@ -310,3 +310,13 @@ def update_whitelist(service_id):
|
||||
else:
|
||||
dao_add_and_commit_whitelisted_contacts(whitelist_objs)
|
||||
return '', 204
|
||||
|
||||
|
||||
@service_blueprint.route('/<uuid:service_id>/billable-units')
|
||||
def get_billable_unit_count(service_id):
|
||||
try:
|
||||
return jsonify(notifications_dao.get_notification_billable_unit_count_per_month(
|
||||
service_id, int(request.args.get('year'))
|
||||
))
|
||||
except TypeError:
|
||||
return jsonify(result='error', message='No valid year provided'), 400
|
||||
|
||||
Reference in New Issue
Block a user