## ADDED Requirements ### Requirement: Asset Exchange Generation Trace Display The asset information page SHALL display exchange generation relationships exclusively from `exchange_trace.previous_asset` and `exchange_trace.next_asset` returned by `GET /api/admin/assets/resolve/{identifier}`. The frontend MUST NOT infer the exchange chain from asset status, generation, exchange order status, or any field outside `exchange_trace`. #### Scenario: Display previous asset for a replacement asset - **GIVEN** 用户正在查看资产信息页 - **WHEN** 解析响应包含非空的 `exchange_trace.previous_asset` - **THEN** 页面 MUST 显示“换货新资产”标签 - **AND** 页面 MUST 展示前代资产的标识符和换货单号 - **AND** 页面 MUST use `previous_asset.identifier` and `previous_asset.exchange_no` as the displayed source values #### Scenario: Display next asset for a replaced asset - **GIVEN** 用户正在查看资产信息页 - **WHEN** 解析响应包含非空的 `exchange_trace.next_asset` - **THEN** 页面 MUST 显示“已换出旧资产”标签 - **AND** 页面 MUST 展示后代资产的标识符和换货单号 - **AND** 页面 MUST use `next_asset.identifier` and `next_asset.exchange_no` as the displayed source values #### Scenario: Display both relationships for an intermediate asset - **GIVEN** 用户正在查看位于换货链中间的资产 - **WHEN** 解析响应同时包含非空的 `previous_asset` 和 `next_asset` - **THEN** 页面 MUST 同时展示“换货新资产”和“已换出旧资产”两个关联区域 - **AND** 两个区域 MUST use their corresponding relationship item values independently #### Scenario: Hide absent exchange relationship - **GIVEN** 用户正在查看资产信息页 - **WHEN** `previous_asset` 或 `next_asset` 为 `null`、空值或未返回 - **THEN** 页面 MUST NOT 展示对应的换货关联区域 - **AND** 前端 MUST NOT 根据资产状态、世代编号、换货单状态或其他字段推导该区域 #### Scenario: Display no exchange relationship for unrelated asset - **GIVEN** 用户正在查看无前代和后代换货关系的资产 - **WHEN** 解析响应未返回 `exchange_trace` 或 `exchange_trace` 内两个关联项均为空 - **THEN** 页面 MUST NOT 展示“换货新资产”标签 - **AND** 页面 MUST NOT 展示“已换出旧资产”标签 - **AND** 页面 MUST NOT render an empty exchange relationship placeholder ### Requirement: Exchange Related Asset Navigation Authorization The asset information page SHALL allow navigation to a related exchange asset only when that relationship item has `can_view=true`. When `can_view=false`, the relationship item SHALL remain visible as text only and MUST NOT provide any asset-detail navigation affordance. #### Scenario: Navigate to authorized related asset - **GIVEN** 换货关联资产项的 `can_view=true` - **WHEN** 用户点击关联资产标识符 - **THEN** 系统 MUST 跳转到该关联资产的资产详情 - **AND** 跳转 MUST 使用关联项返回的 `identifier` - **AND** 页面 MUST NOT reconstruct the target identifier from the current asset or exchange order #### Scenario: Render unauthorized related asset as text - **GIVEN** 换货关联资产项的 `can_view=false` - **WHEN** 页面渲染换货关联区域 - **THEN** 页面 MUST 展示关联资产标识符和换货单号 - **AND** 页面 MUST NOT 将关联资产标识符渲染为可点击跳转操作 #### Scenario: Render nullable related asset ID without navigation - **GIVEN** 换货关联资产项的 `asset_id=null` - **AND** 该关联资产项的 `can_view=false` - **WHEN** 页面渲染换货关联区域 - **THEN** 页面 MUST 展示关联资产标识符和换货单号 - **AND** 页面 MUST NOT depend on `asset_id` to render the relationship text - **AND** 页面 MUST NOT provide navigation to the related asset ### Requirement: Exchange Trace Response Contract The frontend asset resolve contract SHALL support optional `exchange_trace.previous_asset` and `exchange_trace.next_asset` returned by `GET /api/admin/assets/resolve/{identifier}`. Each non-empty relationship item SHALL preserve `asset_type:string`, `asset_id:int64|null`, `identifier:string`, `exchange_no:string`, and `can_view:bool`. #### Scenario: Read exchange trace response fields - **WHEN** 前端解析 `GET /api/admin/assets/resolve/{identifier}` 响应 - **THEN** 前端类型 MUST 支持 `exchange_trace.previous_asset` 和 `exchange_trace.next_asset` - **AND** 每个非空关联项 MUST 支持读取 `asset_type`、`asset_id`、`identifier`、`exchange_no`、`can_view` - **AND** `asset_id` MUST allow `null` for no-permission relationship items - **AND** `previous_asset` and `next_asset` MUST each allow `null`, empty, or omitted values #### Scenario: Preserve asset type in exchange trace item - **WHEN** 解析响应返回 `exchange_trace.previous_asset` 或 `exchange_trace.next_asset` - **THEN** 前端类型 MUST preserve `asset_type` as a string value such as `device` or `card` - **AND** 页面 logic MUST NOT assume all related exchange assets are the same type as the current asset