Files
vmall/openspec/changes/add-favorites/proposal.md
T
Chengdong ZhangandCursor 6c1357ec4d feat: persist customer product and shop favorites through the live API
Replace mall fixture favorites with customer-scoped endpoints, and send signed-out shoppers back to the page they left after sign-in.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 18:51:45 +08:00

1.5 KiB

Why

Favorites are the last existing mall UI capability that still reads fixed fixtures directly. Persisting product and shop favorites completes the buyer-center journey and makes the product-detail heart survive reloads without touching checkout or payment.

What Changes

  • Add customer-owned product and shop favorites with database-enforced target shape and per-target uniqueness.
  • Add authenticated APIs to list, add, and remove each favorite kind; repeated add/remove operations are idempotent.
  • Return current target data with each favorite so the Mall does not issue one request per saved item.
  • Replace fixture-derived favorites, buyer-center previews/counts, and the product-detail local heart state with the shared live API contract.
  • Keep equivalent fixed-data adapter behavior as the rollback implementation.

Capabilities

New Capabilities

  • favorites: Customer ownership, product/shop target integrity, idempotent mutation, and target-aware listing.

Modified Capabilities

  • frontend-mall: Product detail and buyer-center favorites use the selected API adapter instead of local state and MOCK_FAVORITES.

Non-goals

Favorite folders, notes, sharing, notifications, ranking, merchant analytics, bulk mutation, and automatic migration of fixture favorites are excluded.

Impact

Adds one Postgres migration, a Rust favorites module and customer routes, shared types/API methods, a favorites live-domain pick, fixed-adapter parity, and Mall updates for product detail and buyer-center pages.