Commit Graph

5213 Commits

Author SHA1 Message Date
Rebecca Law
64f077f2f4 New endpoint to return data for complaints. 2018-06-05 14:25:24 +01:00
Rebecca Law
2bc6315408 Merge pull request #1896 from alphagov/handle-ses-complaints
Save complaints from SES
2018-06-05 11:05:24 +01:00
Rebecca Law
7fa42c2cc5 When SES callback is for a complaint save that to the new complaints table.
When handling the complaint we don't want to throw an exception if the message is missing fields. Only log an exception if we are unable to tie a complaint to a notification.
2018-06-04 17:29:58 +01:00
Richard Chapman
3a7fe69ef7 Merge pull request #1860 from alphagov/pyup-update-flask-0.12.2-to-1.0.2
Update flask to 1.0.2
2018-06-01 14:07:34 +01:00
Richard Chapman
32b176ccc3 Merge pull request #1862 from alphagov/pyup-update-monotonic-1.4-to-1.5
Update monotonic to 1.5
2018-06-01 14:07:24 +01:00
Richard Chapman
b3bc91f189 Merge pull request #1895 from alphagov/rc_add_service_contact_link_to_db
Added Service contact_link column
2018-06-01 14:07:13 +01:00
Richard Chapman
2daaa5e19c Rebase of master and increment filename for as there was already a 196
migration script.
2018-05-31 16:30:14 +01:00
Richard Chapman
aaba157587 Added Service contact_link column
This is going to be used for for the document download citizen landing
page, a service will add a contact link
e.g. https://customerservicecontactnumber.uk/dwp/ which will allow the
user to contact the sending department if there is an error or any
issues with the download.

* Added the contact link to the model
* Added db migration script to add the column to the database
2018-05-31 16:03:12 +01:00
Rebecca Law
06807c3d16 Merge pull request #1894 from alphagov/handle-ses-complaints
Handle ses complaints
2018-05-31 15:52:18 +01:00
Rebecca Law
1faba916b2 New complaints model to persist complaints from SES.
If a someone gets an email from one of our services and then complain about it (mark as spam or otherwise), we get a callback from SES.
The service needs to know about these complaints so they can remove that email from their mailing list.
2018-05-31 14:43:49 +01:00
Rebecca Law
23e6b57c26 Remove email from the log message 2018-05-30 16:45:18 +01:00
Rebecca Law
621c81a9d8 Small refactor to reduce complexity and satisfy codestyle.
This module could do with a look to check if we can simplify it. But at the moment we just want to record the complaint.
2018-05-30 16:25:49 +01:00
Rebecca Law
e82fa2c8d4 Added a way to handle complaint responses from SES.
At this point we are just logging the message so that we can confirm the contents of the SES message.

refer to: https://www.pivotaltracker.com/story/show/157969699
2018-05-30 16:16:36 +01:00
Rebecca Law
9fcfcd5127 Merge pull request #1893 from alphagov/fix-date-issue-for-letters
Fix BST bug
2018-05-30 11:21:11 +01:00
Rebecca Law
41f3293cd5 This fixes a bug where the folder name was not correctly returning the right date because date used to compare was in UTC but the datetime used for the job start time is in BST.
Units tests have been added for the affected method.
2018-05-30 10:18:37 +01:00
Katie Smith
13c3aaa1b1 Merge pull request #1888 from alphagov/add-timestamps-to-ft-notification-status
Add created_at and updated_at columns to ft_notification_status
2018-05-24 11:35:40 +01:00
Katie Smith
27e66b8506 Merge pull request #1887 from alphagov/pyup-update-pytest-3.5.1-to-3.6.0
Update pytest to 3.6.0
2018-05-24 11:35:33 +01:00
Katie Smith
4d27972c90 Add created_at and updated_at columns to ft_notification_status
Added created_at and updated_at to the ft_notification_status table in order
to make it easier to track down any potential issues with the data.

Also updated the command to populate the data to take created_at and
updated_at into account and to simplify the command. This can all be done in
the same commit since the table is not being used anywhere yet and can
only be populated manually.
2018-05-24 10:51:38 +01:00
Katie Smith
369865cd82 Merge pull request #1885 from alphagov/ft-billing-created-at-non-nullable
Update created_at column of ft_billing to be non-nullable
2018-05-23 12:15:55 +01:00
Katie Smith
29a3264e9b Merge pull request #1873 from alphagov/pyup-update-eventlet-0.22.1-to-0.23.0
Update eventlet to 0.23.0
2018-05-23 12:15:47 +01:00
Katie Smith
105fcb6a67 Merge pull request #1879 from alphagov/pyup-update-pyjwt-1.6.1-to-1.6.3
Update pyjwt to 1.6.3
2018-05-23 12:15:39 +01:00
pyup-bot
95b8cd3819 Update pytest from 3.5.1 to 3.6.0 2018-05-23 12:04:30 +01:00
Katie Smith
c6c118fea1 Update created_at column of ft_billing to be non-nullable
`created_at` was added previously and made nullable temporarily. This
commit now populates the column, ensures that it will always have a
value, and makes `created_at` non-nullable.
2018-05-23 11:09:13 +01:00
Rebecca Law
b405b131f6 Merge pull request #1886 from alphagov/ft_billing-migration-fixes
Fix how the letter rates are selected
2018-05-23 11:07:59 +01:00
Leo Hemsted
9b7cd15586 Merge branch 'master' into pyup-update-monotonic-1.4-to-1.5 2018-05-23 09:59:00 +01:00
Katie Smith
0bd5a12a9c Merge pull request #1884 from alphagov/add-timestamps-to-ft-tables
Add timestamp columns to ft_billing table
2018-05-23 09:49:01 +01:00
Rebecca Law
1567e9bfe5 In order to correctly select the rate for letters you need the billable_unit or page count to use to match on the letter_rates.
A new column is added to the query to populate ft_billing which is only populated for letter.
2018-05-22 17:35:21 +01:00
Katie Smith
f6039d51e0 Add timestamp columns to ft_billing table
Added `created_at` and `updated_at` to the `ft_billing` table - having these
columns makes it easier to track down issues with the data in this table.

