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

fix(FSADT1-1641)!: partial update using json-patch #1391

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

paulushcgcj
Copy link
Contributor

@paulushcgcj paulushcgcj commented Jan 16, 2025

Description

In order to make the newly updated edit screen more modular, we're using the JSON Patch approach, where we will send only what has changed to the backend in the form of a PATCH request. This should allow the backend to react based only on what's changed, applying the change on top of the existing data.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Documentation update

How Has This Been Tested?

  • New integrated tests

Checklist

  • I have read the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • 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
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have already been accepted and merged

Further comments


Thanks for the PR!

Deployments, as required, will be available below:
Any successful deployments (not always required) will be available here

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:


Thanks for the PR!

Deployments, as required, will be available below:
Any successful deployments (not always required) will be available here

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

- Updated the DTO to segregate data a bit better
- Added new information dto
- Added a new exception for partial change
- Updated reference code to use the new dtos
- Added json patch dependency
- Added initial code for partial update
- Updated class names
- Moved code to a utils file (PatchUtils.java)
- Implemented contact partial update
- Added id to contact dto
- Updated patch exception
- Updated contact repository
- Updated location repository
- Updated contact patch service (see below)
- Added Location patch service
- Added Contact to Location association service

The contact patch service will not handle contact association. It can handle add, remove and update of contact and it is marked to run right after the basic details information.

The contact location patch service will handle the location association, as this is almost like creating and removing contact, as it should do the same due to the way oracle handles the association.
- Tests are still failing
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.

1 participant