Martyn Inglis
6b5b40b953
Added tests for statsd and provider stats outcomes with the new provider stats tasks
...
- note large change to DAO to remove provider from create notification. Added on send now not creation.
2016-06-13 11:38:25 +01:00
Chris Hill-Scott
c2ae4773da
Order templates by newest created first
...
When you add a new template, it’s probably the one that you want to do
subsequent stuff with. But it’s also helpful to see the template in
context (with its siblings) to understand that there are multiple
templates. So we don’t want to do what we do in
https://github.com/alphagov/notifications-admin/pull/648
for adding a new template.
But we _can_ make your brand-new template appear first by always
ordering by when the template was created.
This also removes the confusion caused by having `updated_at` affecting
order, and causing the templates to move around all the time.
2016-06-06 10:44:40 +01:00
Martyn Inglis
5e1613e461
pep8 too many lines
2016-06-02 10:35:54 +01:00
Martyn Inglis
c6c534365e
Fixing tests as stats update now don't update reference
2016-06-02 10:00:27 +01:00
Martyn Inglis
754ccbe9af
Removed update reference from updating the provider stats
...
- single focus method
- allows not to pollute DAO with research mode
2016-06-02 09:52:47 +01:00
Martyn Inglis
001149c263
Merge branch 'master' into research-mode-implementation
2016-06-02 09:28:35 +01:00
Nicholas Staples
276ca15919
Provider stats only updated if the provider successfully sends the message.
2016-06-01 12:43:26 +01:00
Martyn Inglis
9617f0748b
Added some tests around creating and updated services
...
- ensure research mode is respected on creation and update
- ensure rest client gives an error for bad research mode update
2016-05-31 12:49:06 +01:00
Martyn Inglis
2108bb52d5
Reorder updates to the notification / stats tables to match create.
2016-05-31 10:17:15 +01:00
Rebecca Law
25a1b7f31c
Firetext does not have a status code for temporary-failure.
...
In order to set a message as temporary-failure, we check if it is in pending status first.
Otherwise a delivery receipt for failure is set to permanent failure.
2016-05-26 16:46:00 +01:00
Rebecca Law
83df16025d
Merge pull request #347 from alphagov/get-jobs-created-in-last-7-days
...
Add a limit days query param for get all jobs.
2016-05-25 11:36:31 +01:00
Rebecca Law
a67793cf8a
Updated date query so that the created_at date is truncated so that we get all jobs created number of days requested.
2016-05-25 11:13:49 +01:00
Rebecca Law
2a7872cce1
Add a limit days query param for get all jobs.
2016-05-24 17:21:04 +01:00
Rebecca Law
6735a7103c
Merge pull request #345 from alphagov/notification-job-status-counts
...
Notification job status counts
2016-05-24 16:47:00 +01:00
Rebecca Law
d6c7f03607
Added another assert to the test
2016-05-24 16:37:05 +01:00
Rebecca Law
e4eecb894a
Update job.notifications_delivered and job.notifications_failed count when updating the status of a notification.
2016-05-24 11:31:44 +01:00
Rebecca Law
dff60175a4
Add jobs.notifications_delivered and jobs.notifications_failed counts to the jobs table.
2016-05-23 15:44:57 +01:00
Leo Hemsted
5ebae9c66c
only return unarchived templates when getting all templates
...
get_specific_template functions happily return archived templates
2016-05-23 14:20:02 +01:00
Rebecca Law
cf2723bdc9
If the sms client provider sends more than one delivery receipt only take the update for the the first one.
...
Only update the notification.status if status = sending.
2016-05-20 17:04:56 +01:00
Rebecca Law
0f9a019945
Make the get_user_by_email_address case insenstive.
2016-05-20 13:43:31 +01:00
Nicholas Staples
15607c0977
Add server_commands and update readme.md
...
Update command to search for services from the user.
2016-05-18 12:20:56 +01:00
Rebecca Law
281a93b32d
Update ses callback to interpret hard and soft bounces.
...
If the notification has a status == sending then update the status otherwise do not update the status.
In other words do not change the status more than once.
2016-05-17 15:38:49 +01:00
Rebecca Law
faff5fff55
Merge branch 'master' into add-template-version
2016-05-13 16:32:57 +01:00
Rebecca Law
917110870d
Use the template version at the time the notification is created or at the time the job is created.
...
Update notifications/sms|email endpoint to send the template version to the queue.
Update the process_job celery talk to send the template version to the queue.
When the send_sms|send_email task runs it will get the template by id and version.
Created a data migration script to add the template_vesion column for jobs and notifications.
The existing jobs and notifications are given the template_version of the current template.
There is a chance this is the wrong template version, but deemed okay since the application is not live.
Create unit test for the dao_get_template_versions method.
Rename /template/<id>/version to /template/<id>/versions which returns all versions for that template id and service id.
2016-05-13 16:25:05 +01:00
Martyn Inglis
06bfe81329
Load testing client added
2016-05-12 10:46:35 +01:00
Rebecca Law
c8c0f95dd2
Merge branch 'master' into add-template-version
...
Conflicts:
tests/app/dao/test_notification_dao.py
2016-05-12 09:49:35 +01:00
Rebecca Law
f223da04df
[WIP] Fix for dao test
2016-05-12 09:20:49 +01:00
Rebecca Law
f72f5aba05
[WIP]
...
Start to add template_version to jobs and notification
2016-05-11 17:04:51 +01:00
Nicholas Staples
03f15d6af9
Update now to utcnow. All tests passing.
2016-05-11 10:56:24 +01:00
Martyn Inglis
8669a169eb
Merge branch 'master' into primary-provider
...
Conflicts:
app/dao/notifications_dao.py
app/dao/provider_statistics_dao.py
app/schemas.py
tests/app/conftest.py
2016-05-10 09:13:02 +01:00
Martyn Inglis
571686b638
Ensure that the primary provider is used in all tasks
2016-05-10 09:04:22 +01:00
NIcholas Staples
f06aaa924e
Merge pull request #287 from alphagov/statistics_group_by_week_backup
...
Group by Notification Statistics added and all tests working.
2016-05-09 10:17:37 +01:00
NIcholas Staples
448d1058b8
Merge pull request #288 from alphagov/purge_functional_test_data
...
Purge functional tests command added with passing test.
2016-05-09 10:17:25 +01:00
Nicholas Staples
9b3d4a6087
Template history endpoint added. All tests passing.
...
Code quality fix.
2016-05-06 15:47:13 +01:00
Nicholas Staples
d40d9f76d4
Purge functional tests command added with passing test.
...
Code quality fix.
2016-05-06 11:16:30 +01:00
Martyn Inglis
4f38039e09
Set up clients wrapper to hold all the clients
...
- tests FAIL if there is a provider in the DB and not in the CODE
- tests PASS is there a provider in the CODE and not in the DB
2016-05-06 09:47:06 +01:00
Martyn Inglis
57e05feafb
Updated the Provider stats and rates DAO objects to query based on the identifier in the ProviderDetails object.
...
- updated all tests
- changed teardown to leave provider details rows on end of individual tests
2016-05-06 09:09:47 +01:00
Nicholas Staples
f465066a69
Group by Notification Statistics added and all tests working.
...
Fixed tests for upgraded client.
2016-05-05 11:04:20 +01:00
NIcholas Staples
519b912edc
Merge pull request #271 from alphagov/limit_msg_size
...
Hard sms limits added to the api for send_notification and create_tem…
2016-04-29 12:29:05 +01:00
NIcholas Staples
7121a50cd1
Merge pull request #273 from alphagov/provider_statistics
...
Fragment count endpoint added and all tests working.
2016-04-29 12:28:54 +01:00
Nicholas Staples
f71dbe9c0f
Message limit added and all tests passing.
2016-04-29 10:36:59 +01:00
Adam Shimali
4e81695c84
Added limit_days filter to get notifications dao.
2016-04-28 16:51:19 +01:00
Nicholas Staples
bedc20d0ff
Fragment count endpoint added and all tests working.
2016-04-28 12:01:57 +01:00
Chris Hill-Scott
deb8889e8e
Merge pull request #268 from alphagov/align-statistics
...
Align date range for template + notification stats
2016-04-27 11:54:51 +01:00
Adam Shimali
f71b626089
Merge pull request #267 from alphagov/events
...
Endpoint for recording events in api.
2016-04-27 11:37:33 +01:00
Chris Hill-Scott
d7f6bb9976
Align date range for template + notification stats
...
We were using two different queries to filter template stats to the past
7 days, plus today.
Since we’re storing both as short dates, we can now use the same query
for both.
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
-------|---------|-----------|----------|--------|----------|--------|-------
Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday | Monday
So if we are on Monday, the stats should include today, plus everything
back to last Monday.
Previously the template stats query was only going back to the Tuesday.
This should mean the numbers on the dashboard always line up.
2016-04-27 11:11:09 +01:00
Adam Shimali
dacbbfbf2f
Endpoint for recording events in api.
...
An event has an id, a type and a blob of json attached.
2016-04-27 10:36:59 +01:00
Rebecca Law
94aab20317
Add created_by_id to jobs table.
...
The user logged in will be the user marked as creating the job.
The admin code already sends the created_by user when creating a job.
2016-04-26 16:15:34 +01:00
Nicholas Staples
e6cc3b1724
Added functionality to archive a template.
...
Renamed migration file.
2016-04-26 10:11:18 +01:00
Adam Shimali
886f302993
Removed unused code
2016-04-25 17:21:55 +01:00