@pisell/pisellos 2.3.146 → 2.3.147

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.
@@ -0,0 +1,9 @@
1
+ // 导出评估器
2
+ export { PromotionEvaluator } from "./evaluator";
3
+
4
+ // 导出适配器
5
+ export { PromotionAdapter } from "./adapter";
6
+ export { default } from "./adapter";
7
+
8
+ // 导出策略配置示例常量
9
+ export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
@@ -73,6 +73,8 @@ export interface OpenDataConfig {
73
73
  'sale.require_payment_on_submit'?: boolean | null;
74
74
  'sale.enable_item_rules'?: boolean;
75
75
  'sale.enable_short_number'?: boolean;
76
+ 'sale.short_number_digits'?: number;
77
+ 'sale.short_number_random'?: boolean;
76
78
  'sale.short_number_daily_reset'?: boolean;
77
79
  'sale.short_number_start_number'?: number;
78
80
  'sale.short_number_prefix'?: string | null;
@@ -593,7 +593,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
593
593
  generateIdempotencyToken(): string;
594
594
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
595
595
  createOrder(params: CommitOrderParams['query']): {
596
- type: "virtual" | "appointment_booking";
596
+ type: "appointment_booking" | "virtual";
597
597
  platform: string;
598
598
  sales_channel: string;
599
599
  order_sales_channel: string;
@@ -175,7 +175,11 @@ function resolveCutOffPolicyIssue(policy) {
175
175
  return null;
176
176
  }
177
177
  function addLeadWindow(base, unit, unitType, _timezoneName) {
178
- if (unitType === 'days') return addLocalCalendarDays(base, unit);
178
+ if (unitType === 'days') {
179
+ var leadDate = addLocalCalendarDays(base, unit);
180
+ // Positive day lead times start at midnight; zero days keeps the current-time boundary.
181
+ return Math.trunc(unit) > 0 ? localDateToScalarStart(formatLocalDate(leadDate)) : leadDate;
182
+ }
179
183
  if (unitType === 'hours') return addLocalHours(base, unit);
180
184
  return addLocalMinutes(base, unit);
181
185
  }
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
328
328
  date: string;
329
329
  status: string;
330
330
  week: string;
331
- weekNum: 0 | 1 | 2 | 5 | 4 | 3 | 6;
331
+ weekNum: 0 | 1 | 2 | 3 | 5 | 4 | 6;
332
332
  }[]>;
333
333
  submitTimeSlot(timeSlots: TimeSliceItem): void;
334
334
  private getScheduleDataByIds;
@@ -347,7 +347,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
347
347
  count: number;
348
348
  left: number;
349
349
  summaryCount: number;
350
- status: "lots_of_space" | "filling_up_fast" | "sold_out";
350
+ status: "sold_out" | "lots_of_space" | "filling_up_fast";
351
351
  }[];
