import type { SalesSdkCartContextValue, SalesSdkContextValue, SalesSdkCustomerContextValue, SalesSdkProductsContextValue } from '../../types'; import type { DemoFixtureCreate, DemoFixtureEdit } from '../fixtures'; import type { DemoStep } from './DemoStepRunner'; /** * 「一键测试用例」step 序列构造器(新建 / 编辑 共享业务逻辑)。 * * 设计点: * - 步骤 run 闭包内**不**直接读 React state 引用(如 `customer.list`)—— 因为 hooks 返回值 * 可能在串行执行过程中已更新;统一通过 `bookingTicket.store?.customer / order` 这种 * OS 同步 getter,或者步骤之间通过捕获前一步的返回值传递。 * - 不发明等价关系:customer 选择走 `customer.loadById` + `customer.select`;商品挑选 * 严格用 `products.products`(来自 `getProductCatalog()`,与 OS 协议一致)。 * - submit 必须二次确认;createNew / addProduct 都是真接口但默认直接调用,提示由 Tab 顶部 * Banner 给出(与原 demo 行为一致,避免每步都弹框)。 */ export interface BuildStepsDeps { sales: SalesSdkContextValue; customer: SalesSdkCustomerContextValue; products: SalesSdkProductsContextValue; cart: SalesSdkCartContextValue; } /** 新建 Tab:第一步走 sales.createNew,其余复用 mutable 步骤 */ export declare function buildCreateSteps(deps: BuildStepsDeps, fixture: DemoFixtureCreate): DemoStep[]; /** 编辑 Tab:第一步走 sales.loadDetail(orderId),再写元数据,其余复用 mutable 步骤 */ export declare function buildEditSteps(deps: BuildStepsDeps, fixture: DemoFixtureEdit): DemoStep[];