Files
vmall/openspec/changes/add-points-mall/specs/points-mall/spec.md
T
Chengdong ZhangandCursor 53548196f8 docs(openspec): plan shop coupons, accounts, points, flash sales, and group buying
Capture exclusive promotion composition, empty-group cancel, and mall surface scope so the five marketing changes can be implemented without stacking or lifecycle ambiguity.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 17:32:08 +08:00

30 lines
1.9 KiB
Markdown

## ADDED Requirements
### Requirement: Platform points product catalog
Platform admins SHALL create, update, publish, unpublish, and list points products with localized user-facing content, integer points price, stock, images, and recommendation order. Customers SHALL discover only published products.
#### Scenario: unpublished product is unavailable
- **WHEN** an admin unpublishes a points product
- **THEN** customers cannot discover or redeem it
### Requirement: Atomic points redemption
An authenticated customer SHALL redeem a published points product using a quantity and shipping address. The server SHALL atomically validate stock, debit points through customer accounts, create a redemption order with immutable product and address snapshots, and decrement stock.
#### Scenario: insufficient points
- **WHEN** a customer redeems a product costing more points than available
- **THEN** the API returns 409 and creates no redemption order or stock change
#### Scenario: final stock contention
- **WHEN** concurrent redemptions request the final product stock
- **THEN** only requests covered by stock succeed and no negative stock is stored
### Requirement: Redemption history and fulfillment
Customers SHALL list only their redemption orders. Platform admins SHALL list redemption orders and transition pending fulfillment to fulfilled or cancelled with validated current status. Demo seed SHALL credit points through customer accounts so at least one published product can be redeemed in the live mall.
#### Scenario: fulfill redemption
- **WHEN** a platform admin fulfills a pending redemption order
- **THEN** its status becomes fulfilled and the customer sees that status in history
#### Scenario: seeded points are spendable
- **WHEN** a seeded demo customer with a seed ledger credit redeems an in-stock published product they can afford
- **THEN** the redemption succeeds and the points summary decreases by the product price