Commit Graph

12 Commits

Author SHA1 Message Date
Leo Hemsted
9502f17d84 flake8 fixes
a stricter flake8 bump. mostly things around f strings and format
strings, but a couple of bad placeholder names in loops
2020-12-07 15:24:02 +00:00
Katie Smith
da8eaaed44 Update letter data for usage-for-all-services report
Usage for all services is a platform admin report that groups letters by
postage. We want it to show `europe` and `rest-of-world` letters under a
single category of `international`, so this updates the query to do
that and to order appropriately.
2020-07-14 10:22:30 +01:00
Leo Hemsted
93e631221a use dates rather than datetimes when comparing with bst_date
bst_date is a date field. Comparing dates with datetimes in postgres
gets confusing and dangerous. See this example, where a date evaluates
as older than midnight that same day.

```
notification_api=# select '2019-04-01' >= '2019-04-01 00:00';
 ?column?
----------
 f
(1 row)
```

By only using dates everywhere, we reduce the chance of these bugs
happening
2019-09-02 11:56:56 +01:00
Leo Hemsted
b46eed1423 sort rest response by org_name, service_name
needed to re-arrange test results for this
2019-08-30 12:18:00 +01:00
Leo Hemsted
e4963ca0d3 make sure all letter costs are cast from decimal to float 2019-08-30 12:18:00 +01:00
Leo Hemsted
608738ca67 remove unneccessary str cast 2019-08-30 12:18:00 +01:00
Leo Hemsted
028b81b787 simplify validate_date_range_is_within_a_financial_year
we can use the get_financial_year_for_datetime function
to massively simplify this
2019-08-30 12:18:00 +01:00
Rebecca Law
1c94d6d24a Added command to populate data for annual billing based on last years values. 2019-08-30 12:17:59 +01:00
Rebecca Law
cb7fff6100 Add endpoint to return structured data 2019-08-30 12:17:59 +01:00
Rebecca Law
c766febe94 Update /platform-stats to return the data from ft_notification_status, that way the request should not time out for a long date range.
Next steps is to update the query for platform admin stats for all services.
2018-12-03 15:46:44 +00:00
Katie Smith
b4654781be Add schema and validate platform stats requests
Added a schema to check that the start_date and end_date arguments are
both in the date format.
2018-06-29 16:14:48 +01:00
Katie Smith
4b030b1583 Create platform-stats blueprint
Created a platform-stats blueprint and moved the new platform stats
endpoint to the new blueprint (it was previously in the service
blueprint). Since the original platform stats route and the new platform
stats route are now in different blueprints, their view functions can
have the same name without any issues.
2018-06-29 16:01:45 +01:00