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

Update manifest service #657

Merged
merged 10 commits into from
Dec 6, 2023

Conversation

dpgraham4401
Copy link
Member

@dpgraham4401 dpgraham4401 commented Dec 6, 2023

Description

This is a relatively large PR. It adds the following to our project.

  1. a update_manifest internal service. It currently just updates the manifest in our system. There is not an exposed view/handler.
  2. Updates our model manager custom .save() method. We use our internal save method to abstract away the create/update process. It builds on existing Django ORM functionality.
  3. Refactor the logic of MtnListView handler/view into a service module function that allows us to filter all manifest by epa_id and site_type (for example, the get_manifest service could return all manifests that the user has access to a site that is listed as a generator). I'm happy with the way this turned out, it follows the django-styleguide approach of placing business logic into our service modules.
  4. MtnTable filtering now stores status/search state in URL search parameters so the link can be (1) revisited and (2) shared.
  5. miscelaneous other things like
    • replace yield with return where appropriate in our factories as fixtures.
    • update a few minor dependencies.
    • rename serializer/views to be internally consistent

Issue ticket number and link

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

…including breaking changes with the mock service worker (MSW) with significant breaking changes
… with the other managers and Django/DRF's svae mthods) and an optional instance (to update)

Rename serializer class files
convert model manager save method to class method
… (as if it came from JSON) to pass to the model manager save method
…manifests from the haztrak database. the new service allows us to filter (optionally) by EPA ID and/or site type.

replace logic in MtnListView with call to get_manifests service and add endpoint to MTN list category with site type parameter

update names of trak and sites (django apps) views to be internally consistent

use faker to mock manifest tracking numbers and create manifest_transporter_factory
…r filtering by status and a new MtnSearchField component.

The new filter fields stores and reads the state in a URL search parameter.

quick aria label fixes for MtnList
@github-actions github-actions bot added client Related to front end workings (React/Redux) database changes that require modification to the database schema dependencies project dependency problems or modifications server Related to backend workings (Django/Rest API) test Unit tests are, or need to be, included labels Dec 6, 2023
@dpgraham4401 dpgraham4401 merged commit b0ec7b6 into USEPA:main Dec 6, 2023
8 checks passed
@dpgraham4401 dpgraham4401 deleted the update_manifest_service branch December 6, 2023 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Related to front end workings (React/Redux) database changes that require modification to the database schema dependencies project dependency problems or modifications server Related to backend workings (Django/Rest API) test Unit tests are, or need to be, included
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant