Rebecca Law
973cc2c4c9
Changed the scheduled_for datetime to only send and hour of a day to send.
...
Also expect the date being passed in is BST. The date is converted to UTC before saving. And converted to BST when returning a notification.
2017-05-17 15:06:15 +01:00
Rebecca Law
a6529d2723
Return the scheduled_for datetime in the DATETIME_FORMAT from the post_notification
2017-05-16 09:57:58 +01:00
Rebecca Law
f0e2713bef
Add scheduled_for in the post notification request form.
...
Return scheduled for in get_notification requests.
2017-05-15 17:27:38 +01:00
Rebecca Law
38e5b31e9a
Update notification schemas with optional schedule_for element
2017-05-15 15:02:38 +01:00
Rebecca Law
bbdbb9079e
Fixed the template uri for the post notification responses.
...
It was optimistic to think the v2 templates would be complete.
2017-01-04 11:22:50 +00:00
Rebecca Law
7f9111fd90
Removed the oneOf validation in the get_notification_response schema.
2017-01-04 11:00:47 +00:00
imdadahad
fb114f4c80
Merge pull request #772 from alphagov/fix-v2-uri
...
Fix uri validation in v2 responses
2016-12-16 15:53:26 +00:00
Imdad Ahad
243c4e481f
Add uri validation to response schemas:
...
* Add to root uri and template.uri in responses
* Add tests to validate invalid or missing uri
* General refactoring for clarity
2016-12-15 16:39:15 +00:00
Rebecca Law
7a623de171
Added boby and subject to the get_notifications schema
2016-12-15 16:19:55 +00:00
Imdad Ahad
431ec8acad
Retrieve notifications by reference:
...
* Use get_notifications instead (references may not be unique)
2016-12-12 18:04:20 +00:00
Rebecca Law
4f9b295a5b
Merge pull request #766 from alphagov/fix-sms-sender
...
Fix the from number in the post_sms_response.
2016-12-12 16:46:00 +00:00
Rebecca Law
9973d74d09
Fix the from number in the post_sms_response. If the service.sms_sender is not set the FROM_NUMBER from the config is returned, which is the default for the notification.
2016-12-12 15:07:03 +00:00
Imdad Ahad
620a90fd7c
Make get_notifications return single notification by reference
2016-12-07 14:09:56 +00:00
Paul Craig
ab990679b3
Replace marshmallow with jsonschema
...
Created a new schema that accepts request parameters for the
get_notifications v2 route.
Using that to validate now instead of the marshmallow validation.
Also changed the way formatted error messages are returned because
the previous way was cutting off our failing `enum` messages.
2016-11-28 14:22:51 +00:00
Paul Craig
ffb813bb3f
Add get_notifications json schema + tests
...
Add a schema that corresponds to our response for returning lists
of notifications, and test with a contract test.
2016-11-25 16:50:20 +00:00
Paul Craig
1fce30aaa7
Cost savings
...
The "cost" value was flawed for a couple of reasons.
1. Lots of messages are free, so in those instances the "cost"
doesn't tell you anything
2. The query to get the rate was expensive and we don't have
an obvious way to get it back very efficiently for large numbers
of notifications.
So we scrapped it.
2016-11-25 15:23:03 +00:00
Rebecca Law
3cddc64e36
Merge pull request #741 from alphagov/fix-v2-post-notification
...
Small fixes for the V2 post notification endpoints
2016-11-22 16:28:13 +00:00
Rebecca Law
46beece158
For the post_sms_response and post_email_response the reference property is always present but the value can be null.
...
Added a test for an empty reference.
Remove datetime format on the created_at attribute of a notification, it is not needed.
2016-11-21 17:32:36 +00:00
Paul Craig
82ba2cd226
Create new notification schema
...
This is the schema that individual notifications will conform to
when they are returned from this API.
JSON logic enforces that the right keys are set depending on the
`"type"`. (eg a schema with `"type": "sms"` must have a
`"phone_number"` value and it cannot have an `"email_address"`)
2016-11-21 15:59:10 +00:00
Rebecca Law
bc434f1736
Create new column in notifications and notification_history to store the client_reference because I remembered that reference is used for email providers.
2016-11-17 13:42:34 +00:00
Rebecca Law
df62be421f
Make email_from and subject required attributes of the email_content schema.
...
Update the format_checkers to raise the specific exception that why the validator can handle multiple messages.
Which led to a refactor of build_error_message.
2016-11-16 17:25:00 +00:00
Rebecca Law
924cec05b4
Included reference when persisting the notification.
...
This was already part of the data model.
Not included in the send_sms|email task because there is no reference from the job.
2016-11-16 15:44:16 +00:00
Rebecca Law
b0ee09a9f6
Implemented the post email notifications endpoint for v2
2016-11-14 13:56:09 +00:00
Rebecca Law
482d10545b
Improvements to the tests.
...
Update AuthError with a to_dict_v2 method.
2016-11-01 10:33:34 +00:00
Rebecca Law
6e4bad135a
- Implemented persist_notification and send_notification_to_queue in the process_notifications module
...
- Not sure I want to create a new classmethod on Notifications to create from v2 request. Will take another look at that.
2016-10-27 17:34:54 +01:00
Rebecca Law
a5e07d8aff
V2 schemas for post sms notifications, post_sms_request and post_sms_response
2016-10-25 14:53:31 +01:00