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>
1.5 KiB
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 andMOCK_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.