Commit Graph

5397 Commits

Author SHA1 Message Date
Pea Tyczynska
f69bc50985 Move data back before dropping the column for downgrade 2018-07-31 17:58:19 +01:00
Pea Tyczynska
c5792f4d79 Migration file for email_branding fields update 2018-07-31 17:58:19 +01:00
Pea Tyczynska
c4bfd5479e Update EmailBranding model so it has separate name and text fields 2018-07-31 17:58:19 +01:00
Pea (Malgorzata Tyczynska)
6cbf73b491 Merge pull request #2025 from alphagov/fix_migration_versioning
Fix migration version numbering
2018-07-31 16:49:49 +01:00
Pea Tyczynska
cf20cea81c Fix migration version numbering 2018-07-31 16:44:21 +01:00
Pea (Malgorzata Tyczynska)
ea28b65871 Merge pull request #1999 from alphagov/drop_monthly_billing_table
Drop monthly billing table
2018-07-31 16:35:48 +01:00
Rebecca Law
f419bf7bdb Merge pull request #2022 from alphagov/fix-letter-rate-bug
Handle zero as a letter page count in billing.
2018-07-31 14:18:52 +01:00
Rebecca Law
2f120b30e8 Fix codestyle 2018-07-31 14:13:15 +01:00
Rebecca Law
ab28691a70 Add number to migration file name 2018-07-31 14:06:29 +01:00
Rebecca Law
cc36209564 Fix file name for migration script 2018-07-31 14:00:18 +01:00
Rebecca Law
7378232353 Added migration script 2018-07-31 13:54:37 +01:00
Rebecca Law
19890412c9 Added a cancelled notification status so that we can cancel letters before they are sent. 2018-07-31 13:52:04 +01:00
Pea Tyczynska
885ed1e8e3 Remove monthly_billing table from the database 2018-07-31 11:47:13 +01:00
Chris Hill-Scott
c8f307e838 Merge pull request #2016 from alphagov/quis-patch-1
Fix broken Markdown headings in README
2018-07-31 11:08:32 +01:00
Rebecca Law
ff2334937c Last night we had some letter notifications that were in permanent failure and had page count = 0.
This causes the create-nighlty-billing task to fail.
This will make sure that 0 is returned in this case.
2018-07-31 11:04:48 +01:00
Alexey Bezhan
536154d79f Merge pull request #2017 from alphagov/pyup-ignore-requirements-txt
Make pyup ignore requirements.txt
2018-07-31 11:01:12 +01:00
Alexey Bezhan
ce5bb1f762 Make pyup ignore requirements.txt
We don't want pyup.io upgrading sub-dependencies listed in the
requirements.txt file since it does it whenever a new version is
available regardless of what our application dependencies require.
2018-07-30 16:26:10 +01:00
Chris Hill-Scott
b8913b62ec Fix broken Markdown headings in README 2018-07-30 15:25:48 +01:00
Pea (Malgorzata Tyczynska)
018585eccc Merge pull request #1981 from alphagov/get_rid_of_monthly_billing
Remove monthly_billing table and all references to it
2018-07-30 11:48:34 +01:00
Pea Tyczynska
b28ec8beda Use old monthly_billing-related routes for new functions 2018-07-30 11:33:15 +01:00
Pea Tyczynska
4e49df2479 Delete MonthlyBilling model 2018-07-30 11:07:42 +01:00
Pea Tyczynska
ca2b350a99 Remove references to monthly_billing table from api 2018-07-30 11:07:42 +01:00
Pea Tyczynska
c0f309a2a6 Delete scheduled task to populate monthly_billing 2018-07-30 11:06:04 +01:00
Leo Hemsted
1d2e086109 Merge pull request #1994 from alphagov/fix-billing-update
make rebuild-ft-billing-for-day remove unused rows
2018-07-30 09:58:29 +01:00
Leo Hemsted
a826f6e924 make rebuild-ft-billing-for-day remove unused rows
if the billing data was incorrect and needs to be rebuilt, we should
remove old rows. Previously we were only upserting new rows, but old
no-longer-relevant rows were staying in the database. This commit
makes the flask command remove *all* rows for that service and day,
before inserting the rows from the original notification data after.

This commit doesn't change the existing nightly task, nor does it
change the upsert that happens upon viewing the usage page. In normal
usage, there should never be a case where the number of billable units
for a rate decreases. It should only ever increase, thus, never need to
be deleted
2018-07-26 19:10:30 +01:00
Tom Byers
f16c83954c Merge pull request #1988 from alphagov/add-spacing-changes-to-email-template
Brings in spacing changes to the email template
2018-07-25 15:48:07 +01:00
Tom Byers
d6603a0541 Brings in spacing changes to the email template 2018-07-25 15:28:23 +01:00
Rebecca Law
3a75a58c97 Merge pull request #1987 from alphagov/fix-unique-key-service_callback_api
Fix unique constraint on ServiceCallbackApi
2018-07-25 14:24:52 +01:00
Rebecca Law
2b0ec9353e Added missing migration file 2018-07-25 14:16:36 +01:00
Rebecca Law
a812060915 The unique constraint on SeviceCallbackApi was on service_id only.
Now that we have 2 types of api callbacks the constraint to be on service_id + callback_type.
2018-07-25 14:12:13 +01:00
Rebecca Law
e4bef01ae1 Merge pull request #1983 from alphagov/increase-days-to-calc-billing
Increase the number of days we calculate billing from 3 to 10 days.
2018-07-25 10:32:45 +01:00
Rebecca Law
4fc004b00a Increase the number of days we calculate billing from 3 to 10 days.
Log exception if the billing counts for letters are different in the dvla response file than what we collected.
2018-07-24 16:28:30 +01:00
Pea (Malgorzata Tyczynska)
1b21a12b83 Merge pull request #1971 from alphagov/add_task_to_send_complaints_on
Add and call task to send complaints on to service callback APIs
2018-07-24 15:07:09 +01:00
Leo Hemsted
d61300accb Merge pull request #1944 from alphagov/research-letter-time
create fake letter response files with variables timestamps
2018-07-20 12:22:44 +01:00
Leo Hemsted
5c4f3e246c make test dvla response file timestamps in a random order
since there'll be a bunch of threads running functional test tasks at
the same time, there's no point always trying to start from the same
second and then stepping back to the same one-second-back file each
time. Also, this leads us to an increased risk of race conditions.

