Files
one-pipe-system/openspec/changes/add-shop-contact-phone-search/specs/shop-management/spec.md
luo 5079f97326
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m47s
feat: 店铺列表新增条件
2026-07-21 18:20:35 +08:00

2.6 KiB

ADDED Requirements

Requirement: Shop Contact Phone Search Input

The shop management list SHALL provide a 联系电话 search input in its filter area. The input MUST only accept an 11-digit numeric phone number for a contact phone search.

Scenario: Enter a valid contact phone

  • GIVEN 用户正在查看店铺列表筛选区
  • WHEN 用户输入 11 位数字联系电话
  • THEN 页面 MUST retain the entered phone number as the contact_phone search value
  • AND 用户 MUST be able to use the existing query action to search

Scenario: Prevent invalid contact phone query

  • GIVEN 用户输入的联系电话不是 11 位数字
  • WHEN 用户发起查询
  • THEN 页面 MUST NOT send a shop list request
  • AND 页面 MUST display an input validation error

Requirement: Shop Contact Phone Query Contract

The shop management list SHALL use contact_phone as an optional exact-match query parameter of GET /api/admin/shops while preserving the existing shop pagination response structure.

Scenario: Query shops by exact contact phone

  • GIVEN 用户输入有效的 11 位联系电话
  • WHEN 用户发起店铺列表查询
  • THEN 系统 MUST request GET /api/admin/shops with contact_phone equal to the entered value
  • AND 系统 MUST reset the list to the first page
  • AND 页面 MUST render the returned shop pagination result

Scenario: Omit empty contact phone from query

  • GIVEN 联系电话筛选值为空
  • WHEN 系统加载店铺列表
  • THEN 请求 MUST NOT include contact_phone

Requirement: Shop Contact Phone Search Reset and Result States

The shop management list SHALL clear the contact phone search through its existing reset or input clear interaction without affecting other selected filters. The page SHALL preserve existing loading and empty-result behavior.

Scenario: Clear contact phone while preserving other filters

  • GIVEN 用户已按联系电话和其他店铺条件查询
  • WHEN 用户清空联系电话并重新查询
  • THEN 系统 MUST request the list without contact_phone
  • AND 系统 MUST retain the other selected filters

Scenario: Display no matching shop result

  • GIVEN 用户输入有效的 11 位联系电话
  • WHEN 店铺接口返回空分页结果
  • THEN 页面 MUST render the existing empty table result state

Scenario: Display loading while querying contact phone

  • WHEN 系统正在按有效联系电话请求店铺列表
  • THEN 页面 MUST render the existing list loading state until the request completes