`created_at` is nullable initially, but will be changed to non-nullable
once the column is populated and the DAO etc. have been updated.
2018-05-22 14:32:49 +01:00
Katie Smith
b5734010b8 Merge pull request #1883 from alphagov/delete-provider-statistics-table
Add migration to drop unused provider_statistics table
2018-05-22 09:38:47 +01:00
Katie Smith
ee22365b9d Merge pull request #1880 from alphagov/pyup-update-marshmallow-2.15.1-to-2.15.3
Update marshmallow to 2.15.3
2018-05-22 09:38:39 +01:00
Katie Smith
3d8ce39984 Migration to drop unused provider_statistics table 2018-05-22 08:57:13 +01:00
Katie Smith
937fb1f529 Merge pull request #1881 from alphagov/remove-unused-endpoint
Delete unused endpoint and model
2018-05-22 08:56:29 +01:00
Katie Smith
0d4fb81235 Delete ProviderStatistics model
This is not being used anywhere, so can be deleted safely.
2018-05-21 15:03:39 +01:00
Katie Smith
71796311fa Delete unused aggregate_statistics endpoint
`@service_blueprint.route('/<uuid:service_id>/fragment/aggregate_statistics')`
is not being used anywhere, so has been removed. The `provider_statistics_dao`
can also be removed, since the function this contained was only used for
the endpoint.
2018-05-21 15:03:39 +01:00
Rebecca Law
46e4af8876 Merge pull request #1882 from alphagov/ft_billing-migration-fixes
Add rate to the primary key of ft_billing.
2018-05-21 15:00:49 +01:00
Rebecca Law
e5584348ef Add rate to the primary key of ft_billing.
Use the primary key constraint in the upsert statement (easier to read than listing all the columns)
2018-05-21 14:38:25 +01:00
Rebecca Law
4df7026ca8 Merge pull request #1878 from alphagov/fix-ft-billing-migration
Fix ft billing migration
2018-05-21 12:06:48 +01:00
Rebecca Law
e4e253ce44 Remove where clause for notification_status 2018-05-21 11:54:49 +01:00
Rebecca Law
c2b888a6af Make sure the date does not include time 2018-05-21 11:51:06 +01:00
Rebecca Law
4d8255b8d9 Merge branch 'master' into fix-ft-billing-migration 2018-05-21 11:06:31 +01:00
Rebecca Law
9fad623d91 Update the ft_billing query to only include billable notification status types.
Update test_provider_statistics dao - this is really irrelevant since the endpoint using the query is not being used. We have a PR coming to delete the unused code.
Update rate_multiplier to always be an integer
2018-05-21 10:56:16 +01:00
pyup-bot
84c3f53902 Update marshmallow from 2.15.1 to 2.15.3 2018-05-20 19:11:35 +01:00
pyup-bot
42583cbae7 Update pyjwt from 1.6.1 to 1.6.3 2018-05-19 18:27:32 +01:00
Rebecca Law
64aec4a64c Update the command to migrate data for ft_billing.
There is a massive performance improvement.
Another commit will need to alter the pk to include rate.
2018-05-18 17:22:51 +01:00
Rebecca Law
4b36fe0d9e Use created_at for the rate, there are some rows that do not have a sent_at set. 2018-05-17 13:37:55 +01:00
Rebecca Law
1969c83f57 Fix letter rate bug in migtion 2018-05-17 10:06:58 +01:00
Katie Smith
4f2412056a Merge pull request #1877 from alphagov/stop-update-for-previous-year
Refactor usage queries and stop rebuilding monthly_billing when not needed.
2018-05-16 14:11:23 +01:00
Rebecca Law
3c90c0ffcd Fix code style 2018-05-16 13:18:36 +01:00
Rebecca Law
eb083e30ed - Only rebuild current month for monthly_billing if today is in the current year.
- Change the usage queries to a union so that billing_units is correct for all notification types. Removing the business logic from the schema.
- Added tests for different fragment counts, rates and sheet counts.
2018-05-16 12:21:59 +01:00
Chris Hill-Scott
de95a28b7c Merge pull request #1876 from alphagov/fire-police-logos
Add letter logos for TWFRS and Thames Valley Police
2018-05-16 11:07:18 +01:00