feat: 卡新增IMEI
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m47s

This commit is contained in:
sexygoat
2026-05-26 18:07:39 +08:00
parent 878d93a865
commit fe0093972f
10 changed files with 152 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
## ADDED Requirements
### Requirement: Admin Card Asset Gateway IMEI Contract
The admin asset information integration SHALL accept and preserve `gateway_card_imei` for card assets, using the asset detail response as the primary source and the realtime-status response only as a fallback.
#### Scenario: Card asset detail preserves gateway_card_imei from resolve
- **GIVEN** 用户正在查看后台“资产信息”中的卡资产详情
- **AND** `GET /api/admin/assets/resolve/:identifier` 返回了有效 `gateway_card_imei`
- **WHEN** 前端解析卡资产详情响应
- **THEN** 页面状态 MUST 保留该 `gateway_card_imei`
- **AND** 后续展示 MUST 优先使用该详情值
#### Scenario: Card asset detail falls back to realtime-status when resolve lacks gateway_card_imei
- **GIVEN** 用户正在查看后台“资产信息”中的卡资产详情
- **AND** `GET /api/admin/assets/resolve/:identifier` 未返回有效 `gateway_card_imei`
- **AND** `GET /api/admin/assets/:identifier/realtime-status` 返回了有效 `gateway_card_imei`
- **WHEN** 前端合并实时状态到当前卡资产详情状态
- **THEN** 页面状态 MUST 使用 realtime-status 返回的 `gateway_card_imei` 作为回退值
### Requirement: Admin Card Asset Gateway IMEI Display
The admin asset information view SHALL display `gateway_card_imei` as `IMEI` only within the card asset `卡信息` section.
#### Scenario: Show gateway_card_imei in card information
- **GIVEN** 用户正在查看后台“资产信息”中的卡资产详情
- **AND** 当前卡资产详情状态中存在有效 `gateway_card_imei`
- **WHEN** 页面渲染“卡信息”区域
- **THEN** 页面 MUST 提供 `IMEI` 展示项
- **AND** 展示内容 MUST 与当前状态中的 `gateway_card_imei` 保持一致
#### Scenario: Show placeholder when no gateway_card_imei is available
- **GIVEN** 用户正在查看后台“资产信息”中的卡资产详情
- **AND** `GET /api/admin/assets/resolve/:identifier``GET /api/admin/assets/:identifier/realtime-status` 都未返回有效 `gateway_card_imei`
- **WHEN** 页面渲染“卡信息”区域中的 `IMEI`
- **THEN** 页面 MUST 显示 `-`
#### Scenario: Device asset detail does not render gateway_card_imei
- **GIVEN** 用户正在查看后台“资产信息”中的设备资产详情
- **WHEN** 页面渲染设备基础信息区域
- **THEN** 页面 MUST NOT 因 `gateway_card_imei` 新增 `IMEI` 展示项

View File

@@ -0,0 +1,20 @@
## ADDED Requirements
### Requirement: IoT Card Management Gateway IMEI Column
The IoT card management page SHALL display `gateway_card_imei` from `GET /api/admin/iot-cards/standalone` as an `IMEI` column in the list.
#### Scenario: Show IMEI when standalone list returns gateway_card_imei
- **GIVEN** 用户正在使用 IoT 卡管理列表
- **AND** `GET /api/admin/iot-cards/standalone` 返回的某条卡记录包含 `gateway_card_imei`
- **WHEN** 页面渲染列表行数据
- **THEN** 页面 MUST 提供 `IMEI`
- **AND** 对应行 MUST 直接展示该条记录返回的 `gateway_card_imei`
#### Scenario: Show placeholder when gateway_card_imei is missing
- **GIVEN** 用户正在使用 IoT 卡管理列表
- **AND** `GET /api/admin/iot-cards/standalone` 返回的某条卡记录未返回有效 `gateway_card_imei`
- **WHEN** 页面渲染该列表行
- **THEN** 该行的 `IMEI` 列 MUST 显示 `-`