chore(openspec): archive add-points-mall
Sync the points-mall capability plus the frontend-mall and frontend-admin requirements into the main specs, and write the capability Purpose the archive leaves as a placeholder.
This commit is contained in:
+6
-6
@@ -6,16 +6,16 @@
|
|||||||
|
|
||||||
## 2. Contract and backend proof
|
## 2. Contract and backend proof
|
||||||
|
|
||||||
- [ ] 2.1 Register customer and platform routes with appropriate roles and add shared types, client methods, locales, and fixed-data adapter parity.
|
- [x] 2.1 Register customer and platform routes with appropriate roles and add shared types, client methods, locales, and fixed-data adapter parity.
|
||||||
- [x] 2.2 Add integration tests for unpublished-product rejection, insufficient points rollback, concurrent final stock, ownership filtering, and fulfillment transition validation.
|
- [x] 2.2 Add integration tests for unpublished-product rejection, insufficient points rollback, concurrent final stock, ownership filtering, and fulfillment transition validation.
|
||||||
|
|
||||||
## 3. Application surfaces
|
## 3. Application surfaces
|
||||||
|
|
||||||
- [ ] 3.1 Add platform-admin points-product and redemption-order management screens and admin nav entries using the shared client.
|
- [x] 3.1 Add platform-admin points-product and redemption-order management screens and admin nav entries using the shared client.
|
||||||
- [ ] 3.2 Replace mall points fixtures with live catalog, address-aware redemption, refreshed balance, and customer redemption history.
|
- [x] 3.2 Replace mall points fixtures with live catalog, address-aware redemption, refreshed balance, and customer redemption history.
|
||||||
- [ ] 3.3 Remove `INTEGRAL_PRODUCTS` and `USER_STATS` page imports without deleting fixed-data adapter support.
|
- [x] 3.3 Remove `INTEGRAL_PRODUCTS` and `USER_STATS` page imports without deleting fixed-data adapter support.
|
||||||
|
|
||||||
## 4. Verification and specification
|
## 4. Verification and specification
|
||||||
|
|
||||||
- [ ] 4.1 Seed deterministic points products and credit demo customer points through the archived customer-accounts credit path (append-only entry, never an absolute balance write). Browser-smoke admin publication and customer redemption.
|
- [x] 4.1 Seed deterministic points products and credit demo customer points through the archived customer-accounts credit path (append-only entry, never an absolute balance write). Browser-smoke admin publication and customer redemption.
|
||||||
- [ ] 4.2 Run cargo test for vmall-api, builds for mall and admin, and strict validation for this OpenSpec change.
|
- [x] 4.2 Run cargo test for vmall-api, builds for mall and admin, and strict validation for this OpenSpec change.
|
||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
The platform console for managing users, shops and currencies.
|
The platform console for managing users, shops and currencies.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
### Requirement: Platform user and shop management
|
### Requirement: Platform user and shop management
|
||||||
Platform admins SHALL assign user roles (with shop scope), create shops, and suspend/activate shops. Suspended shops' products MUST NOT be purchasable (enforced by API, reflected in UI).
|
Platform admins SHALL assign user roles (with shop scope), create shops, and suspend/activate shops. Suspended shops' products MUST NOT be purchasable (enforced by API, reflected in UI).
|
||||||
|
|
||||||
@@ -17,3 +19,13 @@ Platform admins SHALL view currencies and update exchange rates; new rates affec
|
|||||||
- **WHEN** an admin updates CNY rate_to_base
|
- **WHEN** an admin updates CNY rate_to_base
|
||||||
- **THEN** the mall conversion endpoint returns amounts computed with the new rate
|
- **THEN** the mall conversion endpoint returns amounts computed with the new rate
|
||||||
|
|
||||||
|
### Requirement: Platform points mall management
|
||||||
|
Platform admins SHALL manage points products and inspect and fulfill redemption orders through the admin console using the shared API contract. Admin SHALL expose points-mall navigation beside existing platform operations.
|
||||||
|
|
||||||
|
#### Scenario: manage a redemption catalog item
|
||||||
|
- **WHEN** a platform admin publishes a configured points product
|
||||||
|
- **THEN** it becomes available in the customer points mall
|
||||||
|
|
||||||
|
#### Scenario: points mall appears in admin navigation
|
||||||
|
- **WHEN** an authenticated platform admin opens the admin console
|
||||||
|
- **THEN** points-product and redemption-order management are reachable from the console nav
|
||||||
|
|||||||
@@ -174,3 +174,10 @@ The mall SHALL load a product's currently claimable shop coupons and the signed-
|
|||||||
#### Scenario: order shows realized discount
|
#### Scenario: order shows realized discount
|
||||||
- **WHEN** checkout succeeds with a coupon on one shop order
|
- **WHEN** checkout succeeds with a coupon on one shop order
|
||||||
- **THEN** that order's payment and detail views show the server discount and reduced total without a client-calculated amount
|
- **THEN** that order's payment and detail views show the server discount and reduced total without a client-calculated amount
|
||||||
|
|
||||||
|
### Requirement: Live points mall
|
||||||
|
The mall SHALL display live published points products and the signed-in customer's live points balance, allow redemption with a shipping address, and show the customer's redemption history on the points route. It SHALL replace `INTEGRAL_PRODUCTS` and `USER_STATS` imports on the points route.
|
||||||
|
|
||||||
|
#### Scenario: redeem available product
|
||||||
|
- **WHEN** a signed-in shopper with enough points redeems a published in-stock product
|
||||||
|
- **THEN** the mall shows the created redemption order and refreshed points balance
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# points-mall Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Offer a platform-owned catalog of rewards a customer can redeem for loyalty points, with its own order lifecycle kept separate from cash orders and merchant SKU inventory. Redemption reserves product stock, debits the points ledger atomically with the order as reference, and snapshots the product and shipping address; platform operators publish the catalog and move redemptions to fulfilled or cancelled.
|
||||||
|
|
||||||
|
## 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
|
||||||
Reference in New Issue
Block a user