@pisell/pisellos 2.2.146 → 2.2.148

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.
@@ -6,9 +6,9 @@ export var locales = {
6
6
  'max_passes_per_item_reached': '该商品已达到卡券使用上限',
7
7
  'not_available_for_this_channel': '当前渠道不可使用',
8
8
  'not_valid_for_this_order_type': '当前订单类型不适用',
9
- 'order_total_amount_not_enough': '订单满 {currency}{value} 才可用',
10
- 'applicable_product_total_amount_not_enough': '适用商品满 {currency}{value} 才可用',
11
- 'applicable_product_count_not_enough': '至少购买 {value} 件适用商品才可用'
9
+ 'order_total_amount_not_enough': ' {currency}{value} 可用',
10
+ 'applicable_product_total_amount_not_enough': ' {currency}{value} 可用',
11
+ 'applicable_product_count_not_enough': '至少 {value} '
12
12
  },
13
13
  'en': {
14
14
  'not_meet_the_required_conditions': 'Not meet the required conditions.',
@@ -18,8 +18,8 @@ export var locales = {
18
18
  'not_available_for_this_channel': 'Not available for this channel.',
19
19
  'not_valid_for_this_order_type': 'Not valid for this order type.',
20
20
  'order_total_amount_not_enough': 'Spend {currency}{value} to use',
21
- 'applicable_product_total_amount_not_enough': '{currency}{value} on eligible items',
22
- 'applicable_product_count_not_enough': 'Buy {value} eligible items to use'
21
+ 'applicable_product_total_amount_not_enough': 'Spend {currency}{value} to use',
22
+ 'applicable_product_count_not_enough': 'Min. Qty {value}'
23
23
  },
24
24
  'zh-HK': {
25
25
  'not_meet_the_required_conditions': '未達使用條件',
@@ -28,8 +28,8 @@ export var locales = {
28
28
  'max_passes_per_item_reached': '該商品已達卡券使用上限',
29
29
  'not_available_for_this_channel': '當前渠道不可使用',
30
30
  'not_valid_for_this_order_type': '當前訂單類型不適用',
31
- 'order_total_amount_not_enough': '訂單滿 {currency}{value} 才可用',
32
- 'applicable_product_total_amount_not_enough': '適用商品滿 {currency}{value} 才可用',
33
- 'applicable_product_count_not_enough': '至少購買 {value} 件適用商品才可用'
31
+ 'order_total_amount_not_enough': '滿 {currency}{value} 可用',
32
+ 'applicable_product_total_amount_not_enough': '滿 {currency}{value} 可用',
33
+ 'applicable_product_count_not_enough': '至少 {value} '
34
34
  }
35
35
  };
@@ -70,7 +70,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
70
70
  value: function () {
71
71
  var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
72
72
  var _options$initialState;
73
- var appPlugin, app, _this$store$createdAt, coreData, today, operatingDayBoundary, boundaryTime, boundaryStart, boundaryEnd;
73
+ var appPlugin, app, _this$store$createdAt, coreData, today, operatingDayBoundary, boundaryTime, boundaryStart, isAfterBoundary, queryStart, queryEnd;
74
74
  return _regeneratorRuntime().wrap(function _callee$(_context) {
75
75
  while (1) switch (_context.prev = _context.next) {
76
76
  case 0:
@@ -91,10 +91,12 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
91
91
  if (operatingDayBoundary.type === 'start_time') {
92
92
  boundaryTime = String(operatingDayBoundary.time || '').trim();
93
93
  boundaryStart = dayjs("".concat(today.format('YYYY-MM-DD'), " ").concat(boundaryTime));
94
- boundaryEnd = boundaryStart.add(1, 'day');
95
94
  if (boundaryStart.isValid()) {
95
+ isAfterBoundary = today.isAfter(boundaryStart);
96
+ queryStart = isAfterBoundary ? today.startOf('day') : today.subtract(1, 'day').startOf('day');
97
+ queryEnd = isAfterBoundary ? today.add(1, 'day').endOf('day') : today.endOf('day');
96
98
  this.store.createdAtQuery = {
97
- sales_time_between: [boundaryStart.format('YYYY-MM-DD HH:mm:ss'), boundaryEnd.format('YYYY-MM-DD HH:mm:ss')]
99
+ sales_time_between: [queryStart.format('YYYY-MM-DD HH:mm:ss'), queryEnd.format('YYYY-MM-DD HH:mm:ss')]
98
100
  };
99
101
  } else {
100
102
  // 边界时间异常时回退到自然日,避免 createdAtQuery 为空导致后续查询异常
@@ -308,7 +308,6 @@ export function filterBookingsFromOrders(orders, filters) {
308
308
 
309
309
  // 订单级预过滤
310
310
  if (!matchOrder(order, ctx)) continue;
311
- debugger;
312
311
 
313
312
  // 订单通过,遍历其 bookings;orderInfo 延迟创建
314
313
  var orderInfo = null;
@@ -30,9 +30,9 @@ var locales = {
30
30
  "max_passes_per_item_reached": "该商品已达到卡券使用上限",
31
31
  "not_available_for_this_channel": "当前渠道不可使用",
32
32
  "not_valid_for_this_order_type": "当前订单类型不适用",
33
- "order_total_amount_not_enough": "订单满 {currency}{value} 才可用",
34
- "applicable_product_total_amount_not_enough": "适用商品满 {currency}{value} 才可用",
35
- "applicable_product_count_not_enough": "至少购买 {value} 件适用商品才可用"
33
+ "order_total_amount_not_enough": " {currency}{value} 可用",
34
+ "applicable_product_total_amount_not_enough": " {currency}{value} 可用",
35
+ "applicable_product_count_not_enough": "至少 {value} "
36
36
  },
37
37
  "en": {
38
38
  "not_meet_the_required_conditions": "Not meet the required conditions.",
@@ -42,8 +42,8 @@ var locales = {
42
42
  "not_available_for_this_channel": "Not available for this channel.",
43
43
  "not_valid_for_this_order_type": "Not valid for this order type.",
44
44
  "order_total_amount_not_enough": "Spend {currency}{value} to use",
45
- "applicable_product_total_amount_not_enough": "{currency}{value} on eligible items",
46
- "applicable_product_count_not_enough": "Buy {value} eligible items to use"
45
+ "applicable_product_total_amount_not_enough": "Spend {currency}{value} to use",
46
+ "applicable_product_count_not_enough": "Min. Qty {value}"
47
47
  },
48
48
  "zh-HK": {
49
49
  "not_meet_the_required_conditions": "未達使用條件",
@@ -52,9 +52,9 @@ var locales = {
52
52
  "max_passes_per_item_reached": "該商品已達卡券使用上限",
53
53
  "not_available_for_this_channel": "當前渠道不可使用",
54
54
  "not_valid_for_this_order_type": "當前訂單類型不適用",
55
- "order_total_amount_not_enough": "訂單滿 {currency}{value} 才可用",
56
- "applicable_product_total_amount_not_enough": "適用商品滿 {currency}{value} 才可用",
57
- "applicable_product_count_not_enough": "至少購買 {value} 件適用商品才可用"
55
+ "order_total_amount_not_enough": "滿 {currency}{value} 可用",
56
+ "applicable_product_total_amount_not_enough": "滿 {currency}{value} 可用",
57
+ "applicable_product_count_not_enough": "至少 {value} "
58
58
  }
59
59
  };
60
60
  // Annotate the CommonJS export names for ESM import in node:
@@ -71,12 +71,14 @@ var OrderModule = class extends import_BaseModule.BaseModule {
71
71
  if (operatingDayBoundary.type === "start_time") {
72
72
  const boundaryTime = String(operatingDayBoundary.time || "").trim();
73
73
  const boundaryStart = (0, import_dayjs.default)(`${today.format("YYYY-MM-DD")} ${boundaryTime}`);
74
- const boundaryEnd = boundaryStart.add(1, "day");
75
74
  if (boundaryStart.isValid()) {
75
+ const isAfterBoundary = today.isAfter(boundaryStart);
76
+ const queryStart = isAfterBoundary ? today.startOf("day") : today.subtract(1, "day").startOf("day");
77
+ const queryEnd = isAfterBoundary ? today.add(1, "day").endOf("day") : today.endOf("day");
76
78
  this.store.createdAtQuery = {
77
79
  sales_time_between: [
78
- boundaryStart.format("YYYY-MM-DD HH:mm:ss"),
79
- boundaryEnd.format("YYYY-MM-DD HH:mm:ss")
80
+ queryStart.format("YYYY-MM-DD HH:mm:ss"),
81
+ queryEnd.format("YYYY-MM-DD HH:mm:ss")
80
82
  ]
81
83
  };
82
84
  } else {
@@ -308,7 +308,6 @@ function filterBookingsFromOrders(orders, filters) {
308
308
  continue;
309
309
  if (!matchOrder(order, ctx))
310
310
  continue;
311
- debugger;
312
311
  let orderInfo = null;
313
312
  for (let j = 0, bLen = bookings.length; j < bLen; j++) {
314
313
  const booking = bookings[j];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.146",
4
+ "version": "2.2.148",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",