Skip to content

Stock logic fix#36

Merged
levilevente merged 5 commits into
mainfrom
feature/stock-logic-fix
Feb 5, 2026
Merged

Stock logic fix#36
levilevente merged 5 commits into
mainfrom
feature/stock-logic-fix

Conversation

@levilevente

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 5, 2026 18:09
@levilevente levilevente self-assigned this Feb 5, 2026
@levilevente levilevente linked an issue Feb 5, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request aims to fix stock logic by moving stock and isActive properties from ProductDetail to ProductSummary interface to make them available across the application. The changes add conditional rendering to hide purchase buttons and reviews for products that are out of stock or inactive.

Changes:

  • Moved stock and isActive fields from ProductDetail to ProductSummary interface in both frontend TypeScript types and backend Java DTO
  • Added conditional rendering in ProductPage and ProductCard components to show "Out of Stock" message based on product availability
  • Created new CustomButtonGroup component to consolidate button group logic from ProductCard
  • Added "outOfStock" translation string

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
frontend/src/types/ProductsType.ts Moved stock and isActive properties from ProductDetail to ProductSummary interface
backend/src/main/java/com/matchmycoffee/dto/response/product/ProductSummaryResponse.java Added stock and isActive fields to backend DTO to match frontend changes
frontend/src/pages/ProductPage.tsx Added conditional rendering for purchase buttons and reviews section based on stock/active status
frontend/src/components/common/ProductCard.tsx Refactored to use CustomButtonGroup and added stock availability check
frontend/src/components/product/CustomButtonGroup.tsx New component extracting button group logic from ProductCard
frontend/public/locales/en/translation.json Added "outOfStock" translation string

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/common/ProductCard.tsx Outdated
Comment thread frontend/src/components/common/ProductCard.tsx Outdated
Comment thread frontend/src/components/product/CustomButtonGroup.tsx Outdated
Comment thread frontend/src/components/product/CustomButtonGroup.tsx Outdated
Comment thread frontend/src/pages/ProductPage.tsx Outdated
Comment thread frontend/src/pages/ProductPage.tsx Outdated

@benimester benimester left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@levilevente levilevente merged commit b3fc390 into main Feb 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stock logic fix

3 participants