mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-26 11:38:32 -04:00
Fix incorrect chargeable_units column
This was added to migrate away from the vague "billing_units" field, but without fixing the inconsistent data behind it: - For emails and letters, "billing_units" was just the number sent. - For SMS, "billing_units" really was the chargeable_units. To avoid confusion we need two fields to represent the original mix of data - this exposes "notifications_sent" in both APIs.
This commit is contained in:
@@ -25,6 +25,7 @@ def serialize_ft_billing_remove_emails(rows):
|
||||
"cost": float(row.cost),
|
||||
"free_chargeable_units": row.free_chargeable_units,
|
||||
"charged_units": row.charged_units,
|
||||
"notifications_sent": row.notifications_sent,
|
||||
}
|
||||
for row in rows
|
||||
if row.notification_type != 'email'
|
||||
@@ -44,6 +45,7 @@ def serialize_ft_billing_yearly_totals(rows):
|
||||
"cost": float(row.cost),
|
||||
"free_chargeable_units": row.free_chargeable_units,
|
||||
"charged_units": row.charged_units,
|
||||
"notifications_sent": row.notifications_sent,
|
||||
}
|
||||
for row in rows
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user