import type { ICustomer, ISalesBooking, ProductData, SalesSdkCartItemView, SalesSdkCustomerView, ScanOrderOrderProduct, ScanOrderTempOrder } from '../types'; /** * enrichCartItem 多源合并(仅活在 React 内存,不污染 OS tempOrder.products 提交契约)。 * * 数据来源按字段优先级: * - title / cover / variant_title / option / bundle 标题:bookings*.detail(编辑态权威) * → productsCatalog 兜底(新建态从商品列表点加购,编辑态做兜底) * - duration / product_resource / capacity:bookings*.product(编辑态商品快照) * → productsCatalog 兜底 * - start_at / end_at / resource_id:bookings 主资源(仅编辑态) * - note:detail.note → line.note(行级备注) * * 入参严格遵守 .cursor/rules/data-field-semantics.mdc:bookings 通过 product_uid 反查 * (不发明 booking_id ↔ product 之间的等价关系),catalog 通过 product_id 字符串比对。 */ export declare function enrichCartItem(line: ScanOrderOrderProduct, ctx: { bookingDetailMap?: Record; productsCatalog: ProductData[]; /** OS runtime:`tempOrder._extend.productsByUid`,加车后 `_origin` 会落在这里 */ productsByUid?: Record; }>; }): SalesSdkCartItemView; /** * 批量 enrich,保留行顺序。 */ export declare function enrichCartItems(lines: ScanOrderOrderProduct[], ctx: { bookingDetailMap?: Record; productsCatalog: ProductData[]; productsByUid?: Record; }>; }): SalesSdkCartItemView[]; /** * 客户视图:selected 优先(OS CustomerModule 给出的最完整客户对象), * 缺失时回落到 tempOrder.customer_*(编辑态服务端 hydrate 后写入 tempOrder 顶层)。 * * 不复用 ticketBooking 老 _formatBookingDetail 中的兜底链 * (`customer_id || customer?.id || customer?.customer_id || 1`),避免盲推断 walk-in 语义。 */ export declare function enrichCustomer(selected: ICustomer | null | undefined, tempOrder: ScanOrderTempOrder | null | undefined): SalesSdkCustomerView | null;