Skip to content

feat: implement storefront SPA and backend state sync, fixes, and tests - #3

Merged
qingfa-dev merged 748 commits into
devfrom
feature/implement-storefront
Aug 19, 2026
Merged

qingfa-dev merged 748 commits into
devfrom
feature/implement-storefront

Conversation

@qingfa-dev

Copy link
Copy Markdown
Owner

Summary

feature/implement-storefront → dev

Implements the storefront SPA and the backend features/fixes that power it, plus thesis review-remediation documentation. 748 commits ahead of dev.

Highlights

Storefront SPA (app/Store)

  • Full storefront rebuild: catalog browsing, product detail, cart, checkout flow with notes, wishlist
  • Pay-now and cancel-order actions, order timeline/shipments/payments rendering
  • Checkout notes, surfaced cart errors, fixed card quick actions
  • Type alignment with the backend contract (ordering, payment, inventory)

Admin SPA (app/Admin)

  • Order payment/checkout states, editable notes, shipment dropdown, payment & shipment action buttons
  • Inventory and ordering types aligned with backend contract

Backend (ordering / billing / inventory / shipping / catalog)

  • Cross-module state sync: order payment state derived from payment captures, recomputed on payment/refund/cancel events
  • Order lifecycle: Placed/Completed statuses, auto-completion from delivery, cancel guards on terminal states
  • Shipment cancellation + transactional per-location stock return on order cancel
  • Tracking number updates and shipment-status validation
  • Status enums typed across catalog, inventory, ordering, billing, dashboard (rebuilt initial migration baseline)
  • Order detail enrichment: embedded payments, shipments, timeline, timestamps
  • Reject unpurchasable variants on add-to-cart; validate special-instructions length

Tests

  • Extensive unit tests for ordering, inventory, billing, shared/utils, and common/api mappers
  • Enum wire-format serialization guards

Docs / thesis

  • Thesis review remediation artifacts: master fix list, per-chapter review & rewrite files, remediation process spec and implementation plan

Notes

  • Do NOT merge without review — awaiting human approval.
  • ~35MB thesis/main_copy.pdf is included in this branch; flag if it should be excluded before merge.

- Order.RegressCheckoutState: backward transitions (Payment->Delivery,
  Payment->Address, Delivery->Address) for Draft orders so customers can
  re-pick address, shipping, or payment before placing the order.
- RegressCheckoutStateCommand + handler (cross-module, webhook-driven).
- UpdateCheckout regresses Payment->Delivery when the address changes;
  SelectShippingRate regresses Payment->Delivery when the method changes.
- CreatePaymentIntent accepts Delivery or Payment (retry); at Payment it
  voids stale non-completed captures and re-reserves stock.
- checkout.session.expired webhook regresses the cart Payment->Delivery so
  an abandoned Stripe session no longer leaves the order stuck.
- Store SPA watcher clears payment context on any regression out of Payment.
AddToCart now validates the variant before mutating the cart: it must be
published, its product active, carry a non-negative price, and have enough
available stock for the requested quantity. Adds IStockItemService to the
handler and uses the variant's actual price instead of a zero fallback.

Extends the handler test suite with a seeding helper for active products
and coverage for the new guard branches.
Adds a max-length rule for SpecialInstructions to both the admin
UpdateOrderAdmin validator and the storefront UpdateCheckout validator,
mirroring the existing email rule pattern. Adds the TestHost package to
the unit-test project for future endpoint-level tests.
…pment dropdown

- Add Payment State and Checkout State severity Tags to the order overview,
  replacing the raw checkout-state text.
- Add an editable Special Instructions field persisted via OrderApi.updateOrder.
- Include the current status in the shipment status dropdown options so the
  Select renders the actual state (previously blank because the current status
  is never one of its own reachable targets).

Adds matching OrderDetail spec coverage for the dropdown and overview tags.
…actions

- Add an optional Special Instructions field to the checkout review step,
  persisted before placing the order and exposed on the checkout composable
  and UpdateCheckoutRequest.
- Surface the server's rejection reason (e.g. out of stock) instead of a
  generic "Failed to add item" message in the cart and quick-add flows.
- Suppress the anchor default on ProductGridCard quick-add / wishlist /
  quick-view so card navigation no longer fires when clicking the actions.

Adds/updates component spec coverage for the card handlers and checkout.
…ory plan notes

The Stripe checkout line-items design was superseded by the implemented
per-product lines feature and its plan; the file is removed. The
payment-inventory correctness plan gains the Phase 2 completion record and
follow-up notes from the recent ordering fixes.
phase-1 and phase-2 reports were force-added during an earlier SDD plan;
the workspace has since been deleted, so drop the tracked copies.
@ngtphat-towa

Copy link
Copy Markdown

lgtm!

@qingfa-dev
qingfa-dev merged commit 9fcdbb6 into dev Aug 19, 2026
0 of 5 checks passed
@qingfa-dev qingfa-dev mentioned this pull request Oct 3, 2026
3 tasks
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