Martyn Inglis
8389976250
Use service ID, not from token to build notification
2016-02-24 11:11:02 +00:00
Martyn Inglis
b0609b1813
More refactors
...
- single base method to send notifications
- knows about service id (present if job based)
- knows about jobs - if needed
- knows about type
Does the right thing
Was lots of shared code around error checking now in one place.
2016-02-24 09:55:05 +00:00
Martyn Inglis
0007c69972
Restored code to share sms creation logic between:
...
- sms for API calls
- sms for Jobs
2016-02-24 09:23:21 +00:00
Martyn Inglis
201c2d01ba
Task is the same whether job based or not
...
- use notification to build action
- notification has job
- based in encrypted blob
2016-02-23 17:39:08 +00:00
Martyn Inglis
635debb5a6
Moved the sending sms for a job into celery tasks
2016-02-23 17:30:50 +00:00
Martyn Inglis
c694dae933
Refactored to make email and sms template check the same
2016-02-23 12:35:28 +00:00
Martyn Inglis
b01782bbe6
Send Email via the API
...
- uses the new subject/email from fields present on the templates / service tables
- brings the send email api call into line with the sms one.
- same fields (to/template_id)
- same rules regarding restricted services
- wired in as a task into celery
Requires
- new celery queue
- new env property (NOTIFY_EMAIL_DOMAIN)
2016-02-22 17:17:29 +00:00
Adam Shimali
4f33b6f406
Wire up error handlers.
...
Replace some 400s with more appropriate 500s.
DAO methods that cause unexpected exceptions get caught and
logged by errors.py 500 error handler.
2016-02-17 17:04:50 +00:00
Martyn Inglis
e0e47b40fc
Setup celery config
2016-02-17 10:22:25 +00:00
Martyn Inglis
0933e5c647
Building tests for the tasks class
2016-02-16 17:17:02 +00:00
Martyn Inglis
18d63e241b
Extracted serialiser for encryption into a flask module
...
- allows mocking easier
- shared across methods
- not built everytime
2016-02-16 15:28:30 +00:00
Martyn Inglis
e42da7dd54
Fixing up tests to validate the call to the celery tasks.
...
- mocker used to test call or otherwise of the task
- no new tests just a spring clean
2016-02-16 14:06:56 +00:00
Martyn Inglis
655beddba6
Fixed up the get_notitication endpoint
...
- returns a notification
2016-02-16 11:22:44 +00:00
Martyn Inglis
223cb8c2dd
Made SMS messages go through celery
...
- twilio client pulled in from delivery app
- made method to perform task
2016-02-15 16:01:14 +00:00
Martyn Inglis
ffbe94f390
Merge branch 'master' into celery-spike
...
Conflicts:
app/notifications/rest.py
2016-02-15 11:12:07 +00:00
Martyn Inglis
16c5e7bf10
Celery task added
2016-02-15 11:11:20 +00:00
Rebecca Law
a01828a6d0
Return notification_id on create notification endpoints
...
- /notification/sms
- /notification/email
- /notificaiton/sms/service/<service_id>
Update message attribute on SQS to notification_id from message_id
2016-02-10 12:46:52 +00:00
Nicholas Staples
1b25a3c762
Removed alpha client imports.
2016-02-09 16:13:48 +00:00
Nicholas Staples
68b6444eed
Comment added for missing code.
2016-02-09 16:02:38 +00:00
Nicholas Staples
2fda7ee59b
Alpha client removed from code. Tests fixed but will wait till other notifications jobs are done before creating a pull request.
2016-02-09 11:38:57 +00:00
Adam Shimali
0580f5ab06
New endpoint for delivery app to use.
...
Once removal of code that uses existing alpha is done, then
duplicated code from /notifications/sms and the new endpoint
can be merged.
Job id is now avaiable in notificaiton but is not used yet.
2016-02-08 14:54:15 +00:00
Rebecca Law
1d4d03dbe8
Update to create_sms_notification
...
Removed the logic to check the api_user is the admin client user name.
There is another controller method to handle sending the verification codes.
2016-02-04 12:07:26 +00:00
Nicholas Staples
6286646d7f
Fix for review comments.
2016-02-03 15:53:16 +00:00
Nicholas Staples
aba1cd2ed5
Sqs queues now populated from all create_notification api calls. Marshmallow schemas added for notification.
2016-02-03 13:16:19 +00:00
Rebecca Law
b5c662eca8
Change services.id to a UUID
...
Ideally all the primary keys in the db would be UUID in order to guarantee unique ids across distributed dbs.
This updates the services.id to a UUID. All the tables with a foreign key to the services.id are also updated.
The endpoints no longer state a data type of the <service_id> path param.
All the tests are updated to reflect this update.
The thing to pay attention to is the 0011_uuid_service_id.py migration script.
This commit must go with a commit on the notifications_admin app to keep things working.
There will be a small outage until both deploys have happened.
2016-02-02 14:22:22 +00:00
Rebecca Law
92cec8831e
Fix bug with sending sms
2016-01-28 12:44:05 +00:00
Rebecca Law
03989c09de
Add message id to message attributes
2016-01-28 11:09:25 +00:00
Rebecca Law
a546665188
Some code clean up.
...
Clean up the unit test.
2016-01-28 11:06:24 +00:00
Rebecca Law
42a4c8b0b1
Add sms notifications from a service to a queue.
2016-01-27 17:42:05 +00:00
Nicholas Staples
a9fe6ad469
Working code and tests.
2016-01-22 14:43:30 +00:00
Nicholas Staples
4739f3fbd2
Added send_email endpoint.
2016-01-20 13:14:23 +00:00
Martyn Inglis
7b756567af
Updated tests for fetch notifications by id, not simply fetch all
2016-01-19 13:45:57 +00:00
Martyn Inglis
d275ba83a2
Added endpoints for the proxy to notifications.
...
- this uses alpha API for delivery
- no DB model included as just proving
- all notifications for same service at the moment (!)
2016-01-19 11:23:09 +00:00