Imdad Ahad
c92b72da6e
Remove yearly billing data dao methods
2017-08-30 14:40:29 +01:00
Rebecca Law
17f62723fa
Removed unused endpoint and dao methods.
2017-08-24 16:09:48 +01:00
Imdad Ahad
35ad5d74f9
Retrieve billing data (for month) by notification type:
...
* Previously we were only returning SMS. Let's make this return for
a given notification type.
* General refactor of the monthly retrieval query
* Return an empty BillingData tuple if email billing data is empty
2017-08-11 16:57:18 +01:00
Imdad Ahad
824063ddb8
Fix to return billing data before a rate begins
2017-08-02 15:32:34 +01:00
Rebecca Law
e23d38de26
Fix bug in get rates function.
2017-07-25 15:50:14 +01:00
Rebecca Law
5612ca023e
- Add transactional
...
- Rename function for clarity
2017-07-25 14:26:42 +01:00
Martyn Inglis
d97c7c8e56
- Fix up free tier on the service object, use it only on dump not create/update in marshmallow
...
- Ensure tests leave config as was after a test run that alters free tier quantity
2017-06-07 09:58:57 +01:00
Martyn Inglis
cad195949a
Ensure that the bill includes whatever free allowance is applicable.
2017-06-06 16:21:05 +01:00
Martyn Inglis
96d30d31b1
Get existing tests to pass.
...
Done by ensuring that the rate limit is 0, so that all messages are billable.
2017-06-06 14:55:37 +01:00
Martyn Inglis
0db8297693
Removed print statement
2017-05-24 09:59:07 +01:00
Martyn Inglis
9dd6041944
Usage DAO can now return rates and billable amount, alongside units.
2017-05-24 08:56:59 +01:00
Martyn Inglis
119f0532ab
Renamed the API method/url
2017-05-22 10:06:34 +01:00
Martyn Inglis
2a0669636d
Add and test new DAO method that counts the billable units multiplied by rate multiplier for a given service for a given time period.
...
Currently this is SMS only.
Used by the dashboard for a headline figure.
2017-05-19 16:42:33 +01:00
Rebecca Law
81e10896ea
Remove print statement
2017-05-04 09:47:27 +01:00
Rebecca Law
93e76d2362
Update the valid_from date for the rate that is intended to start at the begining of the financial year.
...
It was the start of the financial year in BST, needed to convert it to UTC.
Small change to the logic to find the rates.
2017-05-03 17:11:48 +01:00
Ken Tsang
03885fea2f
Update tests with new rates
2017-05-03 13:13:13 +01:00
Ken Tsang
a1a8397f74
Update billing data to handle future dates
2017-05-02 19:23:57 +01:00
Rebecca Law
c40111a576
Split up a test
2017-05-02 11:20:01 +01:00
Rebecca Law
88d92d6070
Fix the logic gettting the rates for a financial year.
...
The is_between_end_date_exclusive is a bit funny.
Perhaps the better way to handle it is to make the function is_between but change the financial year function return an enddate that is one millisecond less. That way we can always use the between logic and it will be easier to use.
2017-04-28 16:55:41 +01:00
Rebecca Law
3b41478a0a
Updated Notification model to use Float(asdecimal=False) for rate_mutliplier.
...
Added test with multiple rows for a month.
2017-04-28 10:10:49 +01:00
Rebecca Law
1a64509186
Change the resultset from the yearly and monthly billing data queries.
...
Fix some formatting of the return objects.
2017-04-28 10:10:49 +01:00
Rebecca Law
a186fc95be
Added new endpoints to return the yearly-usage and monthly-usage for a given financial year and service id.
...
Since the response has changed I have created new endpoints so that the deployments for Admin are more managable.
Removed print statements from some tests.
2017-04-28 10:10:48 +01:00
Rebecca Law
e1e55edd9c
Add new fields to the usage queries: rate_multiplier, international, phone_prefix.
2017-04-28 10:10:48 +01:00
Rebecca Law
4c37c8bdbb
New query to get billing data per month.
2017-04-28 10:10:48 +01:00
Rebecca Law
6dc336ad6c
Created new queries to return the rate with the sum of billable units for the year totals.
...
Once we have the new columns in notifications table, the query will need to include the rate multiplier and if the number is international.
The monthly billing query will be built next.
2017-04-28 10:10:48 +01:00