add billable_units column to notifications table

this replaces content_char_count, by performing the additional
steps to calculated billable units at insert time, rather than
read time. This means we can take into account whether the
service was in research mode or using a test api key when the
notification was sent :tada
This commit is contained in:
Leo Hemsted
2016-08-03 14:27:58 +01:00
parent 4ca23b2282
commit 2793541b9c
3 changed files with 115 additions and 1 deletions

View File

@@ -22,7 +22,6 @@ def get_provider_statistics(service, **kwargs):
def get_fragment_count(service_id):
live_dates = get_service_live_dates(service_id)
shared_filters = [
NotificationHistory.service_id == service_id,
NotificationHistory.status.in_(NOTIFICATION_STATUS_TYPES_BILLABLE),