352
352
  /**
353
353
  * 找到多个资源的公共可用时间段
@@ -571,7 +571,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
571
571
  value: function () {
572
572
  var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
573
573
  var _openDataConfig, _openDataConfig2, _openDataConfig3, _openDataConfig4, _openDataConfig5, _openDataConfig6;
574
- var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode;
574
+ var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode, _openDataConfig7;
575
575
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
576
576
  while (1) switch (_context8.prev = _context8.next) {
577
577
  case 0:
@@ -632,6 +632,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
632
632
  // TODO 现在 picoding 没这个配置的 key
633
633
  padReceiptSequence: false,
634
634
  receiptSequenceLength: receiptSequenceLength,
635
+ randomReceiptSequence: ((_openDataConfig7 = openDataConfig) === null || _openDataConfig7 === void 0 ? void 0 : _openDataConfig7['sale.short_number_random']) === true,
635
636
  resetReceiptSequenceDaily: resetReceiptSequenceDaily,
636
637
  receiptSequenceResetTime: operatingDayBoundary === null || operatingDayBoundary === void 0 ? void 0 : operatingDayBoundary.time,
637
638
  receiptSequenceStart: receiptSequenceStart,
@@ -1 +1,46 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _examples.BUY_X_GET_Y_FREE_STRATEGY;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _examples.ITEM_REWARD_STRATEGY;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "PromotionAdapter", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _adapter.PromotionAdapter;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "PromotionEvaluator", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _evaluator.PromotionEvaluator;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "default", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _adapter.default;
40
+ }
41
+ });
42
+ var _evaluator = require("./evaluator");
43
+ var _adapter = _interopRequireWildcard(require("./adapter"));
44
+ var _examples = require("./examples");
45
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
46
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -73,6 +73,8 @@ export interface OpenDataConfig {
73
73
  'sale.require_payment_on_submit'?: boolean | null;
74
74
  'sale.enable_item_rules'?: boolean;
75
75
  'sale.enable_short_number'?: boolean;
76
+ 'sale.short_number_digits'?: number;
77
+ 'sale.short_number_random'?: boolean;
76
78
  'sale.short_number_daily_reset'?: boolean;
77
79
  'sale.short_number_start_number'?: number;
78
80
  'sale.short_number_prefix'?: string | null;
@@ -593,7 +593,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
593
593
  generateIdempotencyToken(): string;
594
594
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
595
595
  createOrder(params: CommitOrderParams['query']): {
596
- type: "virtual" | "appointment_booking";
596
+ type: "appointment_booking" | "virtual";
597
597
  platform: string;
598
598
  sales_channel: string;
599
599
  order_sales_channel: string;
@@ -163,7 +163,11 @@ function resolveCutOffPolicyIssue(policy) {
163
163
  return null;
164
164
  }
165
165
  function addLeadWindow(base, unit, unitType, _timezoneName) {
166
- if (unitType === 'days') return (0, _localClock.addLocalCalendarDays)(base, unit);
166
+ if (unitType === 'days') {
167
+ const leadDate = (0, _localClock.addLocalCalendarDays)(base, unit);
168
+ // Positive day lead times start at midnight; zero days keeps the current-time boundary.
169
+ return Math.trunc(unit) > 0 ? (0, _localClock.localDateToScalarStart)((0, _localClock.formatLocalDate)(leadDate)) : leadDate;
170
+ }
167
171
  if (unitType === 'hours') return (0, _localClock.addLocalHours)(base, unit);
168
172
  return (0, _localClock.addLocalMinutes)(base, unit);
169
173
  }
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
328
328
  date: string;
329
329
  status: string;
330
330
  week: string;
331
- weekNum: 0 | 1 | 2 | 5 | 4 | 3 | 6;
331
+ weekNum: 0 | 1 | 2 | 3 | 5 | 4 | 6;
332
332
  }[]>;
333
333
  submitTimeSlot(timeSlots: TimeSliceItem): void;
334
334
  private getScheduleDataByIds;
@@ -347,7 +347,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
347
347
  count: number;
348
348
  left: number;
349
349
  summaryCount: number;
350
- status: "lots_of_space" | "filling_up_fast" | "sold_out";
350
+ status: "sold_out" | "lots_of_space" | "filling_up_fast";
351
351
  }[];
352
352
  /**
353
353
  * 找到多个资源的公共可用时间段
@@ -367,6 +367,7 @@ class BookingTicketImpl extends _BaseSales.BaseSalesImpl {
367
367
  // TODO 现在 picoding 没这个配置的 key
368
368
  padReceiptSequence: false,
369
369
  receiptSequenceLength,
370
+ randomReceiptSequence: openDataConfig?.['sale.short_number_random'] === true,
370
371
  resetReceiptSequenceDaily,
371
372
  receiptSequenceResetTime: operatingDayBoundary?.time,
372
373
  receiptSequenceStart,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.3.146",
4
+ "version": "2.3.147",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",