chore(openspec): archive add-customer-accounts
Sync the customer-accounts capability and the frontend-mall stats requirement into the main specs, and write the capability Purpose the archive leaves as a placeholder so strict validation stays green.
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Customer account summary
|
||||
Each customer SHALL have available monetary balance, frozen monetary balance, and loyalty-points accounts. An authenticated customer SHALL retrieve a summary containing balance minor, frozen balance minor, their monetary currency, and integer points. Public APIs SHALL NOT list or mutate account entries.
|
||||
|
||||
#### Scenario: new customer summary
|
||||
- **WHEN** a newly registered customer requests account stats
|
||||
- **THEN** the API returns zero balances and zero points without relying on browser fixtures
|
||||
|
||||
#### Scenario: frozen kind exists without a freeze flow
|
||||
- **WHEN** a customer with no freeze events requests account stats
|
||||
- **THEN** `frozen_minor` is zero and available balance is unchanged
|
||||
|
||||
### Requirement: Append-only account entries
|
||||
Every account balance change SHALL create an immutable entry with signed delta, resulting balance, reason, optional business reference, and timestamp in the same transaction. Account entries SHALL NOT be edited or deleted through public APIs.
|
||||
|
||||
#### Scenario: debit records result
|
||||
- **WHEN** an internal business flow debits points successfully
|
||||
- **THEN** the points balance and one entry with the resulting balance commit together
|
||||
|
||||
### Requirement: Guarded account mutation
|
||||
A debit or freeze SHALL succeed only when the affected account has sufficient available balance. Concurrent changes SHALL use conditional atomic updates and return 409 rather than create a negative balance.
|
||||
|
||||
#### Scenario: competing debits
|
||||
- **WHEN** two debits together exceed a points balance
|
||||
- **THEN** at most one debit succeeds and the final stored balance is non-negative
|
||||
@@ -0,0 +1,8 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Live customer account statistics
|
||||
The buyer-center dashboard and points surfaces SHALL load the signed-in customer's balance, frozen balance, currency, and points from the shared account API rather than `USER_STATS`.
|
||||
|
||||
#### Scenario: account summary reload
|
||||
- **WHEN** a signed-in shopper reloads the buyer center
|
||||
- **THEN** displayed account statistics come from the selected API adapter and survive browser state loss
|
||||
Reference in New Issue
Block a user