Commit Graph

17 Commits

Author SHA1 Message Date
Kenneth Kehl
8c9721d8e2 notify-api-412 use black to enforce python coding style 2023-08-25 09:12:23 -07:00
Ben Thorner
4ab7e3ceec Rename billing API methods to be recognisable
I struggled to distinguish which was which as neither mentioned if
the data they returned was monthly or annual.
2022-05-03 16:00:57 +01:00
Leo Hemsted
b3f5bb6435 add new daily sms provider volumes report
nearly identical to the daily-volumes-report but sms only, and split up
by provider
2022-04-11 14:40:31 +01:00
Rebecca Law
971cb745c9 Report for total notifications sent per day for each channel.
Daily volumes report: total volumes across the platform aggregated by whole business day (bst_date)
Volumes by service report: total volumes per service aggregated by the date range given.

NB: start and end dates are inclusive
2022-03-07 14:30:11 +00:00
Pea Tyczynska
38cfee6390 Rename usage report to billing report
Because only services with bills to pay are included, and
we started including billing details.

Also rename endpoints and file names to match this.
2021-03-30 14:13:54 +01:00
Rebecca Law
2fe5c4a96e New report on platform-admin/reports page to get the usage for all services. 2019-08-23 17:14:04 +01:00
Rebecca Law
e0bcad77f5 Remove ft from method name and url, it doesn't add any meaning. 2019-07-22 14:34:15 +01:00
Chris Hill-Scott
f726551714 Remove unused method
We use `.get_free_sms_fragment_limit_for_year()` instead, which
functionally is the same thing (has a default argument of `year=None`).
2019-04-24 13:10:41 +01:00
Chris Hill-Scott
1d3a4e5043 Inherit don’t duplicate API client constructor
This removes some code which is duplicative and obscure (ie it’s not
very clear why we do `"a" * 73` even though there is a Very Good Reason
for doing so).
2019-01-29 12:11:27 +00:00
Chris Hill-Scott
9e798506c5 Initialise clients outside the app
This avoids the annoying problem where you can’t import a client unless
the app has already been initialised.
2018-10-30 14:59:24 +00:00
Pea Tyczynska
6d2aad5561 Remove functions and comments redundant after monthly_billing removal 2018-07-25 11:48:17 +01:00
Rebecca Law
d8c8b6a454 Temporary endpoint to test the new usage page updates.
This code will go away once we are happy the results match.
2018-05-16 12:26:11 +01:00
Alexey Bezhan
acfe8092fc Add route secret key header to the API requests
Currently requests to the API made from the admin app are going from
PaaS admin app to the nginx router ELB, which then routes them back
to the api app on PaaS.

This makes sense for external requests, but for requests made from
the admin app we could skip nginx and go directly to the api PaaS
host, which should reduce load on the nginx instances and
potentially reduce latency of the api requests.

API apps on PaaS are checking the X-Custom-Forwarder header (which
is set by nginx on proxy_pass requests) to only allow requests going
through the proxy.

This adds the custom header to the API client requests, so that they
can pass that header check without going through nginx.
2018-02-28 11:28:46 +00:00
venusbb
1ab4681ff5 Use the revise api endpoints without current-year parameter 2017-11-09 13:18:09 +00:00
venusbb
8ea38ba7b6 Use annual_billing tables at backend for getting and updating free_sms_fragment_limit 2017-10-31 11:22:57 +00:00
Imdad Ahad
232912ab3b Call the correct endpoint to retrieve yearly billing usage 2017-08-17 16:02:30 +01:00
Imdad Ahad
32242c4501 Update the usage page to use new billing endpoints
* Create new billing_api_client for separation and remove
older methods in the service_api_client
2017-08-16 16:31:47 +01:00