Skip to content

feat(cart): header bubble uses BasketContext; unify product id handling#192

Open
maxwellc21 wants to merge 1 commit intoDataBytes-Organisation:mainfrom
maxwellc21:feat/cart-badge-basket-ctx-path
Open

feat(cart): header bubble uses BasketContext; unify product id handling#192
maxwellc21 wants to merge 1 commit intoDataBytes-Organisation:mainfrom
maxwellc21:feat/cart-badge-basket-ctx-path

Conversation

@maxwellc21
Copy link
Contributor

…ng across DBs

Frontend:

  • New components/CartBadge.tsx; shows basket qty badge in headers (Home/Products/Category/Product) and navigates to basket.
  • BasketContext: expose basketData consistently for badge; stabilize id/product_code handling.
  • Product and Category pages: stable id mapping across CleanedData.Coles + DiscountMate.product; in-basket state respected; add-to-basket payload sends product_code when not ObjectId.
  • ProductCard: props support (inBasket/adding) without API changes.
  • UI: category label mapping; responsive grids; badge in Stack header.

Backend:

  • basket.controller: accept product_id OR product_code; de-dupe in basket; normalize getbasket response (productId/productCode/quantity/price/image/name).
  • product.controller: combined source query (DiscountMate.product + CleanedData.Coles), optional category filter & limit; stable product fields in response.
  • basket.router: tightened routes.

Chore:

  • lockfiles updated.

…ng across DBs

Frontend:
- New components/CartBadge.tsx; shows basket qty badge in headers (Home/Products/Category/Product) and navigates to basket.
- BasketContext: expose basketData consistently for badge; stabilize id/product_code handling.
- Product and Category pages: stable id mapping across CleanedData.Coles + DiscountMate.product; in-basket state respected; add-to-basket payload sends product_code when not ObjectId.
- ProductCard: props support (inBasket/adding) without API changes.
- UI: category label mapping; responsive grids; badge in Stack header.

Backend:
- basket.controller: accept product_id OR product_code; de-dupe in basket; normalize getbasket response (productId/productCode/quantity/price/image/name).
- product.controller: combined source query (DiscountMate.product + CleanedData.Coles), optional category filter & limit; stable product fields in response.
- basket.router: tightened routes.

Chore:
- lockfiles updated.
@maxwellc21
Copy link
Contributor Author

@abhinav52-sh adding items from products from home, categories, and product to basket and DB. For your review

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