Files
device-voice-h5/openspec/changes/update-july-h5-c-iteration/specs/legacy-package-renewal/spec.md
luo 34ca1c5eca
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 59s
fix: 立即续费不跳转
2026-07-28 16:02:40 +08:00

60 lines
3.4 KiB
Markdown

## ADDED Requirements
### Requirement: Discontinued packages SHALL remain renewable only for eligible existing customers
The H5/C client SHALL keep discontinued packages out of the ordinary package catalog shown to new customers and agents. An eligible existing customer SHALL be able to use a valid `current_package_id` from asset info or `package_ids` from a historical order to continue a package renewal.
#### Scenario: New customer opens the package catalog
- **WHEN** the package catalog contains a discontinued package that is not the customer's current package
- **THEN** the client SHALL not display that package as an ordinary purchase option
#### Scenario: Existing customer is using a discontinued current package
- **WHEN** asset info returns a discontinued package through `current_package_id`
- **THEN** the client SHALL expose that ID only in the eligible renewal context
- **AND** the client SHALL allow the customer to continue through the existing standard order/payment flow without navigating to the package catalog
#### Scenario: Existing customer renews from a historical order
- **WHEN** a historical order returns one or more valid `package_ids`
- **THEN** the client SHALL use those IDs for the renewal selection when the order-list renewal entry is used
- **AND** the client SHALL preserve the historical order data unchanged
### Requirement: Renewal SHALL reuse the standard order creation contract
The client SHALL create a renewal by calling `POST /api/c/v1/orders/create` with the selected package ID or IDs, the asset `identifier`, and a currently allowed `payment_method`. It SHALL not invent or call a dedicated discontinued-package renewal endpoint.
#### Scenario: Submit a discontinued-package renewal
- **WHEN** an eligible customer confirms a renewal with an allowed payment method
- **THEN** the client SHALL submit the selected package IDs, identifier, and payment method to the standard order endpoint
- **AND** the client SHALL follow the standard payment response handling
#### Scenario: No eligible package ID is available
- **WHEN** neither asset info nor the relevant historical order supplies a valid package ID
- **THEN** the client SHALL show that renewal is unavailable
- **AND** the client SHALL not guess an ID from the ordinary package catalog
### Requirement: Renewal buttons SHALL be limited to the homepage and order list
The client SHALL show an `立即续费` button in the homepage asset summary and in every order card in the order list. The client SHALL NOT show a renewal button in the order detail page, package catalog, package-order page, or other pages.
#### Scenario: Customer renews from the homepage
- **WHEN** the homepage asset summary is displayed
- **THEN** the client SHALL show an `立即续费` button
- **AND** tapping it SHALL directly start the standard order/payment flow for the asset's current package ID when one is available
#### Scenario: Customer renews from an order card
- **WHEN** an order is displayed in the order list
- **THEN** the client SHALL show an `立即续费` button for that order
- **AND** tapping it SHALL directly start the standard order/payment flow for that order's package IDs without navigating to the package-order page
#### Scenario: Customer views another page
- **WHEN** the customer views any page other than the homepage or order list
- **THEN** the client SHALL NOT show an `立即续费` button