Add .cost() to notification model

In the V2 API, the GET response for an individual notification
returns a 'cost' value, which we can get by multiplying the
billable units by the per-message rate of the supplier who
sent the message.
Any notifications with billable units > 0 but without a
corresponding `ProviderRates` entry will blow up the application,
so make sure you've got one.
This commit is contained in:
Paul Craig
2016-11-18 15:09:15 +00:00
parent 1345c94f4b
commit fddb1653ac
4 changed files with 58 additions and 8 deletions

View File

@@ -3,7 +3,6 @@ import uuid
import pytest
from flask import json
from jsonschema import ValidationError
from notifications_utils.recipients import InvalidPhoneError, InvalidEmailError
from app.v2.notifications.notification_schemas import post_sms_request, post_sms_response, post_email_request, \
post_email_response