This adds new endpoints to retrieve billing data from the new table:

1. Create a separate billing blueprint to house these endpoints

2. Return monthly breakdown in same format as we did before

3. Return yearly breakdown but only return {billing units, rate,
notification_type}. Admin only makes use of these.
This commit is contained in:
Imdad Ahad
2017-08-15 17:26:10 +01:00
parent 9085cc1a57
commit f40889e6e0
5 changed files with 215 additions and 7 deletions

View File

@@ -100,6 +100,7 @@ def register_blueprint(application):
from app.notifications.notifications_letter_callback import letter_callback_blueprint
from app.authentication.auth import requires_admin_auth, requires_auth, requires_no_auth, restrict_ip_sms
from app.letters.send_letter_jobs import letter_job
from app.billing.rest import billing_blueprint
service_blueprint.before_request(requires_admin_auth)
application.register_blueprint(service_blueprint, url_prefix='/service')
@@ -164,6 +165,9 @@ def register_blueprint(application):
letter_callback_blueprint.before_request(requires_no_auth)
application.register_blueprint(letter_callback_blueprint)
billing_blueprint.before_request(requires_admin_auth)
application.register_blueprint(billing_blueprint)
def register_v2_blueprints(application):
from app.v2.notifications.post_notifications import v2_notification_blueprint as post_notifications