feat: 预计最终到期时间展示
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 8m8s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 8m8s
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Asset Estimated Final Expiry Contract
|
||||
|
||||
The admin asset information integration SHALL preserve `estimated_final_expires_at`, `days_until_final_expiry`, `expiry_estimate_status`, and `is_expiring` returned by `GET /api/admin/assets/resolve/{identifier}`.
|
||||
|
||||
#### Scenario: Preserve an exact final expiry estimate
|
||||
|
||||
- **GIVEN** 用户查询后台资产详情
|
||||
- **WHEN** `GET /api/admin/assets/resolve/{identifier}` returns `expiry_estimate_status=exact`
|
||||
- **THEN** 前端状态 MUST preserve `estimated_final_expires_at` as `string | null`
|
||||
- **AND** 前端状态 MUST preserve `days_until_final_expiry` as `number | null`
|
||||
- **AND** 前端状态 MUST preserve `is_expiring` as a boolean
|
||||
|
||||
#### Scenario: Preserve an unavailable final expiry estimate
|
||||
|
||||
- **GIVEN** 用户查询后台资产详情
|
||||
- **WHEN** 接口返回待激活或其他不可预计的 `expiry_estimate_status`
|
||||
- **THEN** 前端状态 MUST preserve `expiry_estimate_status`
|
||||
- **AND** 前端 MUST NOT derive `estimated_final_expires_at` from current-package or package-detail fields
|
||||
|
||||
### Requirement: Asset Estimated Final Expiry Display
|
||||
|
||||
The admin asset information view SHALL display one asset-level field labeled `预计套餐到期时间` for the current primary package and all queued primary packages, without replacing individual package expiry dates in package details.
|
||||
|
||||
#### Scenario: Display an exact final expiry date
|
||||
|
||||
- **GIVEN** 资产详情返回 `expiry_estimate_status=exact`
|
||||
- **AND** `estimated_final_expires_at` has a value
|
||||
- **WHEN** 页面渲染卡资产或设备资产基础信息
|
||||
- **THEN** 页面 MUST display `预计套餐到期时间`
|
||||
- **AND** 页面 MUST format and display `estimated_final_expires_at`
|
||||
|
||||
#### Scenario: Display activation-pending final expiry
|
||||
|
||||
- **GIVEN** 资产详情返回等待激活等不可预计的 `expiry_estimate_status`
|
||||
- **WHEN** 页面渲染卡资产或设备资产基础信息
|
||||
- **THEN** `预计套餐到期时间` MUST display `待激活后起算`
|
||||
- **AND** 页面 MUST NOT display a fabricated date
|
||||
|
||||
#### Scenario: Display no-package placeholder
|
||||
|
||||
- **GIVEN** 资产没有当前或排队主套餐
|
||||
- **AND** `estimated_final_expires_at` is null or absent
|
||||
- **WHEN** 页面渲染资产基础信息
|
||||
- **THEN** `预计套餐到期时间` MUST display a stable placeholder
|
||||
- **AND** 页面 MUST NOT substitute the current package detail expiry date
|
||||
|
||||
#### Scenario: Highlight backend-designated expiring asset
|
||||
|
||||
- **GIVEN** 资产详情返回 `is_expiring=true`
|
||||
- **WHEN** 页面渲染 `预计套餐到期时间`
|
||||
- **THEN** 页面 MUST apply the expiring visual treatment using `days_until_final_expiry`
|
||||
- **AND** 页面 MUST NOT derive whether the asset is expiring from a locally calculated date difference
|
||||
|
||||
#### Scenario: Preserve package detail expiry semantics
|
||||
|
||||
- **GIVEN** 用户查看资产详情中的套餐明细
|
||||
- **WHEN** 页面渲染单个套餐的到期时间
|
||||
- **THEN** 页面 MUST continue to display that package's own expiry field in the package detail context
|
||||
- **AND** 页面 MUST NOT replace it with `estimated_final_expires_at`
|
||||
@@ -0,0 +1,33 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Device Estimated Final Expiry Display
|
||||
|
||||
The device management list integration SHALL preserve and display the backend device-level estimated final package expiry fields without traversing bound cards or calculating package continuation dates in the frontend.
|
||||
|
||||
#### Scenario: Display exact device final expiry estimate
|
||||
|
||||
- **GIVEN** 设备列表接口返回 `expiry_estimate_status=exact` and `estimated_final_expires_at`
|
||||
- **WHEN** 页面渲染设备列表行
|
||||
- **THEN** 页面 MUST display a column labeled `预计套餐到期时间`
|
||||
- **AND** 该列 MUST format and display `estimated_final_expires_at`
|
||||
|
||||
#### Scenario: Display activation-pending device final expiry
|
||||
|
||||
- **GIVEN** 设备列表接口返回待激活等不可预计的 `expiry_estimate_status`
|
||||
- **WHEN** 页面渲染设备列表行
|
||||
- **THEN** `预计套餐到期时间` MUST display `待激活后起算`
|
||||
- **AND** 页面 MUST NOT traverse bound cards or display a fabricated date
|
||||
|
||||
#### Scenario: Highlight expiring device without reordering
|
||||
|
||||
- **GIVEN** 设备列表接口返回 `is_expiring=true` and `days_until_final_expiry`
|
||||
- **WHEN** 页面渲染该设备的预计套餐到期时间
|
||||
- **THEN** 页面 MUST apply the expiring visual treatment based on the backend fields
|
||||
- **AND** 页面 MUST NOT change the ordinary device list sort order because of `is_expiring`
|
||||
|
||||
#### Scenario: Display no-package device placeholder
|
||||
|
||||
- **GIVEN** 设备列表记录没有可预计的最终到期时间
|
||||
- **WHEN** 页面渲染预计套餐到期时间列
|
||||
- **THEN** 页面 MUST display a stable placeholder
|
||||
- **AND** 页面 MUST NOT use an individual package expiry as a substitute
|
||||
@@ -0,0 +1,33 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: IoT Card Estimated Final Expiry Display
|
||||
|
||||
The IoT card management list integration SHALL preserve and display the backend asset-level estimated final package expiry fields without calculating package continuation dates in the frontend.
|
||||
|
||||
#### Scenario: Display exact card final expiry estimate
|
||||
|
||||
- **GIVEN** 卡列表接口返回 `expiry_estimate_status=exact` and `estimated_final_expires_at`
|
||||
- **WHEN** 页面渲染卡列表行
|
||||
- **THEN** 页面 MUST display a column labeled `预计套餐到期时间`
|
||||
- **AND** 该列 MUST format and display `estimated_final_expires_at`
|
||||
|
||||
#### Scenario: Display activation-pending card final expiry
|
||||
|
||||
- **GIVEN** 卡列表接口返回待激活等不可预计的 `expiry_estimate_status`
|
||||
- **WHEN** 页面渲染卡列表行
|
||||
- **THEN** `预计套餐到期时间` MUST display `待激活后起算`
|
||||
- **AND** 页面 MUST NOT calculate or display a fabricated date
|
||||
|
||||
#### Scenario: Highlight expiring card without reordering
|
||||
|
||||
- **GIVEN** 卡列表接口返回 `is_expiring=true` and `days_until_final_expiry`
|
||||
- **WHEN** 页面渲染该卡的预计套餐到期时间
|
||||
- **THEN** 页面 MUST apply the expiring visual treatment based on the backend fields
|
||||
- **AND** 页面 MUST NOT change the ordinary card list sort order because of `is_expiring`
|
||||
|
||||
#### Scenario: Display no-package card placeholder
|
||||
|
||||
- **GIVEN** 卡列表记录没有可预计的最终到期时间
|
||||
- **WHEN** 页面渲染预计套餐到期时间列
|
||||
- **THEN** 页面 MUST display a stable placeholder
|
||||
- **AND** 页面 MUST NOT use an individual package expiry as a substitute
|
||||
Reference in New Issue
Block a user