This change takes the same thirty second range, but shuffles it. The
tests, since they're no longer deterministic, now use a new Matcher
object (w/ credit to alexey) to match any filename from within that
thirty second range
2018-07-20 12:09:00 +01:00
Leo Hemsted
0cfed3f514 create fake letter response files with variables timestamps
when a test letter is created on dev or preview, we upload a file to
the dvla ftp response bucket, to test that our integration with s3
works. s3 triggers an sns notification, which we pick up, and then we
download the file and mark the letters it mentions as delivered.

However, if two tests run at the same time, they'll create the same
file on s3. One will just overwrite the next, and the first letter will
never move into delivered - this was causing functional tests to
intermittently fail.

This commit makes the test letter task check if the file exists - if it
does, it moves back one second and tries again. It tries this thirty
times before giving up.
2018-07-20 12:09:00 +01:00
Leo Hemsted
6e87b36303 remove duplication shutdown loggers
also add **kwargs to make it celery4 compatible
2018-07-20 12:09:00 +01:00
Pea Tyczynska
3048c05850 Revert notification_id name change in delivery_status service_callback_task data 2018-07-20 11:22:38 +01:00
Katie Smith
87013d9399 Merge pull request #1970 from alphagov/notification-serialize-includes-sender
Include the notification sender name when serializing notifications
2018-07-20 10:39:48 +01:00
Katie Smith
af5c4d2872 Include the notification sender name when serializing notifications
The `serialize` method of the Notification model now includes the
`created_by_name`. If a notification was sent as a one-off message this
value will now be the name of the person who sent the notification. If
a notification was sent through the API or by a CSV upload we don't
record the id of the sender, so `created_by_name` will be `None`.

This change affects the data that gets returned from these endpoints:
* /v2/notifications/<notification_id>
* /v2/notifications
2018-07-20 09:37:50 +01:00
Pea Tyczynska
812f4d20dd Send complaints on to service callback APIs using an async task 2018-07-19 16:59:39 +01:00
Katie Smith
ff3a71a9ea Merge pull request #1963 from alphagov/get-one-messages-by-default
Add one_off filter when getting all notifications for a service
2018-07-19 10:26:54 +01:00
Katie Smith
b1cfa8942a Add one_off filter when getting all notifications for a service
Added the option to filter by one_off messages to the DAO function
`get_notifications_for_service`. Previously, one-off notifications
were not returned - this has changed so that the default is for
one-off notifications to be returned. Also simplified the `include_jobs`
filter for this function.

The DAO function gets used in 3 places - for the V1 and V2 API endpoints,
which will now start to return one-off messages. It also gets used by
the admin app which needs to pass in `include_one_off=False` to the
`get_all_notifications_for_service` where we don't want one-off
notifications to show, such as the API message log page.
2018-07-18 15:08:06 +01:00
Alexey Bezhan
8d48f41776 Merge pull request #1966 from alphagov/set-callback-history-type
Add callback_type to service callback history records
2018-07-18 14:57:16 +01:00
Alexey Bezhan
778909b189 Add callback_type to service callback history records
We've updated the current service callbacks to add callback types
in #1964, but since the table is versioned we also need to add a
type to the history records.

Even though they're not used anywhere at the moment this might make
it easier to restore from a history callback record in the future.
2018-07-18 13:57:42 +01:00
Pea (Malgorzata Tyczynska)
946e0b2700 Merge pull request #1964 from alphagov/send_complaints_to_service_teams
Send complaints to service teams
2018-07-18 13:19:34 +01:00
Pea Tyczynska
86978c225a Filter 'get_service_callback_api_for_service' to only get status updates
Also rename it to 'get_service_delivery_status_callback_api_for_service'
2018-07-18 11:36:39 +01:00
Pea Tyczynska
e81c395ab1 Assign delivery_status type to existing callbacks 2018-07-18 11:36:39 +01:00
Pea (Malgorzata Tyczynska)
8113d0e48f Merge pull request #1958 from alphagov/send_complaints_to_service_teams
Add callback_type column to service_callback_api table
2018-07-18 10:30:31 +01:00
Pea Tyczynska
183aa160c6 Add callback_type column to service_callback_api table
Also add service_callback_type table with allowed types
2018-07-17 16:54:00 +01:00