mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
- Only rebuild current month for monthly_billing if today is in the current year.
- Change the usage queries to a union so that billing_units is correct for all notification types. Removing the business logic from the schema. - Added tests for different fragment counts, rates and sheet counts.
This commit is contained in:
@@ -16,12 +16,12 @@ create_or_update_free_sms_fragment_limit_schema = {
|
||||
def serialize_ft_billing_remove_emails(data):
|
||||
results = []
|
||||
billed_notifications = [x for x in data if x.notification_type != 'email']
|
||||
for notifications in billed_notifications:
|
||||
for notification in billed_notifications:
|
||||
json_result = {
|
||||
"month": (datetime.strftime(notifications.month, "%B")),
|
||||
"notification_type": notifications.notification_type,
|
||||
"billing_units": int(notifications.billable_units),
|
||||
"rate": float(notifications.rate),
|
||||
"month": (datetime.strftime(notification.month, "%B")),
|
||||
"notification_type": notification.notification_type,
|
||||
"billing_units": notification.billable_units,
|
||||
"rate": float(notification.rate),
|
||||
}
|
||||
results.append(json_result)
|
||||
return results
|
||||
|
||||
Reference in New Issue
Block a user