feat(status memo): Write onemac activity to the Status Memo field #352
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.
Purpose
This adds functionality to new submission and all package actions to write a log entry of what happened to Status Memo.
Linked Issues to Close
None
Helps enable https://qmacbis.atlassian.net/browse/OY2-26753
Approach
CMS sometimes uses the Status_Memo field in Seatool's State Plan table to keep a log of what updates people make to a state plan submission. We've been told specifically that when a medicaid RAI is withdrawn, we want to save the submission and withdrawn dates in the Status Memo, as the RAI data could eventually be overwritten.
In light of the RAi withdraw behavior that needs to write to Status Memo, and considering our broader capabilities, I think it's wise to write a log entry of the action taken by the OneMAC system against a record any time that record is modified.
So, in this PR, the submission action and all package actions that modify seatool records are updated. They're updated to send an additional query to add a new text entry to Status Memo.
Status Memo is modified from the top (newest on top), so the new text is appended to the beginning and ends with a newline.
Here's what Status Memo looks like for a test record where I've stepped through all actions:
I made a helper function to keep the query for each action consistent. I expect this will be refactored with the backend refactor, so I didn't stress to much about style. I did, however, make the choice of passing the message text as a function parameter, instead of passing just the action type. I like the flexibility of writing anything we want, and not being constrained to the action name.
Assorted Notes/Considerations/Learning