minglis
05a179c6ef
Merge pull request #941 from alphagov/load-service-on-auth
...
Load service on auth
2017-05-17 10:49:00 +01:00
kentsanggds
c4964d8cf4
Merge pull request #956 from alphagov/add-service-permissions
...
Add service permissions DAO and refactor user service permission mock
2017-05-16 14:26:15 +01:00
Ken Tsang
733c16b2bb
Update to strip down DAO and clarify tests
2017-05-16 12:33:27 +01:00
Ken Tsang
54d801979c
Refactored to handle single service permission
2017-05-16 10:57:57 +01:00
Ken Tsang
114d4d84d4
Add service permissions DAO and refactor user service permission mock
2017-05-15 17:28:14 +01:00
Imdad Ahad
7a10a91262
Revert "Process SNS request triggered by a DVLA S3 update"
2017-05-12 17:21:07 +01:00
Martyn Inglis
fd542024a3
Merge branch 'master' into load-service-on-auth
2017-05-12 16:14:44 +01:00
Imdad Ahad
f766f90207
Add task to process a DVLA response file:
...
* Currently we do nothing with the parsed response. We will
* update the status of the notifications in a separate PR
2017-05-12 14:24:26 +01:00
Imdad Ahad
048861b968
Add dao to get active users for service
2017-05-11 15:39:15 +01:00
Leo Hemsted
348183d93b
Merge pull request #942 from alphagov/status-as-table
...
notification status as table
2017-05-10 13:54:49 +01:00
Martyn Inglis
064b7436db
Extra call to explicitly load API keys on service load - avoids extra calls later.
2017-05-05 15:22:21 +01:00
Rebecca Law
d252dc8976
New endpoint to search by "to" field of the notification.
...
The query ignores case and spaces.
2017-05-05 14:12:50 +01:00
Leo Hemsted
7e52fa4d13
add new notification_status column to models.py
...
We now have a new column in the database, but it isn't being
populated. The first step is to make sure we update this column,
while still keeping the old enum based column up to date as well.
A couple of changes have had to happen to support this - one irritating
thing is that if we're ever querying columns individually, including
`Notification.status`, then we'll need to give that column a label,
since under the hood it translates to `Notification._status_enum`.
Accessing status through the ORM (i.e., my_noti.status = 'sending' or
similar) will work fine.
2017-05-04 17:24:28 +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
a1a8397f74
Update billing data to handle future dates
2017-05-02 19:23:57 +01:00
Rebecca Law
3e0221adec
Change get_financial_year to return ending date as 1 microsecond earlier.
...
That way we can write the queries as between start and end dates, making it easier to read.
This makes more sense.
2017-05-02 10:00:47 +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
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
fdbadf967e
Fix the email billing data when there is no results.
2017-04-28 10:10:48 +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
Imdad Ahad
c5bd685cef
Don't update sent notifications (dao)
2017-04-27 16:55:39 +01:00
Martyn Inglis
349fb3529e
Handle case for international SMS - use correct phone validator, and also set status correctly.
...
This relies on some other code so this commit has placeholder failing tests to be populated when other PRs are merged.
2017-04-27 16:27:14 +01:00
Martyn Inglis
ba58c55c3b
Filter provider details by international flags
2017-04-27 12:13:58 +01:00
Rebecca Law
e8a7762688
Merge branch 'master' into update-sms-rate
2017-04-25 10:15:54 +01:00
Rebecca Law
6c8ff80440
Rename class to be singular
2017-04-25 09:53:43 +01:00
Rebecca Law
43226dc932
Added a new rates table.
...
We only need one rate per channel. This reflects that. The provider_rates has been left for now, it is still not being used.
New dao has been added to select the right rate for the given notification_type and date of notificaiton.
2017-04-24 16:20:03 +01:00
Imdad Ahad
ce2401c6e0
Ensure get_current_provider only returns active
2017-04-24 16:06:14 +01:00
Imdad Ahad
c4fac1d937
Revert "Revert "add DVLA organisations to API""
2017-04-21 16:05:07 +01:00
Leo Hemsted
c3e56d5d2d
Revert "add DVLA organisations to API"
2017-04-20 18:21:56 +01:00
Leo Hemsted
95b3248a5e
Merge pull request #906 from alphagov/dvla-orgs
...
add DVLA organisations to API
2017-04-20 17:41:27 +01:00
Leo Hemsted
f127bac600
add GET /dvla_organisation endpoint
2017-04-20 15:35:31 +01:00
Leo Hemsted
67002cd608
Merge pull request #905 from alphagov/letter-scheduled-task
...
exclude letters from scheduled cleanup tasks
2017-04-19 16:19:44 +01:00
Leo Hemsted
935e566284
add tests for letters not getting excluded
2017-04-19 14:22:25 +01:00
Leo Hemsted
b381aeefa1
don't include letters when timing out/deleting old notifications
...
also refactored those functions, since they were pretty gnarly and
repeated themselves a lot
2017-04-19 11:34:00 +01:00
Ken Tsang
fc0cfa5dbf
Corrected code to handle template types
2017-04-19 10:51:12 +01:00
Martyn Inglis
b8cfaf02f6
Ordered the query - ambiguous orders made tests flaky
2017-04-13 12:52:30 +01:00
Leo Hemsted
c7c47a029f
remove slow join from template-last-use query
2017-04-10 17:33:31 +01:00
Rebecca Law
7ba9b1d261
Update the update statements with the updated_at and sent_at timestamps.
2017-04-07 15:21:27 +01:00
Rebecca Law
2d9a449d1e
Changed styling
2017-04-07 14:36:00 +01:00
Rebecca Law
f7ab49246a
Added an endpoint that returns all letter jobs, ordered by created_at desc.
2017-04-07 11:50:56 +01:00
Rebecca Law
61d228e797
Remove test filter
2017-04-07 11:22:03 +01:00
Rebecca Law
50a5bedcbf
Refactor update to notifcations to be a bulk update. This is much better for performance.
2017-04-07 10:59:12 +01:00
Rebecca Law
b6abb82212
Merge pull request #887 from alphagov/update-job-status
...
Update job status for letter jobs.
2017-04-06 14:22:09 +01:00
Rebecca Law
24c871179d
Merge pull request #885 from alphagov/platform-admin-query
...
Platform admin query
2017-04-06 13:58:34 +01:00
Rebecca Law
9e175f42e8
Refactor to make code more readible.
2017-04-06 11:18:21 +01:00
Rebecca Law
4f6a66c904
Merge branch 'master' into update-job-status
...
Conflicts:
app/dao/jobs_dao.py
tests/app/dao/test_jobs_dao.py
2017-04-06 11:11:37 +01:00
Martyn Inglis
832005efef
Updates to the delete CSV file job to reduce the number of eligible jobs in any run
...
- previously this was unbounded, so it got all jobs older then 7 days. In excess of 75,000 🔥
- this meant that the job took (a) a long time and (b) a lot memory and (c) doing the same thing every day
These changes mean that the job has a 2 day eligible window for jobs, minimising the number of eligible jobs in a run, whilst still retaining some leeway in event if it failing one night.
In principle the job runs early morning on a given day. The previous 7 days are left along, and then the previous 2 days worth of files are deleted:
so:
runs on
31st
30,29,28,27,26,25,24 are ignored
23,22 jobs here have files deleted
21 and earlier are ignored.
2017-04-05 16:23:41 +01:00