Files
device-voice-h5/openspec/changes/update-july-h5-c-iteration/specs/order-display-fields/spec.md
luo 4f281da778
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m11s
feat: 7月迭代
2026-07-27 18:13:19 +08:00

2.3 KiB

ADDED Requirements

Requirement: Order views SHALL display backend role and asset snapshots

The H5/C client SHALL use GET /api/c/v1/orders and GET /api/c/v1/orders/{id} as the source of truth for order display. Order list and detail views SHALL display the backend purchase_role and asset_identifier values when present.

Scenario: Order includes a purchase role

  • WHEN an order response returns purchase_role
  • THEN the order list and detail view SHALL render that role
  • AND the client SHALL not infer the role from the current user or asset type

Scenario: Card order includes an asset identifier

  • WHEN a card order returns an asset_identifier snapshot
  • THEN the client SHALL display the returned card identifier, such as ICCID, without replacing it with a current asset lookup

Requirement: Device order identifiers SHALL prefer virtual number over IMEI

For device orders, the client SHALL display virtual_no/VirtualNo when it is non-empty, and SHALL use imei only when the virtual number is empty. The client SHALL not use sn as a substitute for the order asset identifier.

Scenario: Device has a virtual number

  • WHEN a device order response contains a non-empty virtual number and an IMEI
  • THEN the client SHALL display the virtual number
  • AND the client SHALL not display SN as the order device identifier

Scenario: Device virtual number is empty

  • WHEN a device order response has an empty virtual number and a non-empty IMEI
  • THEN the client SHALL display the IMEI

Scenario: Historical identifier data is empty

  • WHEN both the virtual number and IMEI are absent or empty
  • THEN the client SHALL show the existing empty placeholder
  • AND the client SHALL not fabricate an identifier from SN or a new asset-info request

Requirement: Order amounts SHALL use the common currency display rule

Order list and detail views SHALL display total_amount and package prices converted from integer cents to yuan while preserving the integer-cent values in API requests and response state.

Scenario: Display an order amount

  • WHEN an order response returns an amount in cents
  • THEN the client SHALL render the corresponding yuan value
  • AND the client SHALL not expose the raw cent value as the user-facing amount