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:
Ben Thorner
2022-05-03 15:41:08 +01:00
parent ce1cea90f0
commit 1d157836ad
4 changed files with 0 additions and 38 deletions

View File

@@ -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,