Skip to content
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

Merged
merged 3 commits into from
Feb 12, 2024
Merged

Conversation

patriciaahuang
Copy link
Contributor

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).

@patriciaahuang patriciaahuang requested a review from a team as a code owner February 9, 2024 22:18
@dti-github-bot
Copy link
Member

dti-github-bot commented Feb 9, 2024

[diff-counting] Significant lines: 7.

Copy link
Collaborator

@andrew032011 andrew032011 left a 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.

@@ -37,7 +37,7 @@ export type DBTeamEventAttendance = {
hoursAttended?: number;
image: string;
eventUuid: string;
pending: boolean;
pending?: boolean;
Copy link
Collaborator

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.

@@ -87,7 +87,7 @@ interface TeamEventAttendance {
hoursAttended?: number;
image: string;
readonly eventUuid: string;
readonly pending: boolean;
readonly pending?: boolean;
Copy link
Collaborator

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.

Copy link
Collaborator

@andrew032011 andrew032011 left a 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.

Copy link
Contributor

@alyssayzhang alyssayzhang left a 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 :)

@patriciaahuang patriciaahuang merged commit 3258405 into main Feb 12, 2024
16 checks passed
@patriciaahuang patriciaahuang deleted the remove-pending-field branch February 12, 2024 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants