Commit Graph

15 Commits

Author SHA1 Message Date
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Ryan Ahearn
e07b596857 Remove contact list db, dao, and s3 code 2023-04-12 15:01:24 -04:00
Steven Reilly
ff4190a8eb Remove letters-related code (#175)
This deletes a big ol' chunk of code related to letters. It's not everything—there are still a few things that might be tied to sms/email—but it's the the heart of letters function. SMS and email function should be untouched by this.

Areas affected:

- Things obviously about letters
- PDF tasks, used for precompiling letters
- Virus scanning, used for those PDFs
- FTP, used to send letters to the printer
- Postage stuff
2023-03-02 20:20:31 -05:00
stvnrlly
b50cb4712f tz utility swap and many test updates 2022-11-10 12:33:25 -05:00
Katie Smith
807db037eb Update flake8 from 3.8.4 to 4.0.1
And adds `noqa` to some non-errors which are being flagged.
2022-03-02 15:52:18 +00:00
Ben Thorner
a91fde2fda Run auto-correct on app/ and tests/ 2021-03-12 11:45:45 +00:00
Chris Hill-Scott
682cbc5130 Don’t return jobs sent from contact lists
Now that we’re grouping jobs sent from contact lists within their
parent, they shouldn’t also be listed on the jobs page at the top level.

The jobs page uses the uploads API, not the jobs API, so this commit
makes sure that filtering is happening in the proper place.
2020-12-01 15:26:36 +00:00
Chris Hill-Scott
c61f7e70c2 Add comments to explain time intervals 2020-05-13 08:53:40 +01:00
Chris Hill-Scott
864c6772b3 And an endpoint to get uploaded letters for a day
Because we won’t be showing uploaded letters individually on the uploads
page any more we need a way of listing them. This should be by printing
day, to match how we’re grouping them on the uploads page.

The response matches a normal `get_notifications` response so we can
reuse the same code in the admin app.
2020-05-11 10:51:40 +01:00
Chris Hill-Scott
421c1aac96 Group uploaded letters by day of printing
Some teams have started uploading quite a lot of letters (in the
hundreds per week). They’re also uploading CSVs of emails. This means
the uploads page ends up quite jumbled.

This is because:
- there’s just a lot of items to scan through
- conceptually it’s a bit odd to have batches of things displayed
  alongside individual things on the same page

So instead this commit starts grouping together uploaded letters. It
does this by the date on which we ‘start’ printing them, or in other
words the time at which they can no longer be cancelled.

This feels like a natural grouping, and it matches what we know about
people’s mental models of ‘batches’ and ‘runs’ when talking about
printing.

The code for this is a bit gnarly because:
- timezones
- the print cutoff doesn’t align with the end of a day
- we have to do this in SQL because it wouldn’t be efficient to query
  thousands of letters and then do the timezone calculations on them in
  Python
2020-05-11 10:51:33 +01:00
Pea Tyczynska
8b60e69157 Finding only jobs and letters within data retention works and tested 2020-03-10 15:53:56 +00:00
Chris Hill-Scott
c7895df82c Return recipient for letter uploads
If your caseworking system always spits out files with the same name it
will be hard to differentiate them when looking at the uploads page.

Seeing who the letter was sent to will help you differentiate them.

We can’t do this until the API returns the recipient.
2020-02-27 13:19:51 +00:00
Chris Hill-Scott
57e671267c Return template type in uploads response
We need template type for the uploads response, which will eventually
supercede the jobs response. At the moment the page uses both.
2020-02-26 16:14:57 +00:00
Rebecca Law
921b90cdec Add type=int to request.args.get, if the arg is an int it's returned else None. This means we ignore the arg if its the wrong data type and we don't need to handle the error. 2019-12-06 13:10:38 +00:00
David McDonald
203e19bef3 Add uploads blueprint, the endpoint returns a combination of uploaded letters and jobs. The endpoint returns data about the uploaded letter or job, including notification statistics for the upload. The data is ordered by scheduled for and created_at.
It is likely this endppoint will need additional data for the UI to display, for the first iteration this will enable the /uploads page to show both letters and jobs. Only letter uploaded by the UI are included in the resultset.

Add file name to resultset.
2019-12-06 09:54:51 +00:00