T1627 - Fix BeneficiaryMajorRevision GMC request handling #1941
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.
Description
There was a bug related to notifying a sponsor when information about his child changed. The sponsor would in fact be notified through the
BeneficiaryMajorRevision
GMC message, however the contents of the letter would be weird, for example 14'000 lines of repeating text.Technical Aspects
The first fix of this PR is that there was no mapping made for the 'Local Grade Level' to get the corresponding field from the json. This is why in the letter the grade was empty.
The second fix is a bit more complex and related to how we map the json to ORM methods, basically the
RevisedValues
field was mapped as having relation records through a foreign key, but it wasn't the case. So when the mapping was done we would have incorrect ORM methods which corrupted the data inside the table as time went on.Misc
The existing data in the table
compassion_major_revision
should be cleared since the data is wrong.