Add ability for primary linked data to be updated when associated data is changing #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Primarily for the benefit of the PHA API, we need to signal when primary linked data is changing.
When a movement is linked to an import notification, the relationship is created between the two entities and saved, therefore triggering a change to the notification's
Updated
field.Should a change to the movement be processed, it does not need to link as it's already linked and therefore on the movement is updated.
The PHA API queries import notifications that have changed within a period of time by looking at the notification's
Updated
field. If an associated movement is changed then currently the linked notification will not be updated. This PR changes that behaviour and it updates each linked notification if the movement is deemed to be changing too.The logic for this has been kept within the Linking business space but included as a separate service.
The AssociatedDataService would also be used when GVMS data is handled by BTMS and linked to import notifications, although it's unclear at this stage if GVMS data will actually change once it has been created.
This PR proposes the changes for the BTMS team to review and critique.
A working assuming is that the
AssociatedDataService
'sUpdate
method will only be called with import notifications that already exist.The BTMS integration tests have not been run yet either.They look to have run as part of the build, despite quite a few being SKIPPED.