Skip to content

SSF-54 Backend and DB Enums#57

Merged
Juwang110 merged 26 commits intomainfrom
jw/SSF-54-backend-enums
Nov 26, 2025
Merged

SSF-54 Backend and DB Enums#57
Juwang110 merged 26 commits intomainfrom
jw/SSF-54-backend-enums

Conversation

@Juwang110
Copy link

ℹ️ Issue

Closes https://vidushimisra.atlassian.net/jira/software/projects/SSF/boards/1?selectedIssue=SSF-54

📝 Description

Conceptually, this PR is pretty simple, it entails refactoring our backend and DB to move away from varchar/text when applicable and move toward enum values where the fields can only be from a set number of values. This ensures safety in the actual values and makes our backend more robust and readable.

I did end up modifying one frontend page, the modal in request-from/pantry:id. This is because in another PR of mine the values for requested-size are different then what is currently on main. To avoid making an enum I knew would be outdated, I simply edited the frontend values to anticipate.

For the backend I modified 3 controller routes: donations/create, requests/create, donation-items/create

✔️ Verification

I verified all enum values based on what the frontend is currently sending the db/backend. I also went through all the pages on main and interacted with the database in every possible way to ensure no issues from refactoring.

🏕️ (Optional) Future Work / Notes

I got ahead of myself and created a donation_frequency_enum for FoodManufacturer when this entity is not yet in main. So as a note, that new entity and table column type will have to reference my new enum.

Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment but this looks great. Thanks for doing this, it will make future dev work much easier/secure for us!

@Juwang110 Juwang110 requested a review from dburkhart07 November 8, 2025 15:04
Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!!

Copy link
Member

@amywng amywng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a few comments. i'm wondering if we can add the enums to the types.ts on the frontend side as well? i was also getting errors when running the app in the pantries service, i think you might need to update the PantryApplicationDTO to use your enums

Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good for the most part. Only small nit that I have is I believe we should add one final enum: reserveFoodForAllergic, which has the values Yes, some, or no. If you could add that into both the backend, database migration, and frontend, that would be great!

Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One very small suggestion and reviewing Amy's comments, but aside from that lgtm!

Copy link
Member

@amywng amywng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry just a few more small things

@amywng amywng requested a review from sam-schu November 24, 2025 03:30
@Juwang110 Juwang110 requested a review from amywng November 24, 2025 05:53
@Juwang110 Juwang110 requested a review from amywng November 25, 2025 16:50
@Juwang110 Juwang110 requested a review from amywng November 25, 2025 19:10
Copy link
Member

@amywng amywng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for all the back and forth and implementing my changes so quickly! lgtm

Copy link
Collaborator

@sam-schu sam-schu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just took a look at the change I requested

@Juwang110 Juwang110 merged commit 5f0ccdb into main Nov 26, 2025
3 of 4 checks passed
@Juwang110 Juwang110 deleted the jw/SSF-54-backend-enums branch November 26, 2025 15:29
swarkewalia pushed a commit that referenced this pull request Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants