Adam Shimali
054d8baa0a
Changed notifications stats day column to date type from string.
2016-04-20 15:38:06 +01:00
Chris Hill-Scott
85d5c656f8
Merge pull request #241 from alphagov/get-notification-stats-last-7-days
...
Allow filtering of notification stats by days
2016-04-20 10:07:17 +01:00
Adam Shimali
a6a18c1a6f
This approach uses part of sqlalchemy example history_meta code
...
adapted to recording inserts and updates.
This removes need to manually create history tables.
Our code still remains in control of when history records are
created.
2016-04-19 17:13:26 +01:00
Chris Hill-Scott
9c2c9435e3
Allow filtering of notification stats by days
...
https://www.pivotaltracker.com/story/show/117920839
On the dashboard we want to show counts of notifications sent in the
last 7 days, plus today. So the API enpoint needs to accept an argument
to limit how many days worth of statistics it will return.
This is a bit fiddly at the DAO level because the date is just stored as
a string.
2016-04-19 16:44:19 +01:00
Nicholas Staples
31978bd987
Added page_size parameter for notifications api. All tests passing.
...
Add page_size and total parameters to all calls for notifications.
2016-04-19 11:26:21 +01:00
Nicholas Staples
f681d40366
Character count added and tests passing.
...
Remove sql restriction for count to not be null.
2016-04-15 16:31:13 +01:00
Rebecca Law
cf883ed339
Merge pull request #217 from alphagov/update_uuid_all_db_models
...
Update uuid all db models
2016-04-13 11:59:40 +01:00
Chris Hill-Scott
29b9e50952
Order templates by last updated date
...
The template you want to send/edit is probably one of the ones you
recently sent from or edited.
https://www.pivotaltracker.com/story/show/117159263
2016-04-11 17:39:49 +01:00
Nicholas Staples
90f0505a3d
Update limit to message_limit.
...
Further db changes and updates.
Remove traceback print out.
Fix bug in passing template id to a task.
2016-04-11 16:53:40 +01:00
Adam Shimali
4ed2e7f8f2
Fix for misunderstanding about date range required for templates
...
stats.
It should always be last n days, whether or not there is data.
2016-04-07 09:30:02 +01:00
Adam Shimali
3057641e40
Change sort order for templates from name to date using full timestamp
...
so that it would be most recently used at top.
2016-04-06 14:30:13 +01:00
Nicholas Staples
4d15409781
Successful notifications are deleted after a week now. All tests passing.
2016-04-05 11:07:21 +01:00
Adam Shimali
f6620792b5
Additional sort order by template name for template statistics.
2016-04-04 17:51:24 +01:00
Adam Shimali
0d06be05e1
[WIP] Added dao method and rest endpoint for getting template
...
statistics by service.
Some cosmetic changes to imports.
Added fix for job rest not correctly returning errors.
2016-04-04 14:38:54 +01:00
Nicholas Staples
fac34aff10
Added functionality to allow filtering by multiple arguments.
...
Removed commented out code.
2016-04-04 13:21:51 +01:00
Adam Shimali
ca9c886c3e
[WIP] On create of notification. Upsert record for template stats
...
recording usages of template by day.
2016-03-31 15:57:50 +01:00
Rebecca Law
c7c845cea6
Remove access_developer_docs as a permission type. It does not make sense to have permission for viewing the documentation.
...
On the downgrade method of the db script the assumption that all users with manage_api_keys had the access_developer_docs permission.
2016-03-29 17:00:42 +01:00
Rebecca Law
376a074f5f
Add view_activity permission so that users can have the default permission to see activity.
...
Add view_activity to default permissions when adding a new user.
Add view_activity as a permission group, used when inviting a user.
2016-03-29 15:35:34 +01:00
Nicholas Staples
3a59c75257
Transaction management added for one example. All tests passing.
2016-03-23 16:30:47 +00:00
Nicholas Staples
090babaaeb
Added endpoint for removing user from service, all tests passing.
2016-03-22 13:14:23 +00:00
Martyn Inglis
268819284f
Merge branch 'master' into capture-delivery-outcomes
...
Conflicts:
tests/app/notifications/test_rest.py
2016-03-21 13:32:31 +00:00
Martyn Inglis
e0316d1881
Adds notification stats update into the callback process
...
- when a provider callback occurs and we update the status of the notification, also update the statistics table
Adds:
- Mapping object to the clients to handle mapping to various states from the response codes, this replaces the map.
- query lookup in the DAO to get the query based on response type / template type
Tests around rest class and dao to check correct updating of stats
Missing:
- multiple client callbacks will keep incrementing the counts of success/failure. This edge case needs to be handle in a future story.
2016-03-21 13:24:37 +00:00
Nicholas Staples
327f169575
Filtering added and tests working.
2016-03-21 12:37:34 +00:00
Martyn Inglis
69654f4209
Parking some code that updates stats when notification delivery happens
2016-03-15 14:40:42 +00:00
Martyn Inglis
beb6f7ca57
Order jobs by service
...
- newest first
2016-03-14 16:15:39 +00:00
Martyn Inglis
1ff4ebad5c
Merge branch 'master' into client-callbacks
...
Conflicts:
app/notifications/rest.py
tests/app/celery/test_tasks.py
2016-03-14 11:45:21 +00:00
Martyn Inglis
fd973179cc
- Commit session on job update
...
- log at exception level
2016-03-14 11:34:09 +00:00
Rebecca Law
123b0ead3a
Replaced first queries with one queries, which throws a NoResultFound.
...
Able to remove many of the None checks as a result of this.
Fixed the tests were needed.
2016-03-11 15:34:20 +00:00
Rebecca Law
e055590b07
Changed db queries to use one, which throws NoResultFound exception, this exception is dealt with in our error handlers.
...
Now a lot of the if none checks can be removed.
2016-03-11 12:39:55 +00:00
Martyn Inglis
62a7b8bcd0
Update notification status by message reference
...
- SES sends a reference to allow us to identify the notification
- use this to update status
If source of email is one of our internal emails (invites or validations) - don't try and update a notification.
2016-03-11 10:19:40 +00:00
Martyn Inglis
901d04605f
Ad a reference to the model
...
- used if 3rd party needs to record an ID for reconciliation purposes
2016-03-11 09:40:35 +00:00
Martyn Inglis
f88f86a924
Endpoint to allow SES updates to occur
...
- update notification with delivery state
2016-03-10 17:29:17 +00:00
Martyn Inglis
1f22f2b7cc
Updates to fire text integration:
...
- client updated to raise errors with fire text error codes/messages
New endpoint
- /notifications/sms/firetext
For delivery notifications to be sent to.
2016-03-10 15:40:41 +00:00
Martyn Inglis
fd7eb54d10
Merge branch 'master' into delete-expired-things
...
Conflicts:
app/celery/tasks.py
tests/app/celery/test_tasks.py
tests/app/dao/test_notification_dao.py
2016-03-10 09:48:29 +00:00
Martyn Inglis
976a4c06e3
Renamed some files and fixed a bug on deleting the failed notifications
2016-03-10 09:34:27 +00:00
Martyn Inglis
c8a5366484
Scheduled tasks to clean up the database
...
- tasks run hourly
- uses celery beat to schedule the tasks
4 new tasks
- delete verify codes (after 1 day)
- delete invitations (after 1 day)
- delete successful notifications (after 1 day)
- delete failed notifications (after 7 days)
Delete methods in the DAO classes
2016-03-09 17:46:01 +00:00
Martyn Inglis
2a13fe4a54
Merge branch 'master' into rate-limit
...
Conflicts:
app/celery/tasks.py
tests/app/celery/test_tasks.py
2016-03-09 14:16:59 +00:00
Martyn Inglis
61a0cf32c8
Ensure clients have rate limit enforced
...
- rate limiting is a hard number per day
- not limited in terms of rate of request
- limit is a single number held against the service
- every notification counts against the limit, regardless of type
- return a 429 if limit exceeded.
2016-03-09 11:06:37 +00:00
Rebecca Law
49198b26e7
Merge branch 'master' into reset-password
...
Conflicts:
app/schemas.py
tests/app/celery/test_tasks.py
2016-03-09 09:36:57 +00:00
Martyn Inglis
67c4bd2263
Build rest endpoint to read service stats
...
- get stats by service id
- returns a list of stats objects
Not paginated - have 1 row per day.
2016-03-08 16:34:03 +00:00
Martyn Inglis
f5f50e00ff
New notification stats table
...
- to capture the counts of things that we do
- initial commit captures when we create an email or sms
DOES NOT know about ultimate success only that we asked our partners to ship the notification
Requires some updates when we retry sending in event of error.
2016-03-08 15:23:19 +00:00
Rebecca Law
d840b8d689
Merge branch 'master' into reset-password
2016-03-08 15:05:18 +00:00
Rebecca Law
ba337374fd
- Remove password_changed_at from the update_dict in users_dao
...
- Format dates in UserSchema
- Properly formatted subject and message body for the password reset email
- Add name to the message for reset password
2016-03-08 14:33:06 +00:00
Martyn Inglis
ae395b490e
Fixed bug where I forgot to update only the right job :-(
2016-03-04 15:54:43 +00:00
Martyn Inglis
c44aaf0fdc
Capture the count of sent notifications for a job
2016-03-04 14:25:28 +00:00
Nicholas Staples
ebec54cb80
Permission enums corrected, all tests passing.
2016-03-02 15:34:26 +00:00
Nicholas Staples
01f616eeac
Fix all tests.
2016-03-02 11:10:52 +00:00
Nicholas Staples
6f689a187e
Merge remote-tracking branch 'origin/master' into update_permission_endpoints
2016-03-02 10:44:38 +00:00
Nicholas Staples
47c4368007
Merge with master.
2016-03-01 17:18:46 +00:00
Rebecca Law
a2b1dc0432
Merge pull request #115 from alphagov/accept-invite
...
[WIP] Start of api for accepting invite.
2016-03-01 15:57:52 +00:00