laravel-shop/tests/Unit
Fabian @ Blax Software 68d02b01fc feat(cart): WS-first storefront primitives + shared cart/auth controllers
Adds the reusable pieces a headless WS-first shop needs, so every consumer
(immohost, nirioci, future shops) shares one implementation instead of
re-inventing it in app code:

- CartService::adopt() — resolve + re-bind a guest cart to a stable connection
  id (socket/session), so the cart follows a stateless client across reconnects.
- CartService::mergeGuestIntoUser() — actually honour shop.cart.merge_on_login,
  which was dead config: re-parent guest items onto the user's cart at login
  (preserves claimed stock and resolved prices; no re-add side effects).
- Cart facade passthrough checkoutSessionLink() for the {redirect} checkout shape.
- CartResource / CartItemResource: a stable, presentation-agnostic wire shape
  (money in integer minor units + explicit currency; best-effort image).
- Blax\Shop\Websocket\Controllers\{Cart,Auth}Controller: thin, config-resolved,
  translatable base WS controllers a host exposes via one-line subclass stubs.
  laravel-websockets stays a soft (suggest) dependency; the Websocket dir is
  excluded from coverage since its logic lives in the covered CartService.
- shop:: translation namespace (en) for the controller messages.

Tests: tests/Unit/Cart/CartAdoptMergeTest.php (7). Full suite green (1468).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-17 10:53:28 +02:00
..
Cart feat(cart): WS-first storefront primitives + shared cart/auth controllers 2026-09-17 10:53:28 +02:00
Enums I loanable product type, tiered pricing, lifecycle events, host helpers 2026-05-15 10:27:59 +02:00
Models I loanable product type, tiered pricing, lifecycle events, host helpers 2026-05-15 10:27:59 +02:00
Order feat: Enhance traits with strict types and improve method signatures 2026-05-15 20:26:24 +02:00
Product feat(pricing): percentage conditional prices + cheapest-effective resolver + authoring helper 2026-08-26 15:52:24 +02:00
Purchase I loanable product type, tiered pricing, lifecycle events, host helpers 2026-05-15 10:27:59 +02:00
Resources test: pin clock in loan-vocabulary test; docs: bump suite counts to 1400/3755 2026-06-02 09:48:26 +02:00
Stripe I order notes, BF checkout currency 2026-01-25 10:40:17 +01:00
HtmlDateTimeCastTest.php BFI cart single item 2025-12-24 19:40:10 +01:00
ShopServiceTest.php BFI cart / orders 2026-01-05 10:30:21 +01:00
StockManagementTest.php BF edgecases, R structure, A tests 2026-05-18 13:05:38 +02:00
StockTypeSafetyTest.php BF edgecases, R structure, A tests 2026-05-18 13:05:38 +02:00
TaxServiceTest.php feat(tax): configurable TaxService applied across every checkout path 2026-08-21 08:23:56 +02:00