37 lines
2.1 KiB
Markdown
37 lines
2.1 KiB
Markdown
## ADDED Requirements
|
|
|
|
### Requirement: Bind page SHALL prefill the account main phone
|
|
The system SHALL prefill the bind-phone input with the logged-in account's main phone when one exists, using `GET /api/c/v1/asset/info` -> `bound_phone`, and SHALL allow sending a `bind_phone` verification code to that number.
|
|
|
|
#### Scenario: Existing account with a main phone enters the bind page
|
|
- **WHEN** the account already has a main phone and the user enters `pages/bind/bind`
|
|
- **THEN** the phone input SHALL be prefilled with the main phone
|
|
- **AND** the user SHALL be able to request a `bind_phone` verification code for that number without being rejected
|
|
|
|
#### Scenario: New account without a main phone enters the bind page
|
|
- **WHEN** the account has no main phone
|
|
- **THEN** the phone input SHALL remain empty
|
|
- **AND** the user SHALL enter a new number and follow the normal bind flow
|
|
|
|
### Requirement: Bind submission SHALL be idempotent for the account main phone
|
|
When `POST /api/c/v1/auth/bind-phone` is submitted with the account main phone and a valid code, the system SHALL treat it as a successful idempotent association instead of rejecting because the phone is already in use.
|
|
|
|
#### Scenario: Main phone plus valid code
|
|
- **WHEN** the submitted phone equals the account main phone and the code is valid
|
|
- **THEN** the bind request SHALL succeed
|
|
- **AND** the response SHALL keep the existing shape (`phone`, `bound_at`)
|
|
- **AND** the existing bind-completion routing SHALL apply unchanged
|
|
|
|
#### Scenario: Number different from the main phone
|
|
- **WHEN** the submitted phone differs from the account main phone
|
|
- **THEN** the bind request SHALL be rejected
|
|
- **AND** the system SHALL display the backend `msg` and keep the user on the bind page
|
|
|
|
### Requirement: Bind failures SHALL display backend messages
|
|
The system SHALL present the backend-provided error message for all bind-phone failures instead of a generic failure text, and SHALL keep the user on the bind page.
|
|
|
|
#### Scenario: Backend rejection with message
|
|
- **WHEN** `bind-phone` returns a business error
|
|
- **THEN** the bind page SHALL show the returned `msg`
|
|
- **AND** the page SHALL NOT navigate away
|