@pisell/pisellos 2.2.233 → 2.2.235

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/modules/Order/index.d.ts +36 -1
  2. package/dist/modules/Order/index.js +496 -308
  3. package/dist/modules/Order/types.d.ts +11 -0
  4. package/dist/modules/Order/utils.d.ts +1 -0
  5. package/dist/modules/Order/utils.js +1 -1
  6. package/dist/server/index.d.ts +5 -0
  7. package/dist/server/index.js +855 -633
  8. package/dist/server/modules/order/index.d.ts +2 -0
  9. package/dist/server/modules/order/index.js +86 -32
  10. package/dist/solution/BaseSales/index.d.ts +6 -0
  11. package/dist/solution/BaseSales/index.js +240 -197
  12. package/dist/solution/BookingByStep/index.d.ts +1 -1
  13. package/dist/solution/BookingTicket/index.d.ts +40 -1
  14. package/dist/solution/BookingTicket/index.js +674 -314
  15. package/dist/solution/BookingTicket/types.d.ts +62 -0
  16. package/dist/solution/BookingTicket/types.js +30 -0
  17. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  18. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
  19. package/dist/solution/BookingTicket/utils/cartView.d.ts +9 -1
  20. package/dist/solution/BookingTicket/utils/cartView.js +76 -5
  21. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  22. package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
  23. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +9 -13
  24. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +42 -33
  25. package/lib/modules/Order/index.d.ts +36 -1
  26. package/lib/modules/Order/index.js +98 -10
  27. package/lib/modules/Order/types.d.ts +11 -0
  28. package/lib/modules/Order/utils.d.ts +1 -0
  29. package/lib/modules/Order/utils.js +1 -1
  30. package/lib/server/index.d.ts +5 -0
  31. package/lib/server/index.js +224 -63
  32. package/lib/server/modules/order/index.d.ts +2 -0
  33. package/lib/server/modules/order/index.js +43 -1
  34. package/lib/solution/BaseSales/index.d.ts +6 -0
  35. package/lib/solution/BaseSales/index.js +20 -1
  36. package/lib/solution/BookingByStep/index.d.ts +1 -1
  37. package/lib/solution/BookingTicket/index.d.ts +40 -1
  38. package/lib/solution/BookingTicket/index.js +201 -4
  39. package/lib/solution/BookingTicket/types.d.ts +62 -0
  40. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  41. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
  42. package/lib/solution/BookingTicket/utils/cartView.d.ts +9 -1
  43. package/lib/solution/BookingTicket/utils/cartView.js +48 -2
  44. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  45. package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
  46. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +9 -13
  47. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +41 -28
  48. package/package.json +1 -1
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 1 | 5 | 4 | 2 | 3 | 6;
314
+ weekNum: 0 | 1 | 2 | 3 | 6 | 5 | 4;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -1,13 +1,14 @@
1
1
  import { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import { BookingTicketCartView, BookingTicketProductCatalogView, BookingTicketState, IGetCustomerListParams, ICustomer, ILoadProductsParams, ILoadProductDetailParams, IScanResult } from './types';
3
3
  import type { ProductData } from '../../modules';
4
+ import type { OpenDataConfig } from '../../modules/OpenData';
4
5
  import { type BookingContextConfig, type BookingContextDateInput, type BookingContextResource, type BookingContextResourceMap, type BookingContextState, type InitBookingContextParams, type LoadBookingConfigParams, type LoadBookingResourcesParams, type ResourceError, type BookingCalcContext } from '../../modules/BookingContext';
5
6
  import type { OrderCustomerView } from '../../modules/Order/types';
6
7
  import { BaseSalesImpl } from '../BaseSales';
7
8
  import type { BaseSalesScanCodeResult } from '../BaseSales/types';
8
9
  import type { ISalesDetail } from '../BaseSales/utils/parseSalesResponse';
9
10
  import type { LoadSalesDetailParams } from '../../modules/Order/types';
10
- import type { GlobalScanHandleResult, GlobalScanHostBridge } from './types';
11
+ import type { AddAddTimeProductToBookingInput, AddAddTimeProductsToBookingInput, GlobalScanHandleResult, GlobalScanHostBridge } from './types';
11
12
  import { AddProductDecideContext, AddProductRequiresDetailPayload } from './utils/addProductDecision';
12
13
  import { type BuildCacheItemFromOrderLineInput } from '../../modules/BookingContext/utils/buildCacheItemFromOrderLine';
13
14
  import { type BuildNormalProductCacheItemFromOrderLineInput } from '../../modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine';
@@ -25,6 +26,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
25
26
  private platform;
26
27
  private scan;
27
28
  private productCatalog;
29
+ private addTimeProductsCatalog;
28
30
  private orderCustomerDiscountRefreshInFlight;
29
31
  private orderCustomerDiscountRefreshCustomerId;
30
32
  private loadOpenDataConfigInFlight;
@@ -43,6 +45,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
43
45
  private getBookingTicketBusinessCode;
44
46
  private getIdGeneratorPlugin;
45
47
  private loadOpenDataConfig;
48
+ getOpenData(): Promise<OpenDataConfig | null>;
46
49
  private getShortNumberOrDeviceId;
47
50
  private configureIdGeneratorFromOpenData;
48
51
  private normalizePositiveInteger;
@@ -512,6 +515,42 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
512
515
  */
513
516
  handleGlobalScanCode(code: string, bridge?: GlobalScanHostBridge): Promise<GlobalScanHandleResult>;
514
517
  resolveBestAddTimePlan(addTimeProducts: any[], targetMinutes: number): any;
518
+ /**
519
+ * 构造一条绑定到已有 booking 的加时商品行。
520
+ *
521
+ * @example
522
+ * const line = this.buildAddTimeOrderLine({ product, product_add_schedule_time: 30 }, 'booking-1');
523
+ */
524
+ private buildAddTimeOrderLine;
525
+ /**
526
+ * 将加时商品作为独立商品行绑定到已有 booking。
527
+ *
528
+ * 与预约商品加车不同,本方法不会把当前 booking 作为 `addProductToOrder` 第二参数传入,
529
+ * 避免 OrderModule 新建 booking 或重写已有 booking.product_uid。
530
+ *
531
+ * @example
532
+ * await bookingTicket.addAddTimeProductToBooking({
533
+ * booking,
534
+ * product,
535
+ * num: 1,
536
+ * price: '10.00',
537
+ * product_add_schedule_time: 30,
538
+ * });
539
+ */
540
+ addAddTimeProductToBooking(input: AddAddTimeProductToBookingInput): Promise<OrderProduct[]>;
541
+ /**
542
+ * 批量将加时商品作为独立商品行绑定到已有 booking,并只触发一次购物车重算。
543
+ *
544
+ * @example
545
+ * await bookingTicket.addAddTimeProductsToBooking({
546
+ * booking,
547
+ * products: [{ product, product_add_schedule_time: 30 }],
548
+ * });
549
+ */
550
+ addAddTimeProductsToBooking(input: AddAddTimeProductsToBookingInput): Promise<OrderProduct[]>;
551
+ setOtherParams(params: Record<string, any>, { cover }?: {
552
+ cover?: boolean;
553
+ }): Promise<void>;
515
554
  /**
516
555
  * 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
517
556
  * 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。