-
Notifications
You must be signed in to change notification settings - Fork 2
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
Remove pending field dependency for TEC #575
Conversation
[diff-counting] Significant lines: 7. |
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.
Are there plans to run a script to remove all pending
fields? Super low priority and the risk probably outweighs the reward, so not really necessary.
We can leave it and then starting Fall 2024 it will be officially retired when we clear the data.
backend/src/types/DataTypes.d.ts
Outdated
@@ -37,7 +37,7 @@ export type DBTeamEventAttendance = { | |||
hoursAttended?: number; | |||
image: string; | |||
eventUuid: string; | |||
pending: boolean; | |||
pending?: boolean; |
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 think we'll be ok to remove this field entirely, since we're not using it. Note that even if the data in the database has this field, you won't have a "type error" due to extra fields that the type doesn't have.
common-types/index.d.ts
Outdated
@@ -87,7 +87,7 @@ interface TeamEventAttendance { | |||
hoursAttended?: number; | |||
image: string; | |||
readonly eventUuid: string; | |||
readonly pending: boolean; | |||
readonly pending?: boolean; |
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.
Same here as well, feel free to remove this field entirely, since we've fully migrated over to the status
field.
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.
Great work! Good to see us killing off the field and cleaning up the status pending/approved/rejected work from last sem. Please see my comments above.
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 looks good to me 🙌!! nice work on testing this ticket and making sure that everything works the same :)
Summary
TEC's used to have both a "pending" and "status" field, which was redundant. The backend and frontend are updated to not use/depend on the pending field, and the pending field is made optional in data types. A script was run to remove the pending field from all Team Event Attendance collections in the dev database.
Notion/Figma Link
https://www.notion.so/TEC-Remove-dependency-on-Pending-field-8d7d76c75e2a46758da27620e890573c?pvs=4
Test Plan
To ensure removing the pending field in the dev database and updating the backend and frontend didn't mess with any functionalities, I tested each function that was modified locally (creating a team event attendance, submitting a team event attendance, etc.) and everything still works the same (for new and old data).