Rebecca Law
271ce6d76e
Changed the update/insert to a postgres upsert to avoid concurrency issues.
2018-05-15 11:21:10 +01:00
Rebecca Law
3615f3d00f
In order to re-run the create_nightly_billing for dates in the past, we added a condition on which table is used.
...
This will allow us to re-run nightly billing for those 2 days where it failed.
For the majority of time the query will run on Notiifcations.
2018-05-14 16:21:16 +01:00
Rebecca Law
d98581cfe6
Added a new endpoint for yearly usage totals using ft_billing.
2018-05-11 16:25:16 +01:00
Rebecca Law
8028f6cc28
We found that the reporting task failed twice because of integrity constraints.
...
This was because the rate_multiplier was being added as 1 and 1.0 which was not resolving to the same.
This updates the table to use Integrer.
Also changed the logging for the task.
2018-05-10 15:35:58 +01:00
Rebecca Law
3e3b885bdc
Realised that it's best to cast the Month as date.
2018-05-08 13:53:44 +01:00
Rebecca Law
ea3523199a
New endpoint to get monthly billing usage from the ft_billing table.
...
New command to compare the results of monthly billing to ft_billing.
2018-05-04 13:09:14 +01:00
Rebecca Law
18c2b9a56d
Use better date function to get the first of each month.
...
Build the json object to return for the new endpoint.
2018-05-02 09:36:13 +01:00
Rebecca Law
0fb9c1d318
Add notification_type to query
2018-05-02 09:36:13 +01:00
Rebecca Law
51af6b27a0
Update name of method to clarify the meaning.
...
Update group by to use label.
Update test.
2018-04-25 17:00:19 +01:00
Rebecca Law
cff731c52d
Set filter on query
2018-04-25 16:17:56 +01:00
Rebecca Law
d00614205e
Adding test for fetch_biling_data_for_day.
2018-04-25 14:45:51 +01:00
Rebecca Law
16ef133aa5
Refactor reporting task so that methods can be used for the annual usage page.
...
Still a work in progress, tests are coming.
2018-04-25 14:45:51 +01:00
Rebecca Law
bd91aac763
Write some pseudo code for ft billing
2018-04-25 14:45:51 +01:00
Rebecca Law
8cd4e1be29
Query ft_billing aggregate for a month
2018-04-25 14:45:51 +01:00