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

Adding /cans/ endpoints and service layer refactor #2831

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

rajohnson90
Copy link
Contributor

What changed

I added POST, PUT, PATCH, and DELETE /cans/ as well as refactoring the api endpoints to go through a service layer and isolate business logic. All unit tests were updated to support this. The obligate_by property was also added to the CAN schema at Frank's request to support the consumption of the GET /cans/ endpoint in our related FE work. Finally openapi doc will be updated monday morning to include the new endpoints.

Issue

OPS-2781

How to test

  1. Run unit tests to ensure all new backend and existing functionality is still working
  2. Run cypress tests to verify that the front end still is interacting with existing GET /cans/ endpoints correctly.

Definition of Done Checklist

  • OESA: Code refactored for clarity
  • OESA: Dependency rules followed
  • Automated unit tests updated and passed
  • Automated integration tests updated and passed
  • Automated quality tests updated and passed
  • Automated load tests updated and passed
  • Automated a11y tests updated and passed
  • Automated security tests updated and passed
  • 90%+ Code coverage achieved
  • Form validations updated

…ng service layer for controller to call. Updating test to include more of /cans/ POST endpoint. Added two new auth client config fixtures.
…it tests. Functionality not complete because we are now using a service layer to isolate business logic. updated openapi doc to match new endpoint.
…d handle both situations. Using partial flag for deserialization in patch. removing unnecessary fields in patch-related tests.
…d test_service_patch_can to not rely on hard-coded id for table item.
…e'. Clean up patch/put unit tests so API tests are only testing API.
…it tests to test out the service and api layers separately.
Copy link
Contributor

@fpigeonjr fpigeonjr left a comment

Choose a reason for hiding this comment

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

🟢 tests pass

@@ -14,6 +26,7 @@ class BasicCANSchema(Schema):
description = fields.String(allow_none=True)
id = fields.Integer(required=True)
portfolio_id = fields.Integer(required=True)
obligate_by = fields.Integer(allow_none=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants