mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
calculate billable units when sending an sms
don't calculate it if we're in research mode * added tests to prove this * removed last code referring to content_char_count
This commit is contained in:
@@ -29,17 +29,7 @@ def get_fragment_count(service_id):
|
||||
]
|
||||
|
||||
sms_count = db.session.query(
|
||||
func.sum(
|
||||
case(
|
||||
[
|
||||
(
|
||||
NotificationHistory.content_char_count <= 160,
|
||||
func.ceil(cast(NotificationHistory.content_char_count, Float) / 153)
|
||||
)
|
||||
],
|
||||
else_=1
|
||||
)
|
||||
)
|
||||
func.sum(NotificationHistory.billable_units)
|
||||
).filter(
|
||||
NotificationHistory.notification_type == SMS_TYPE,
|
||||
*shared_filters
|
||||
|
||||
Reference in New Issue
Block a user