Skip to content

Fix: restaurant menu showed only today's items#6

Merged
LeoColman merged 1 commit into
mainfrom
fix/restaurant-week-menu
Jun 30, 2026
Merged

Fix: restaurant menu showed only today's items#6
LeoColman merged 1 commit into
mainfrom
fix/restaurant-week-menu

Conversation

@LeoColman

Copy link
Copy Markdown
Member

The Restaurant screen only showed today's menu — picking any other weekday rendered "Nenhum cardápio disponível para este dia".

Cause

JopiterRestaurantClient.fetchItems sent a single date=<today> query param. The Persephone OpenAPI spec declares date as 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.
  • A production check asserts fetchItems now 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

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
@LeoColman LeoColman merged commit 0876e5d into main Jun 30, 2026
10 checks passed
@LeoColman LeoColman deleted the fix/restaurant-week-menu branch June 30, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant