Add endpoint to return structured data

This commit is contained in:
Rebecca Law
2019-08-22 17:48:24 +01:00
committed by Leo Hemsted
parent 4c36e22e93
commit cb7fff6100
5 changed files with 211 additions and 137 deletions

View File

@@ -14,9 +14,6 @@ from app.dao.annual_billing_dao import (
from app.dao.date_util import get_current_financial_year_start_year
from app.dao.fact_billing_dao import (
fetch_monthly_billing_for_year, fetch_billing_totals_for_year,
fetch_sms_billing_for_all_services,
fetch_letter_costs_for_all_services,
fetch_letter_line_items_for_all_services
)
from app.errors import InvalidRequest
@@ -33,19 +30,6 @@ billing_blueprint = Blueprint(
register_errors(billing_blueprint)
@billing_blueprint.route('usage-for-all-services')
def get_usage_for_all_services():
start_date = request.args.get('start_date')
end_date = request.args.get('end_date')
sms_totals = fetch_sms_billing_for_all_services(start_date, end_date)
letter_totals = fetch_letter_costs_for_all_services(start_date, end_date)
letter_breakdown = fetch_letter_line_items_for_all_services(start_date, end_date)
@billing_blueprint.route('/ft-monthly-usage')
@billing_blueprint.route('/monthly-usage')
def get_yearly_usage_by_monthly_from_ft_billing(service_id):