Skip to content

Conversation

@hwangdae
Copy link
Collaborator

@hwangdae hwangdae commented Aug 29, 2025

작업 내용

문제점 및 어려움

해결 방안

공유 사항

Summary by CodeRabbit

  • Refactor

    • Switched store retrieval to use public store codes, aligning data requests across pages.
    • Unified menu and store display logic on store pages, reducing duplicate requests.
    • Simplified loading states for a smoother, more consistent page load experience.
    • Menus now load independently of store details, improving responsiveness.
  • Chores

    • Updated data models to include public store codes in menu items, preparing for broader compatibility.

@coderabbitai
Copy link

coderabbitai bot commented Aug 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The getStore API now accepts a string publicCode and uses /v1/stores/${publicCode}. StorePage consolidates data fetching to getStoreMenus(storeId) and derives storeName and menu list from it. StoreDetailPage updates queries to pass string storeId directly and runs menus query independently. MenuType gains a required publicCode field.

Changes

Cohort / File(s) Summary
API: getStore identifier change
apps/nowait-user/src/api/reservation.ts
getStore parameter changed from storeId: number to publicCode: string; endpoint path updated to /v1/stores/${publicCode}.
Order page: single-source menus
apps/nowait-user/src/pages/order/home/StorePage.tsx
Removed separate store fetch; now uses getStoreMenus(storeId) only. Loading state simplified; UI derives storeName and menuReadDto from menus. Imports updated.
Waiting page: query key/inputs update
apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx
getStore now called with string storeId; menus query keyed by ["storeMenus", storeId] and calls getStoreMenus(storeId) without dependency on store.publicCode; removed enabled gate.
Types: menu shape expansion
apps/nowait-user/src/types/order/menu.ts
Added required field publicCode: string to MenuType.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant R as Route/StorePage
  participant Q as React Query
  participant API as getStoreMenus(storeId)
  participant S as Server

  R->>Q: useQuery(["storeMenus", storeId], getStoreMenus)
  Q->>API: invoke
  API->>S: GET /v1/stores/{storeId}/menus
  S-->>API: 200 { storeName, menuReadDto, ... }
  API-->>Q: data
  Q-->>R: menus, isLoading
  Note over R: Renders StoreHeader(menus.storeName)<br/>and MenuList(menus.menuReadDto)
Loading
sequenceDiagram
  autonumber
  participant R as Route/StoreDetailPage
  participant Q1 as useQuery: getStore(publicCode|string)
  participant Q2 as useQuery: getStoreMenus(storeId)
  participant API1 as getStore(publicCode)
  participant API2 as getStoreMenus(storeId)
  participant S as Server

  R->>Q1: useQuery(["store", storeId], () => getStore(storeId))
  Q1->>API1: invoke with publicCode=storeId
  API1->>S: GET /v1/stores/{publicCode}
  S-->>API1: store data
  API1-->>Q1: data

  R->>Q2: useQuery(["storeMenus", storeId], () => getStoreMenus(storeId))
  Q2->>API2: invoke
  API2->>S: GET /v1/stores/{storeId}/menus
  S-->>API2: menus data
  API2-->>Q2: data

  Note over R: Menus query runs independently of store query
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Develop #392 — Also changes getStore signature/path; potential conflict with this PR’s publicCode update.
  • Develop #399 — Touches StorePage and getStore/getStoreMenus data-flow; likely adjacent to this consolidation.
  • Develop #384 — Modifies getStore to accept publicCode and updates endpoint; directly overlaps API change.

Suggested reviewers

  • oriNuguri25

Poem

Thump-thump goes my reviewy heart,
Swapped IDs for codes—precision art.
One hop for menus, lean and bright,
Another for details, running light.
publicCode stitched in the dough,
Now the carrots of data cleanly flow. 🥕🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c8029ae and 3618f99.

📒 Files selected for processing (4)
  • apps/nowait-user/src/api/reservation.ts (1 hunks)
  • apps/nowait-user/src/pages/order/home/StorePage.tsx (2 hunks)
  • apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx (2 hunks)
  • apps/nowait-user/src/types/order/menu.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hwangdae hwangdae merged commit 6bf2b43 into main Aug 29, 2025
2 of 3 checks passed
@github-actions github-actions bot requested a review from dgKim1 August 29, 2025 06:50
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.

2 participants