Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POLIO-1753: split pdf repository data per vaccine per round #1830

Merged
merged 25 commits into from
Dec 3, 2024

Conversation

quang-le
Copy link
Member

@quang-le quang-le commented Nov 26, 2024

Rounds can have several vaccines. The pdf table in the repository should reflect that and have one line per round per vaccine

Related JIRA tickets : POLIO-1753

Self proofreading checklist

  • Did I use eslint and black formatters
  • Is my code clear enough and well documented
  • Are my typescript files well typed
  • New translations have been added or updated if new strings have been introduced in the frontend
  • My migrations file are included
  • Are there enough tests
  • Documentation has been included (for new feature)

Doc

Comments in the code

Changes

  • Change get_queryset method of VaccineRepositoryViewSet to return a union of the rounds_queryset filtered by each vaccine (so: 1 queryset with all rounds with nopv2, 1 for mopv2 and 1 for nopv), so that rounds with multiple vaccines are duplicated.
  • Because we use a union queryset, all the filtering logic was moved to get_queryset because .filter() cannot be called on a union queryset
  • Filter pdfs by vaccine name
  • Add a 'vaccine` column in the table
  • Add tests

How to test

On a recent polio test DB:

  • Go to vaccine repository.
  • Find a campaign with multiple vaccines
  • There should be one line per vaccine and per round
  • Play with ordering and filtering

Print screen / video

Screenshot 2024-11-26 at 14 56 27

Screenshot 2024-11-26 at 15 11 27

Notes

Merges in to #1822

Follow the Conventional Commits specification

The merge message of a pull request must follow the Conventional Commits specification.

This convention helps to automatically generate release notes.

Use lowercase for consistency.

Example:

fix: empty instance pop up

Refs: IA-3665

Note that the Jira reference is preceded by a line break.

Both the line break and the Jira reference are entered in the Add an optional extended description… field.

quang-le and others added 7 commits November 22, 2024 14:58
- i.o 1 line per round, with vaccines aggegated
- add PolioTestCaseMixin+method to create campaign test data
- add method to add base test data: account, source, user
- rename round_number field to number
- move filters to get_queryset to avoid errors due to union queryset
- fix and add tests
@quang-le quang-le requested a review from mathvdh November 26, 2024 14:01
@quang-le quang-le marked this pull request as draft November 26, 2024 15:56
@quang-le
Copy link
Member Author

I put it back to draft status because the file filter is now buggy, but the rest can already be reviewed

@quang-le quang-le requested a review from kemar November 27, 2024 10:39
- if separate scopes per round: delete campaign scope
- else: delete round scopes
- delete unused scopes when switching scope type
- only loop through used scope when updating
@quang-le quang-le marked this pull request as ready for review December 2, 2024 12:31
Base automatically changed from add_test_methods to main December 3, 2024 10:16
Copy link
Member

@kemar kemar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

plugins/polio/api/vaccines/repository.py Outdated Show resolved Hide resolved
Co-authored-by: Marc Hertzog <[email protected]>
@quang-le quang-le added the postrelease Should be merged just after the release label Dec 3, 2024
@quang-le quang-le merged commit f316256 into main Dec 3, 2024
3 checks passed
@quang-le quang-le deleted the POLIO-1753_split_pdf_data_per_vaccine_per_round branch December 3, 2024 13:56
@beygorghor beygorghor added the user tested Has already been tested on staging label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postrelease Should be merged just after the release Released user tested Has already been tested on staging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants