Repository navigation
Merge feedback and points into one session_feedback table - #78
Merged
Merged
Conversation
3 of 4 tasks
VidsterBroyo
marked this pull request as ready for review
November 30, 2026 02:16
VidsterBroyo
force-pushed
the
feat/session-feedback
branch
from
November 30, 2026 02:20
1c1ea3c to
d1102a2
Compare
Feedback and points are saved, sent and edited together, so they now live in one session_feedback row per student per session with a single sent_at. The API returns SessionFeedback (points under `points`), and saveSessionFeedback / sendSessionFeedback replace saveSessionReport / sendSessionReport. Existing read queries keep their names and access rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VidsterBroyo
force-pushed
the
feat/session-feedback
branch
from
November 30, 2026 02:21
d1102a2 to
7512498
Compare
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.
Notion ticket link
Ticket
Stack 1 of 3. This PR merges the tables. #79 unifies the read queries, and #80 adds
attachment_id.Implementation description
feedback_logandsession_points1:1 by hand: same (session, student) key, written in one save, stamped with the samesent_aton send, with the author and timestamp columns stored twice.sendSessionReportalso had to handle states like "feedback sent but points not" that only existed because there were two tables.session_feedbacktable: message (text, defaults to''), the 10 point categories,given_by/updated_by, and a singlesent_at. It's unique on (session, student). The migration drops the old tables without copying data, since the database is empty.SessionFeedbackreplacesFeedback,SessionPointsandSessionReport. The categories andtotalare nested underpoints, mirroringSessionPointsInput.saveSessionFeedback/sendSessionFeedbackreplacesaveSessionReport/sendSessionReport.feedbackService,sessionPointsServiceandsessionReportServicebecome onesessionFeedbackService. Save and send each touch one row. Points accounting is unchanged: it still locks the student row and adjustsStudent.pointsby the delta when sent feedback is edited.assertManagesStudent(utils/auth.ts) is a new shared helper for the "caller manages this student" check that student and parent reads need. It throwsFORBIDDEN. The feedback reads use it now, and the rewards queries can reuse it.What should reviewers focus on?
pointsobject onSessionFeedback, instead of flat category fields.prisma migrate deploy, a full seed, and the README's feedback, points and save/send checks.Checklist
🤖 Generated with Claude Code