Refactor user actions to link to filing and submission#563
Refactor user actions to link to filing and submission#563michaeljwood wants to merge 4 commits intocfpb:mainfrom
Conversation
| @computed_field | ||
| @property | ||
| def signatures(self) -> List[UserActionDTO]: | ||
| return [action for action in self.user_actions if action.action_type == UserActionType.SIGN] |
There was a problem hiding this comment.
We want to make sure to maintain ordering so that the list is time ordered descending.
| SIGN = "SIGN" | ||
| CREATE = "CREATE" | ||
| class UserActionType(StrEnum): | ||
| SUBMIT = ("SUBMIT",) |
There was a problem hiding this comment.
What's the purpose of using tuples here instead of straight strings? Seems unnecessary (nor do I see this as being a preferred approach)
There was a problem hiding this comment.
That was a formatting mistake. I had added commas (bad habits, whoops), and black automatically added the parentheses. Unfortunately I missed that when committing, but I'll fix it.
I changed it to StrEnum though, as I believe that is now the recommended approach as to my understanding the handling of (str, Enum) was changed in a minor Python version, and this allows me to use it in an f-string and have it replaced with the string value.
…escending by timestamp. closes cfpb#554
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Refactor user actions to link to filing and submission directly.
Remove direct links from FilingDAO and SubmissionDAO. Update DTOs to make existing links to user_action entities be derived. Update API accordingly.
closes #551
Need to do some more testing before calling this good (especially with migrating some of the data, as I didn't have any existing data points for signing for example). I also had a couple TODOs/questions to deal with.
The biggest questions I had were in the sign_filing method. I left the separate commit to create a sign action so that the DB timestamp could be used.