mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Remove redundant fields from service usage APIs
These are no longer used since [^1] and [^2]. [^1]: https://github.com/alphagov/notifications-admin/pull/4225 [^2]: https://github.com/alphagov/notifications-admin/pull/4229
This commit is contained in:
@@ -17,8 +17,6 @@ def serialize_ft_billing_remove_emails(rows):
|
||||
{
|
||||
"month": (datetime.strftime(row.month, "%B")),
|
||||
"notification_type": row.notification_type,
|
||||
# TEMPORARY: while we migrate away from "billing_units"
|
||||
"billing_units": row.billable_units,
|
||||
"chargeable_units": row.chargeable_units,
|
||||
"notifications_sent": row.notifications_sent,
|
||||
"rate": float(row.rate),
|
||||
@@ -36,13 +34,9 @@ def serialize_ft_billing_yearly_totals(rows):
|
||||
return [
|
||||
{
|
||||
"notification_type": row.notification_type,
|
||||
# TEMPORARY: while we migrate away from "billing_units"
|
||||
"billing_units": row.billable_units,
|
||||
"chargeable_units": row.chargeable_units,
|
||||
"notifications_sent": row.notifications_sent,
|
||||
"rate": float(row.rate),
|
||||
# TEMPORARY: while we migrate to "cost" in the Admin app
|
||||
"letter_total": float(row.billable_units * row.rate) if row.notification_type == 'letter' else 0,
|
||||
"cost": float(row.cost),
|
||||
"free_allowance_used": row.free_allowance_used,
|
||||
"charged_units": row.charged_units,
|
||||
|
||||
@@ -220,8 +220,6 @@ def fetch_billing_totals_for_year(service_id, year):
|
||||
query.c.rate.label("rate"),
|
||||
|
||||
func.sum(query.c.notifications_sent).label("notifications_sent"),
|
||||
# TEMPORARY: while we migrate away from "billing_units"
|
||||
func.sum(query.c.billable_units).label("billable_units"),
|
||||
func.sum(query.c.chargeable_units).label("chargeable_units"),
|
||||
func.sum(query.c.cost).label("cost"),
|
||||
func.sum(query.c.free_allowance_used).label("free_allowance_used"),
|
||||
@@ -280,8 +278,6 @@ def fetch_monthly_billing_for_year(service_id, year):
|
||||
func.date_trunc('month', query.c.bst_date).cast(Date).label("month"),
|
||||
|
||||
func.sum(query.c.notifications_sent).label("notifications_sent"),
|
||||
# TEMPORARY: while we migrate away from "billing_units"
|
||||
func.sum(query.c.billable_units).label("billable_units"),
|
||||
func.sum(query.c.chargeable_units).label("chargeable_units"),
|
||||
func.sum(query.c.cost).label("cost"),
|
||||
func.sum(query.c.free_allowance_used).label("free_allowance_used"),
|
||||
@@ -312,8 +308,6 @@ def query_service_email_usage_for_year(service_id, year):
|
||||
FactBilling.bst_date,
|
||||
FactBilling.postage, # should always be "none"
|
||||
FactBilling.notifications_sent,
|
||||
# TEMPORARY: while we migrate away from "billing_units"
|
||||
FactBilling.notifications_sent.label("billable_units"),
|
||||
FactBilling.billable_units.label("chargeable_units"),
|
||||
FactBilling.rate,
|
||||
FactBilling.notification_type,
|
||||
@@ -335,8 +329,6 @@ def query_service_letter_usage_for_year(service_id, year):
|
||||
FactBilling.bst_date,
|
||||
FactBilling.postage,
|
||||
FactBilling.notifications_sent,
|
||||
# TEMPORARY: while we migrate away from "billing_units"
|
||||
FactBilling.notifications_sent.label("billable_units"),
|
||||
# We can't use billable_units here as it represents the
|
||||
# sheet count for letters, which is already accounted for
|
||||
# in the rate. We actually charge per letter, not sheet.
|
||||
@@ -418,8 +410,6 @@ def query_service_sms_usage_for_year(service_id, year):
|
||||
FactBilling.bst_date,
|
||||
FactBilling.postage, # should always be "none"
|
||||
FactBilling.notifications_sent,
|
||||
# TEMPORARY: while we migrate away from "billing_units"
|
||||
chargeable_units.label("billable_units"),
|
||||
chargeable_units.label("chargeable_units"),
|
||||
FactBilling.rate,
|
||||
FactBilling.notification_type,
|
||||
|
||||
Reference in New Issue
Block a user