Skip to content

Conversation

siverne
Copy link
Member

@siverne siverne commented Nov 12, 2026

Part of #51. The frontend comes in a separate PR.

  • New migration: student reviews use half stars from 0.5 to 5. The merged review migration is not changed.
  • Validation and GraphQL accept half stars (rating is now Float).
  • communityRating and communityRatingCount now include student reviews. The average for a wine is calculated again when a review is saved or deleted, so sorting and filtering follow the students too. The import script uses the same SQL (rating-stats.ts).
  • New field Wine.ratingDistribution: how many gave each score, from X-Wines and students together. Batched with DataLoader.
  • docs/api.md updated.

Tested locally: a 3.5 review raised the count from 21 to 22, changed the average from 4.12 to 4.09 and added one to 3.5 in the distribution. 35 backend tests and typecheck pass.

After merging: run npm ci and npm run db:migrate in backend/ on the VM, and restart the backend.

Note: the frontend still sends whole stars until the frontend PR is merged, which the API still accepts.

@siverne siverne requested a review from a team as a code owner November 12, 2026 14:02
@oscarba oscarba merged commit 1b3046b into main Nov 12, 2026
@oscarba oscarba deleted the 51-half-stars-backend branch November 12, 2026 14:43
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants