-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add displayId virtual field to activity reports #162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codewise this looks fine, though I'm confused about the human-friendly identifiers. My (limited) understanding was that the 'R00-AR0' style identifier was used in SmartSheet and the plan was to use a different style for new identifiers. Further, old identifiers were going to be imported into a "legacy id" column and used to alias to the new id number. If we added this virtual field, wouldn't we be adding a third identifier that end users might see?
I'm not 100% sure what the legacy ID will be used for. My understanding from this slack conversation https://gsa-tts.slack.com/archives/C017RJ4GEET/p1612903356126900 is the legacy ID will be used to pull up old activity reports. Thoughts @rahearn? |
This is correct. The issue with the old reports is that every region had their own sheet, so there are duplicate numeric IDs. We can't just renumber them all when we import, because the old IDs may be referenced in narrative in other reports (a not-uncommon occurrence in the system in use last year). I suppose we could get rid of the legacy id column if we were able to use a compound primary key to get around the uniqueness issues, but that seems like over-engineering the system to deal with just these reports that will become less and less of an issue as these imported reports are describe activities further and further in the past. |
This comment is relevant to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code looks good, though it feels like this code should be accompanied by an api doc update and an update to remove the ID generation from the frontend code and use this field instead.
I'll update the API docs. Frontend usage of the new field is happening in this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the API docs. Frontend usage of the new field is happening in this PR
awesome, thanks!
Description of change
Add a human friendly report ID field to activity reports
How to test
curl http://localhost:3000/api/activity-reports/1
). Display ID should look something likeR01-AR-1
Issue(s)
Checklist