feat(aftersale): per-line refund/return flow with ledger-backed completion (add-aftersale-refunds)

This commit is contained in:
Chengdong Zhang
2026-09-23 16:56:30 +08:00
parent 93e5a05d48
commit 2c2b54c21c
43 changed files with 4889 additions and 32 deletions
@@ -83,3 +83,22 @@ Shop users SHALL edit their own shop's profile from a shop-admin page reachable
- **WHEN** the API refuses an update
- **THEN** the page keeps the entered values and shows a failure message
### Requirement: Shop-scoped aftersale workspace
Shop-admin SHALL provide an aftersale list and detail workspace filtered to the authenticated shop's `own_shop` resources. Authorized shop users SHALL inspect order-item evidence and messages, approve or reject pending applications, and confirm returned goods with the guarded refund action. The UI SHALL show status transitions, remaining amount, ledger-backed refund result, and stale-action errors through the shared API contract.
#### Scenario: merchant approves a request
- **WHEN** a shop user opens a pending application for an item belonging to their shop and approves it
- **THEN** the status advances according to the selected aftersale type and the customer can see the persisted result
#### Scenario: merchant confirms return and refunds
- **WHEN** a shop user confirms receipt of a buyer-shipped return
- **THEN** the service records merchant confirmation, credits the customer's account once, and displays the refunded status and order total
#### Scenario: shop scope is enforced
- **WHEN** a shop user requests or mutates an aftersale for another shop
- **THEN** the API denies the operation and the workspace exposes no cross-shop data
#### Scenario: merchant messages buyer
- **WHEN** an authorized shop user appends a localized message
- **THEN** the message appears in the same chronological aftersale thread visible to the buyer