Fix: restaurant menu showed only today's items#6
Merged
Conversation
The OpenAPI spec for /api/v1/restaurants/items declares `date` as an array
("the dates you want to fetch items for"), but the client only sent today's
date, so every other weekday rendered "Nenhum cardápio disponível". Send all
seven days of the current week instead, via a testable weekDates() helper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X5cqJDzZvxqTxMTWcN2jvm
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.
The Restaurant screen only showed today's menu — picking any other weekday rendered "Nenhum cardápio disponível para este dia".
Cause
JopiterRestaurantClient.fetchItemssent a singledate=<today>query param. The Persephone OpenAPI spec declaresdateas an array ("The dates you want to fetch items for"), so the API only returned today.Fix
Send all seven days of the current week (Monday–Sunday) via a testable
weekDates()helper. The ViewModel already groups the results by day, so the day selector now works for the whole week.Tests
weekDates()returns the 7 Mon–Sun dates (deterministic) and starts on Monday even from a Sunday.fetchItemsnow returns more than one distinct date.Validation
Picking Quarta-feira now shows Wednesday's own menu on the emulator:
🤖 Generated with Claude Code
https://claude.ai/code/session_01X5cqJDzZvxqTxMTWcN2jvm