mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-14 23:08:07 -04:00
Update billing mocks and get_sum_billing_units function
Updated the 'get_sum_billing_units' function to no longer multiply the billing units by the rate multiplier. The billing_units that come from notifications-api already consist of the billable_units * rate_multiplier. The rate_multiplier is also not returned from the api response anymore. Also updated the billing mocks since these were not mocking the right fields in the JSON responses from the API billing endpoints, and added the new 'postage' field which will get returned from the monthly-usage endpoint in notifications-api.
This commit is contained in:
@@ -418,8 +418,8 @@ def get_months_for_year(start, end, year):
|
||||
|
||||
def get_sum_billing_units(billing_units, month=None):
|
||||
if month:
|
||||
return sum(b['billing_units'] * b.get('rate_multiplier', 1) for b in billing_units if b['month'] == month)
|
||||
return sum(b['billing_units'] * b.get('rate_multiplier', 1) for b in billing_units)
|
||||
return sum(b['billing_units'] for b in billing_units if b['month'] == month)
|
||||
return sum(b['billing_units'] for b in billing_units)
|
||||
|
||||
|
||||
def get_free_paid_breakdown_for_billable_units(year, free_sms_fragment_limit, billing_units):
|
||||
|
||||
Reference in New Issue
Block a user