Commit Graph

21 Commits

Author SHA1 Message Date
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
c4d869175a Add join to LetterRates for the billing query.
Fix the yearly totals to work for letters.
2017-12-18 16:46:59 +00:00
Rebecca Law
e0e64d51d5 [WIP]
Fix the query to count rather than sum the billing units.
Need to fix the query that returns the monhtly billing, there is only one row but there should be two if there are two rates.
2017-12-15 17:29:32 +00:00
Leo Hemsted
f29e08c778 don't update current year twice 2017-12-06 14:45:44 +00:00
Leo Hemsted
78099de776 make sure POST /free-sms-fragment-limit always creates
refactored billing/rest.py and annual_billing_dao.py to remove logic
from the dao, and simplify the process around creating new rows. Make
sure that the POST always creates (it previously wouldn't create rows
for years that don't already exist). Clean up some tests that were
doing too much set-up/data verification via rest calls rather than
directly inserting test data in to the DB.
2017-12-06 14:45:44 +00:00
Leo Hemsted
28d5f9b87f flake8 - remove unused imports and ensure they're always at the top of the file 2017-11-28 14:28:01 +00:00
venusbb
c111458168 Bridging API to update annual_billing table 2017-11-14 16:15:36 +00:00
venusbb
23d8d54e0b remove check to financial_year_start in schema as it can be None 2017-11-09 11:07:11 +00:00
venusbb
ad386b7d28 removed unused import and minor syntax 2017-11-02 17:02:00 +00:00
venusbb
6f7793d761 - Add update dao_update_annual_billing_for_current_and_future_years
- moved get_current_financial_year_start_year from service.utils to dao.date_utils
- Moved logic for data persistence from rest to dao when updating records in db
2017-11-02 12:38:43 +00:00
venusbb
cc3d5ba8d1 Added logic to return past and future free_sms_limit_data that dont exist 2017-10-30 17:10:12 +00:00
venusbb
c991df3209 Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-free-sms-limit-history 2017-10-26 20:47:18 +01:00
venusbb
eca93a5a24 added a new end point current-year and tests 2017-10-26 17:21:35 +01:00
venusbb
c10cde6b22 modified serialized method and schema 2017-10-26 13:25:11 +01:00
venusbb
8ad98f2806 create entry when creating a new service 2017-10-25 11:35:13 +01:00
venusbb
15e3b4171b fixed object persistence problem 2017-10-24 16:10:51 +01:00
venusbb
59dd343254 Added free_sms_fragment_limit model, schema, dao and Rest 2017-10-24 13:23:24 +01:00
Imdad Ahad
e05160bdfb Aggregate monthly totals from billing data 2017-08-18 16:12:01 +01:00
Imdad Ahad
d7d2ff7af4 Query the correct table for monthly billing usage:
* Query `MonthlyBilling` for the monthly usage and transform
 response for admin
2017-08-18 13:38:53 +01:00
Imdad Ahad
f40889e6e0 This adds new endpoints to retrieve billing data from the new table:
1. Create a separate billing blueprint to house these endpoints

2. Return monthly breakdown in same format as we did before

3. Return yearly breakdown but only return {billing units, rate,
notification_type}. Admin only makes use of these.
2017-08-17 11:10:42 +01:00