feat: 套餐分配生效条件选择
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 9m23s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 9m23s
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Package Allocation Expiry Base Override Contract
|
||||
|
||||
The shop package allocation contract SHALL support an explicit `expiry_base_override` when creating or updating an allocation. The allowed request values MUST be `null`, `from_purchase`, and `from_realname`.
|
||||
|
||||
#### Scenario: Create allocation following the package default
|
||||
|
||||
- **GIVEN** 用户在套餐授权/分配弹框选择“跟随套餐默认”
|
||||
- **WHEN** 用户创建店铺套餐分配
|
||||
- **THEN** 系统 MUST call `POST /api/admin/shop-package-allocations`
|
||||
- **AND** 请求 MUST explicitly contain `expiry_base_override: null`
|
||||
- **AND** 系统 MUST NOT omit `expiry_base_override` to represent following the default
|
||||
|
||||
#### Scenario: Create allocation with purchase activation override
|
||||
|
||||
- **GIVEN** 用户在套餐授权/分配弹框选择“购买即生效”
|
||||
- **WHEN** 用户创建店铺套餐分配
|
||||
- **THEN** 请求 MUST contain `expiry_base_override: "from_purchase"`
|
||||
|
||||
#### Scenario: Create allocation with realname activation override
|
||||
|
||||
- **GIVEN** 用户在套餐授权/分配弹框选择“实名即生效”
|
||||
- **WHEN** 用户创建店铺套餐分配
|
||||
- **THEN** 请求 MUST contain `expiry_base_override: "from_realname"`
|
||||
|
||||
### Requirement: Package Allocation Expiry Base Update
|
||||
|
||||
The system SHALL update an existing package allocation's expiry-base override through `PATCH /api/admin/shop-package-allocations/{id}/expiry-base` with a body containing `expiry_base_override`.
|
||||
|
||||
#### Scenario: Update allocation expiry base override
|
||||
|
||||
- **GIVEN** 用户正在编辑已分配套餐的生效条件
|
||||
- **WHEN** 用户选择“购买即生效”或“实名即生效”并保存
|
||||
- **THEN** 系统 MUST call `PATCH /api/admin/shop-package-allocations/{id}/expiry-base`
|
||||
- **AND** 请求体 MUST contain the selected `expiry_base_override`
|
||||
|
||||
#### Scenario: Restore allocation to package default
|
||||
|
||||
- **GIVEN** 用户正在编辑已分配套餐的生效条件
|
||||
- **WHEN** 用户选择“跟随套餐默认”并保存
|
||||
- **THEN** 请求体 MUST explicitly contain `expiry_base_override: null`
|
||||
|
||||
### Requirement: Package Allocation Expiry Base Resolution Response
|
||||
|
||||
The package allocation response SHALL provide `default_expiry_base`, `expiry_base_override`, and `effective_expiry_base`, together with their corresponding Chinese name fields. The frontend MUST render the returned effective value and name without calculating it from other fields.
|
||||
|
||||
#### Scenario: Display distinct expiry base values
|
||||
|
||||
- **WHEN** 前端加载或更新店铺套餐分配记录
|
||||
- **THEN** 前端类型 MUST support `default_expiry_base`、`expiry_base_override`、`effective_expiry_base`
|
||||
- **AND** 前端类型 MUST support the corresponding Chinese name fields
|
||||
- **AND** 页面 MUST distinguish the default value, override value, and effective value
|
||||
|
||||
#### Scenario: Use backend effective expiry base
|
||||
|
||||
- **GIVEN** 分配响应同时返回默认值和覆盖值
|
||||
- **WHEN** 页面展示最终生效条件
|
||||
- **THEN** 页面 MUST display the backend returned `effective_expiry_base_name`
|
||||
- **AND** 前端 MUST NOT calculate or replace the effective value from the default value and override value
|
||||
|
||||
### Requirement: Package Allocation Expiry Base Applies Prospectively
|
||||
|
||||
The package allocation expiry-base override SHALL apply only to future new orders. The allocation creation and editing UI MUST inform the user that purchased packages are unaffected.
|
||||
|
||||
#### Scenario: Inform user before changing allocation expiry base
|
||||
|
||||
- **WHEN** 用户在已分配套餐编辑弹框查看或修改生效条件
|
||||
- **THEN** 页面 MUST display `仅影响后续新订单,不影响已购买套餐`
|
||||
|
||||
#### Scenario: Preserve purchased package behavior
|
||||
|
||||
- **WHEN** 用户创建、更新或恢复套餐分配的生效条件
|
||||
- **THEN** 前端 MUST NOT attempt to update existing purchased packages or historical orders
|
||||
@@ -0,0 +1,35 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Series Grant Package Expiry Base Visibility
|
||||
|
||||
The series grant package list and package edit context SHALL display the package allocation's default expiry base, override expiry base, and effective expiry base using the Chinese name fields returned by the backend.
|
||||
|
||||
#### Scenario: Display expiry bases in series grant package list
|
||||
|
||||
- **GIVEN** 用户进入代理系列授权套餐列表
|
||||
- **WHEN** 已授权套餐记录返回默认、覆盖和最终生效条件字段
|
||||
- **THEN** 页面 MUST display the default expiry base name, override expiry base name, and effective expiry base name for the package allocation
|
||||
|
||||
#### Scenario: Display expiry bases in package edit context
|
||||
|
||||
- **GIVEN** 用户打开代理系列授权中已授权套餐的编辑弹框
|
||||
- **WHEN** 套餐分配数据加载完成
|
||||
- **THEN** 页面 MUST display the default expiry base name, override expiry base name, and effective expiry base name
|
||||
- **AND** 页面 MUST display `仅影响后续新订单,不影响已购买套餐`
|
||||
|
||||
### Requirement: Series Grant Package Expiry Base Editing
|
||||
|
||||
The series grant package edit context SHALL provide `跟随套餐默认`, `购买即生效`, and `实名即生效` options, then update the corresponding package allocation record through the package allocation expiry-base API.
|
||||
|
||||
#### Scenario: Edit override from series grant package list
|
||||
|
||||
- **GIVEN** 用户正在代理系列授权套餐列表编辑已授权套餐
|
||||
- **WHEN** 用户选择生效条件并保存
|
||||
- **THEN** 系统 MUST use the corresponding package allocation record ID to call `PATCH /api/admin/shop-package-allocations/{id}/expiry-base`
|
||||
- **AND** 选择“跟随套餐默认”时请求 MUST explicitly contain `expiry_base_override: null`
|
||||
|
||||
#### Scenario: Refresh effective value after editing
|
||||
|
||||
- **WHEN** 代理系列授权套餐的生效条件更新成功
|
||||
- **THEN** 页面 MUST refresh the relevant package allocation data
|
||||
- **AND** 页面 MUST display the latest backend returned effective expiry base name
|
||||
Reference in New Issue
Block a user