Commit Graph

188 Commits

Author SHA1 Message Date
Rebecca Law
55adc9239f Fix update script 2016-07-07 16:01:04 +01:00
Rebecca Law
638ea1b12b Set the start date for the new rate as July 1 2016-07-07 14:31:50 +01:00
Leo Hemsted
2b7972dc1d mmg rates set to 1.65p
note this db value not actually used in app yet
2016-07-06 16:02:10 +01:00
Rebecca Law
764bfc6203 Fix file name for migration script 2016-07-06 14:46:46 +01:00
Rebecca Law
a1209ed9a4 Merge branch 'master' into fix-count 2016-07-06 14:45:10 +01:00
Rebecca Law
8bea8b6a8f Fix bug where all notifications were getting a type = email.
Includes a fix to notification and notification_statistics data.
2016-07-06 14:31:52 +01:00
Leo Hemsted
a5e488c035 add test api key type 2016-07-05 16:20:02 +01:00
Adam Shimali
1f4fc77a1e Fix alembic clash. 2016-07-04 10:45:56 +01:00
Adam Shimali
19f2ccb594 Merge pull request #498 from alphagov/set-sms-sender-api
Set sms sender on service
2016-07-04 10:32:04 +01:00
Leo Hemsted
f992240192 make notification.key_type not nullable
set to 'normal' for all existing notifications, and all job notifications also created as 'normal' - so if your eg reporting service hits notify, it gets notifications created from both API calls and front-end csv jobs.
2016-07-01 16:36:11 +01:00
Adam Shimali
c29dd23702 Add sms sender to service to be used in sms templates
in place of default numeric short code.

If not present default short code is used.
2016-07-01 15:27:54 +01:00
Rebecca Law
25db1bce74 Use the notification types enum for the notifications.notification_type.
Reuse EMAIL_TYPE in template_types and notification_types.
2016-06-29 11:50:54 +01:00
Rebecca Law
60e159e3c0 Add notification_type to notification table.
It seems like an oversight not to include the notification type in the notifcation.
When updating statistics a query to the template table is required to get the type, this update will mean that query does not have to happen.
2016-06-29 11:23:02 +01:00
Rebecca Law
90ba1ec152 Add downgrade 2016-06-28 14:45:12 +01:00
Rebecca Law
abb9135e35 Password changed at is defaulted to the current date when the user is created.
This PR set the users.password_changed_at column to not be nullable.
2016-06-28 11:24:08 +01:00
Leo Hemsted
e9482c7fe1 add new key_type table
* single-column static data table that currently contains two types: 'normal' and 'team'
* key_type foreign-keyed from api_keys
  - must be not null
  - existing rows set to 'normal'
* key_type foreign-keyed from notifications
  - nullable
  - existing rows set to null
* api_key foreign-keyed from notifications
  - nullable
  - existing rows set to null
2016-06-24 15:56:54 +01:00
Rebecca Law
7f4d048d75 Fix downgrade to work if any notifications have status = 'created' 2016-06-21 15:55:39 +01:00
Rebecca Law
8caa688bf5 Add created as a status for notifications 2016-06-21 13:41:46 +01:00
Adam Shimali
731bb19a9c Template and personalisation content is now merged and returned with
notifications, when retrieved by notification id, or service id (i.e.
all notifications for service).

There is a new element returned at top level of notification json called
body, which is the template content merged with personalisation. This
is consistent with api to endpoint to create notification which returns
what was sent as 'body' in json response.

Merging of template with personalisation is done in the
NotificationStatusSchema.

Personalisation data in encrypted before storing in db.
2016-06-20 16:49:17 +01:00
Rebecca Law
f8262b13c1 Refactor permissions dao - removed custom query filter
Removed permissions rest - not being used.
2016-06-15 16:32:52 +01:00
Martyn Inglis
d5259be44c moved migration script from
https://github.com/alphagov/notifications-api/pull/412

To ship it quickly as preview broken without it.
2016-06-14 09:22:07 +01:00
Rebecca Law
ea80596e73 Correct template id for email verification template in the history table.
Correct personalisation name when sending registration message.
2016-06-13 14:57:59 +01:00
Nicholas Staples
bbd64b088b Added migration to add rate. Tested worked locally. 2016-06-08 10:34:09 +01:00
Rebecca Law
4d072cb113 Rename notify service to GOV.UK Notify 2016-06-07 09:55:10 +01:00
Rebecca Law
ba67b0c89d Change email address of user.
Removed permissions because it not a real user or person.
2016-06-03 10:51:34 +01:00
Rebecca Law
4910483f39 Add a service that will be used to send Notify's messages.
Including sms code, email verification, invitation emails, and password reset emails
Added the service id and template ids to config.
Small change to dao_create_service to use id if set.
2016-06-02 15:34:43 +01:00
Martyn Inglis
290f416485 Various tidy ups and changes
- use new queue
- remove some new lines in AWS response data
- migration script to populate new fields
2016-06-01 16:57:57 +01:00
Martyn Inglis
9aa727e0cf Add research mode to service/history tables
- added as a nullable boolean column.
2016-05-31 11:29:20 +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
a0b974f4ac Remove the status from the group by clause of the update statement.
This script has been applied to all environments except live, this can be pushed through to live without issue because of how alembic works.
2016-05-25 09:13:32 +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
Rebecca Law
e0864dfdb5 Data migration script to fix templates_history.updated_at.
There was a bug that was not setting the updated_at for the history table.
2016-05-20 15:56:07 +01:00
Nicholas Staples
0fe0c1d2b4 Added job row number to the notification for csv jobs. All tests passing. 2016-05-19 10:46:03 +01:00
Nicholas Staples
6e7383de33 Removed template subject uniqueness 2016-05-18 10:00:09 +01:00
Rebecca Law
191a79f27b Add new failure status for notifications. 2016-05-17 13:06:08 +01:00
Rebecca Law
8be3997bcf Merge branch 'master' into tech-failures 2016-05-17 12:05:48 +01:00
Rebecca Law
49db4e81d5 Add new notification status types for technical_failure, temporary_failure, permanent_failure 2016-05-17 11:46:28 +01:00
Adam Shimali
682ea55d9e [WIP] save reply to email address on service 2016-05-17 10:56:02 +01:00
Rebecca Law
992f9d78f9 There is a problem where columns on the templates table were not set.
It is also discovered that columns that have a default value and use the version mixin must set the value when creating the db object before the insert otherwise the history table will be missing the default value.
Updated the templates_history.created_by_id with a value where missing, using the current version of the template for this value.
Update templates_history.archived to false. This is okay as we do not yet have a way to set this value to true.
Removed the versions attribute from the TemplateSchema, there is not a need for this column.
2016-05-16 16:16:14 +01:00
Rebecca Law
a346eb2b19 Add a update query to fix templates_history where the created_by_id is missing. 2016-05-16 09:55:11 +01:00
Rebecca Law
894ec80e0e fix db migration to use the right previous version 2016-05-13 16:44:06 +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
cc9fcb42d9 Migration script to add template version to jobs and notifications. 2016-05-12 09:22:35 +01:00
Martyn Inglis
668f311a1a Merge branch 'primary-provider' of github.com:alphagov/notifications-api into primary-provider 2016-05-11 15:26:21 +01:00
Martyn Inglis
5c0dae9586 Added twilio into rebuilding the provider enum 2016-05-11 15:25:45 +01:00
Rebecca Law
5858861bb2 Remove constraints from downgrade so that it will work. 2016-05-11 14:15:53 +01:00
Martyn Inglis
6493e4db9c Made the downgrades work 2016-05-11 12:56:28 +01:00