Open
Conversation
skand088
reviewed
Feb 10, 2026
my idea is to have a qr code for each user. when we create a meal, we
create a meal attendance record for that user at that meal. they can't
scan again. if we allow leftovers for that meal, we would create another
meal called "{meal} leftovers" or whatever so that they can scan in to
that instead. may get a bit annoying to keep having to create meals for
leftovers if we allow them to line up for leftovers again and again.
i changed the addMeal procedure to be public instead of protected for now because idk how to handle authentication. this is why i am not using requireRole in the client component as well. also changed startTime and endTime to string() without changing it to datetime because had issues with type mismatch.
added a validation check to ensure endTime is after startTime for meals. also made it so that meals need to have unique titles and start times. having the same end time is fine because we could set "Breakfast" to be from 9am to 10am, and then "Breakfast leftovers" from 9:45am to 10am. it just means all breakfast related things end at 10am.
implemented a scanUserIn public procedure and added a section in my meals page to scan in a user for testing purposes
e23c7ab to
6419d1e
Compare
skand088
requested changes
Feb 23, 2026
burtonjong
reviewed
Feb 25, 2026
skand088
reviewed
Feb 25, 2026
| return newMeal; | ||
| }), | ||
|
|
||
| scanUserIn: protectedProcedure |
Contributor
There was a problem hiding this comment.
this is nitpicky but we have an adminProcedure Fiona created in trpc.ts so we should use it just so the codebase is more cohesive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR doesn't handle assigning users to a meal time slot.
The general flow of creating a meal and scanning users in to a meal is as follows:
The reason why I am storing end time instead of a duration is because SQL doesn't have a duration type iirc.
I've also created a new client component in the frontend for testing out this functionality. It has checks for scanning in the same user to the same meal, creating a meal with the same title and start time, and creating a meal with an end time that is before the start time. I didn't style the component because I heard we're moving from SCSS to Tailwind because the previous version of HMT used Tailwind and we're trying to preserve the styles from that version.