@pisell/pisellos 2.2.313 → 2.2.315

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 (215) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +3 -1
  3. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
  4. package/dist/model/strategy/adapter/itemRule/adapter.js +74 -7
  5. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
  6. package/dist/model/strategy/adapter/itemRule/evaluator.js +13 -0
  7. package/dist/model/strategy/adapter/itemRule/type.d.ts +40 -1
  8. package/dist/model/strategy/adapter/itemRule/type.js +10 -0
  9. package/dist/modules/BookingContext/utils/productExtend.d.ts +7 -0
  10. package/dist/modules/BookingContext/utils/productExtend.js +62 -18
  11. package/dist/modules/BookingContext/utils/resources.js +1 -1
  12. package/dist/modules/BusinessAvailability/index.d.ts +30 -0
  13. package/dist/modules/BusinessAvailability/index.js +204 -0
  14. package/dist/modules/Cart/index.js +4 -3
  15. package/dist/modules/Cart/types.d.ts +2 -0
  16. package/dist/modules/Cart/utils/cartProduct.d.ts +3 -1
  17. package/dist/modules/Cart/utils/cartProduct.js +59 -32
  18. package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
  19. package/dist/modules/FulfillmentTiming/index.js +407 -0
  20. package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
  21. package/dist/modules/FulfillmentTiming/types.js +1 -0
  22. package/dist/modules/OpenData/types.d.ts +14 -0
  23. package/dist/modules/Order/index.d.ts +14 -2
  24. package/dist/modules/Order/index.js +856 -486
  25. package/dist/modules/Order/localEftposState.d.ts +13 -0
  26. package/dist/modules/Order/localEftposState.js +39 -0
  27. package/dist/modules/Order/pickupTiming.d.ts +46 -0
  28. package/dist/modules/Order/pickupTiming.js +53 -0
  29. package/dist/modules/Order/types.d.ts +30 -2
  30. package/dist/modules/Order/utils.js +25 -7
  31. package/dist/modules/Payment/index.js +9 -10
  32. package/dist/modules/Product/types.d.ts +11 -0
  33. package/dist/modules/ProductList/index.js +1 -1
  34. package/dist/modules/ResourcePlanner/planner.d.ts +2 -0
  35. package/dist/modules/ResourcePlanner/planner.js +332 -23
  36. package/dist/modules/ResourcePlanner/types.d.ts +29 -0
  37. package/dist/modules/Schedule/index.d.ts +8 -0
  38. package/dist/modules/Schedule/index.js +141 -39
  39. package/dist/modules/index.d.ts +1 -0
  40. package/dist/modules/index.js +1 -0
  41. package/dist/plugins/request.d.ts +7 -0
  42. package/dist/server/index.d.ts +1 -0
  43. package/dist/server/index.js +1536 -1309
  44. package/dist/server/modules/form/index.d.ts +19 -0
  45. package/dist/server/modules/form/index.js +205 -0
  46. package/dist/server/modules/form/types.d.ts +13 -0
  47. package/dist/server/modules/form/types.js +3 -0
  48. package/dist/server/modules/index.d.ts +3 -0
  49. package/dist/server/modules/index.js +4 -0
  50. package/dist/server/modules/order/index.d.ts +15 -0
  51. package/dist/server/modules/order/index.js +920 -688
  52. package/dist/server/modules/order/types.d.ts +1 -0
  53. package/dist/server/test.json +1 -1
  54. package/dist/server/utils/small-ticket.d.ts +1 -85
  55. package/dist/server/utils/small-ticket.js +2 -2542
  56. package/dist/shared/payment/loadPaymentMethods.d.ts +9 -0
  57. package/dist/shared/payment/loadPaymentMethods.js +66 -0
  58. package/dist/shared/receipt/customerInvoiceLanguages.d.ts +8 -0
  59. package/dist/shared/receipt/customerInvoiceLanguages.js +60 -0
  60. package/dist/shared/receipt/loadCustomerInvoiceLayout.d.ts +27 -0
  61. package/dist/shared/receipt/loadCustomerInvoiceLayout.js +184 -0
  62. package/dist/shared/receipt/small-ticket.d.ts +96 -0
  63. package/dist/shared/receipt/small-ticket.js +2751 -0
  64. package/dist/shared/receipt/templateVisibility.d.ts +23 -0
  65. package/dist/shared/receipt/templateVisibility.js +64 -0
  66. package/dist/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
  67. package/dist/shared/sales/loadSalesOrderSnapshot.js +21 -0
  68. package/dist/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
  69. package/dist/solution/BaseSales/fulfillmentItemRules.js +750 -0
  70. package/dist/solution/BaseSales/index.d.ts +39 -16
  71. package/dist/solution/BaseSales/index.js +1754 -1154
  72. package/dist/solution/BaseSales/pickupTiming.d.ts +47 -0
  73. package/dist/solution/BaseSales/pickupTiming.js +616 -0
  74. package/dist/solution/BaseSales/types.d.ts +11 -0
  75. package/dist/solution/BaseSales/utils/parseSalesResponse.js +3 -0
  76. package/dist/solution/BookingByStep/index.d.ts +4 -2
  77. package/dist/solution/BookingByStep/index.js +8 -3
  78. package/dist/solution/BookingTicket/index.d.ts +8 -2
  79. package/dist/solution/BookingTicket/index.js +513 -436
  80. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -1
  81. package/dist/solution/BookingTicket/utils/addProductDecision.js +1 -1
  82. package/dist/solution/BookingTicket/utils/cartView.js +3 -1
  83. package/dist/solution/OrderInvoicePreview/index.d.ts +66 -0
  84. package/dist/solution/OrderInvoicePreview/index.js +340 -0
  85. package/dist/solution/RegisterAndLogin/config.js +54 -11
  86. package/dist/solution/RegisterAndLogin/index.d.ts +2 -0
  87. package/dist/solution/RegisterAndLogin/index.js +1 -1
  88. package/dist/solution/RegisterAndLogin/utils.d.ts +12 -4
  89. package/dist/solution/RegisterAndLogin/utils.js +36 -16
  90. package/dist/solution/Sales/index.js +1 -1
  91. package/dist/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
  92. package/dist/solution/UnifiedBookingSales/businessAvailability.js +292 -0
  93. package/dist/solution/UnifiedBookingSales/index.d.ts +36 -4
  94. package/dist/solution/UnifiedBookingSales/index.js +1714 -905
  95. package/dist/solution/UnifiedBookingSales/types.d.ts +16 -2
  96. package/dist/solution/VenueBooking/index.d.ts +15 -2
  97. package/dist/solution/VenueBooking/index.js +1062 -785
  98. package/dist/solution/VenueBooking/types.d.ts +2 -1
  99. package/dist/solution/VenueBooking/types.js +1 -0
  100. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  101. package/dist/solution/VenueBooking/utils/dateSummary.js +7 -4
  102. package/dist/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
  103. package/dist/solution/VenueBooking/utils/smartPricing.js +273 -0
  104. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
  105. package/dist/solution/VenueBooking/utils/timeSlot.js +6 -3
  106. package/dist/solution/index.d.ts +1 -0
  107. package/dist/solution/index.js +2 -1
  108. package/lib/index.d.ts +2 -0
  109. package/lib/index.js +21 -1
  110. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
  111. package/lib/model/strategy/adapter/itemRule/adapter.js +54 -4
  112. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
  113. package/lib/model/strategy/adapter/itemRule/evaluator.js +9 -0
  114. package/lib/model/strategy/adapter/itemRule/type.d.ts +40 -1
  115. package/lib/model/strategy/adapter/itemRule/type.js +10 -0
  116. package/lib/modules/BookingContext/utils/productExtend.d.ts +7 -0
  117. package/lib/modules/BookingContext/utils/productExtend.js +45 -2
  118. package/lib/modules/BookingContext/utils/resources.js +1 -1
  119. package/lib/modules/BusinessAvailability/index.d.ts +30 -0
  120. package/lib/modules/BusinessAvailability/index.js +146 -0
  121. package/lib/modules/Cart/index.js +4 -2
  122. package/lib/modules/Cart/types.d.ts +2 -0
  123. package/lib/modules/Cart/utils/cartProduct.d.ts +3 -1
  124. package/lib/modules/Cart/utils/cartProduct.js +39 -20
  125. package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
  126. package/lib/modules/FulfillmentTiming/index.js +359 -0
  127. package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
  128. package/lib/modules/FulfillmentTiming/types.js +5 -0
  129. package/lib/modules/OpenData/types.d.ts +14 -0
  130. package/lib/modules/Order/index.d.ts +14 -2
  131. package/lib/modules/Order/index.js +240 -38
  132. package/lib/modules/Order/localEftposState.d.ts +13 -0
  133. package/lib/modules/Order/localEftposState.js +44 -0
  134. package/lib/modules/Order/pickupTiming.d.ts +46 -0
  135. package/lib/modules/Order/pickupTiming.js +61 -0
  136. package/lib/modules/Order/types.d.ts +30 -2
  137. package/lib/modules/Order/utils.js +21 -5
  138. package/lib/modules/Payment/index.js +3 -4
  139. package/lib/modules/Product/types.d.ts +11 -0
  140. package/lib/modules/ProductList/index.js +1 -1
  141. package/lib/modules/ResourcePlanner/planner.d.ts +2 -0
  142. package/lib/modules/ResourcePlanner/planner.js +252 -8
  143. package/lib/modules/ResourcePlanner/types.d.ts +29 -0
  144. package/lib/modules/Schedule/index.d.ts +8 -0
  145. package/lib/modules/Schedule/index.js +68 -12
  146. package/lib/modules/index.d.ts +1 -0
  147. package/lib/modules/index.js +11 -0
  148. package/lib/plugins/request.d.ts +7 -0
  149. package/lib/server/index.d.ts +1 -0
  150. package/lib/server/index.js +158 -37
  151. package/lib/server/modules/form/index.d.ts +19 -0
  152. package/lib/server/modules/form/index.js +73 -0
  153. package/lib/server/modules/form/types.d.ts +13 -0
  154. package/lib/server/modules/form/types.js +9 -0
  155. package/lib/server/modules/index.d.ts +3 -0
  156. package/lib/server/modules/index.js +15 -1
  157. package/lib/server/modules/order/index.d.ts +15 -0
  158. package/lib/server/modules/order/index.js +114 -3
  159. package/lib/server/modules/order/types.d.ts +1 -0
  160. package/lib/server/test.json +1 -1
  161. package/lib/server/utils/small-ticket.d.ts +1 -85
  162. package/lib/server/utils/small-ticket.js +9 -2305
  163. package/lib/shared/payment/loadPaymentMethods.d.ts +9 -0
  164. package/lib/shared/payment/loadPaymentMethods.js +40 -0
  165. package/lib/shared/receipt/customerInvoiceLanguages.d.ts +8 -0
  166. package/lib/shared/receipt/customerInvoiceLanguages.js +58 -0
  167. package/lib/shared/receipt/loadCustomerInvoiceLayout.d.ts +27 -0
  168. package/lib/shared/receipt/loadCustomerInvoiceLayout.js +124 -0
  169. package/lib/shared/receipt/small-ticket.d.ts +96 -0
  170. package/lib/shared/receipt/small-ticket.js +2546 -0
  171. package/lib/shared/receipt/templateVisibility.d.ts +23 -0
  172. package/lib/shared/receipt/templateVisibility.js +63 -0
  173. package/lib/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
  174. package/lib/shared/sales/loadSalesOrderSnapshot.js +22 -0
  175. package/lib/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
  176. package/lib/solution/BaseSales/fulfillmentItemRules.js +259 -0
  177. package/lib/solution/BaseSales/index.d.ts +39 -16
  178. package/lib/solution/BaseSales/index.js +333 -31
  179. package/lib/solution/BaseSales/pickupTiming.d.ts +47 -0
  180. package/lib/solution/BaseSales/pickupTiming.js +290 -0
  181. package/lib/solution/BaseSales/types.d.ts +11 -0
  182. package/lib/solution/BaseSales/utils/parseSalesResponse.js +3 -0
  183. package/lib/solution/BookingByStep/index.d.ts +4 -2
  184. package/lib/solution/BookingByStep/index.js +7 -3
  185. package/lib/solution/BookingTicket/index.d.ts +8 -2
  186. package/lib/solution/BookingTicket/index.js +65 -6
  187. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -1
  188. package/lib/solution/BookingTicket/utils/addProductDecision.js +1 -1
  189. package/lib/solution/BookingTicket/utils/cartView.js +3 -1
  190. package/lib/solution/OrderInvoicePreview/index.d.ts +66 -0
  191. package/lib/solution/OrderInvoicePreview/index.js +246 -0
  192. package/lib/solution/RegisterAndLogin/config.js +57 -11
  193. package/lib/solution/RegisterAndLogin/index.d.ts +2 -0
  194. package/lib/solution/RegisterAndLogin/index.js +9 -1
  195. package/lib/solution/RegisterAndLogin/utils.d.ts +12 -4
  196. package/lib/solution/RegisterAndLogin/utils.js +24 -17
  197. package/lib/solution/Sales/index.js +1 -1
  198. package/lib/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
  199. package/lib/solution/UnifiedBookingSales/businessAvailability.js +138 -0
  200. package/lib/solution/UnifiedBookingSales/index.d.ts +36 -4
  201. package/lib/solution/UnifiedBookingSales/index.js +561 -74
  202. package/lib/solution/UnifiedBookingSales/types.d.ts +16 -2
  203. package/lib/solution/VenueBooking/index.d.ts +15 -2
  204. package/lib/solution/VenueBooking/index.js +243 -96
  205. package/lib/solution/VenueBooking/types.d.ts +2 -1
  206. package/lib/solution/VenueBooking/types.js +1 -0
  207. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  208. package/lib/solution/VenueBooking/utils/dateSummary.js +7 -4
  209. package/lib/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
  210. package/lib/solution/VenueBooking/utils/smartPricing.js +224 -0
  211. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
  212. package/lib/solution/VenueBooking/utils/timeSlot.js +5 -2
  213. package/lib/solution/index.d.ts +1 -0
  214. package/lib/solution/index.js +11 -0
  215. package/package.json +1 -1
@@ -10,6 +10,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
10
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
14
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
13
15
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
16
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
17
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -45,49 +47,52 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
45
47
  _defineProperty(_assertThisInitialized(_this), "openCache", false);
46
48
  _defineProperty(_assertThisInitialized(_this), "fatherModule", void 0);
47
49
  _defineProperty(_assertThisInitialized(_this), "hasLoadedScheduleList", false);
50
+ _defineProperty(_assertThisInitialized(_this), "scheduleListPromise", null);
51
+ _defineProperty(_assertThisInitialized(_this), "scheduleListRequestVersion", 0);
52
+ _defineProperty(_assertThisInitialized(_this), "scheduleCatalogScope", '');
53
+ _defineProperty(_assertThisInitialized(_this), "otherParams", {});
48
54
  return _this;
49
55
  }
50
56
  _createClass(ScheduleModule, [{
51
57
  key: "initialize",
52
58
  value: function () {
53
59
  var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
54
- var _options$otherParams, _options$otherParams2;
60
+ var _options$initialState;
61
+ var initialScheduleList, hasInitialScheduleList;
55
62
  return _regeneratorRuntime().wrap(function _callee$(_context) {
56
63
  while (1) switch (_context.prev = _context.next) {
57
64
  case 0:
65
+ // The store proxies initialState, so capture its input before resets write through it.
66
+ initialScheduleList = (_options$initialState = options.initialState) === null || _options$initialState === void 0 ? void 0 : _options$initialState.scheduleList;
67
+ hasInitialScheduleList = Array.isArray(initialScheduleList);
68
+ this.resetScheduleCatalog();
58
69
  this.core = core;
59
70
 
60
71
  // 获取依赖的插件
61
72
  this.request = core.getPlugin('request');
62
73
  if (this.request) {
63
- _context.next = 4;
74
+ _context.next = 7;
64
75
  break;
65
76
  }
66
77
  throw new Error('ScheduleModule 需要 request 插件支持');
67
- case 4:
78
+ case 7:
68
79
  // if (options?.initialState) {
69
80
  // this.state = { ...this.state, ...options.initialState }
70
81
  // }
71
82
  this.store = options === null || options === void 0 ? void 0 : options.store;
83
+ this.updateOtherParams(options.otherParams || {});
72
84
  if (options.initialState) {
73
- this.store.scheduleList = options.initialState.scheduleList;
85
+ this.store.scheduleList = hasInitialScheduleList ? initialScheduleList : [];
74
86
  this.syncScheduleMap();
75
87
  this.store.availabilityDateList = options.initialState.availabilityDateList;
76
- this.hasLoadedScheduleList = Array.isArray(options.initialState.scheduleList);
88
+ this.hasLoadedScheduleList = hasInitialScheduleList;
77
89
  } else {
78
90
  this.store.scheduleList = [];
79
91
  this.store.map = new Map();
80
92
  this.store.availabilityDateList = [];
81
93
  this.hasLoadedScheduleList = false;
82
94
  }
83
- if ((_options$otherParams = options.otherParams) !== null && _options$otherParams !== void 0 && _options$otherParams.cacheId) {
84
- this.openCache = options.otherParams.openCache;
85
- this.cacheId = options.otherParams.cacheId;
86
- }
87
- if ((_options$otherParams2 = options.otherParams) !== null && _options$otherParams2 !== void 0 && _options$otherParams2.fatherModule) {
88
- this.fatherModule = options.otherParams.fatherModule;
89
- }
90
- case 8:
95
+ case 10:
91
96
  case "end":
92
97
  return _context.stop();
93
98
  }
@@ -109,9 +114,41 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
109
114
  value: function updateOtherParams(params) {
110
115
  var _otherParams$openCach;
111
116
  var otherParams = params || {};
117
+ this.otherParams = _objectSpread({}, otherParams);
112
118
  this.openCache = (_otherParams$openCach = otherParams.openCache) !== null && _otherParams$openCach !== void 0 ? _otherParams$openCach : false;
113
119
  this.cacheId = otherParams.cacheId;
114
120
  this.fatherModule = otherParams.fatherModule;
121
+ this.syncScheduleCatalogScope();
122
+ }
123
+ }, {
124
+ key: "syncScheduleCatalogScope",
125
+ value: function syncScheduleCatalogScope() {
126
+ var _this$core, _params$businessCode;
127
+ var context = (_this$core = this.core) === null || _this$core === void 0 ? void 0 : _this$core.context;
128
+ var shopId = typeof (context === null || context === void 0 ? void 0 : context.getData) === 'function' ? context.getData('shop_id') : context === null || context === void 0 ? void 0 : context.shop_id;
129
+ var params = this.otherParams;
130
+ var scope = JSON.stringify([this.cacheId, this.fatherModule, (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : params.business_code, params.channel, params.platform, params.businessTimezone, shopId].map(function (value) {
131
+ return String(value !== null && value !== void 0 ? value : '').trim();
132
+ }));
133
+ if (scope !== this.scheduleCatalogScope) {
134
+ this.resetScheduleCatalog();
135
+ this.scheduleCatalogScope = scope;
136
+ }
137
+ }
138
+ }, {
139
+ key: "resetScheduleCatalog",
140
+ value: function resetScheduleCatalog() {
141
+ this.scheduleListRequestVersion += 1;
142
+ this.scheduleListPromise = null;
143
+ this.hasLoadedScheduleList = false;
144
+ this.store.scheduleList = [];
145
+ this.store.map = new Map();
146
+ }
147
+ }, {
148
+ key: "destroy",
149
+ value: function destroy() {
150
+ this.resetScheduleCatalog();
151
+ _get(_getPrototypeOf(ScheduleModule.prototype), "destroy", this).call(this);
115
152
  }
116
153
 
117
154
  /**
@@ -123,37 +160,99 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
123
160
  key: "loadAllSchedule",
124
161
  value: (function () {
125
162
  var _loadAllSchedule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
126
- var _options$useCache, _scheduleList$data;
163
+ var _options$useCache;
127
164
  var options,
128
- scheduleList,
165
+ useCache,
166
+ requestVersion,
167
+ promise,
129
168
  _args2 = arguments;
130
169
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
131
170
  while (1) switch (_context2.prev = _context2.next) {
132
171
  case 0:
133
172
  options = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
134
- _context2.next = 3;
135
- return this.request.get("/schedule", {
136
- num: 999
137
- }, {
138
- useCache: (_options$useCache = options.useCache) !== null && _options$useCache !== void 0 ? _options$useCache : true
139
- });
140
- case 3:
141
- scheduleList = _context2.sent;
142
- this.setScheduleList(((_scheduleList$data = scheduleList.data) === null || _scheduleList$data === void 0 ? void 0 : _scheduleList$data.list) || []);
143
- case 5:
173
+ this.syncScheduleCatalogScope();
174
+ useCache = (_options$useCache = options.useCache) !== null && _options$useCache !== void 0 ? _options$useCache : true;
175
+ if (!useCache) {
176
+ _context2.next = 8;
177
+ break;
178
+ }
179
+ if (!this.scheduleListPromise) {
180
+ _context2.next = 6;
181
+ break;
182
+ }
183
+ return _context2.abrupt("return", this.scheduleListPromise);
184
+ case 6:
185
+ if (!this.hasLoadedScheduleList) {
186
+ _context2.next = 8;
187
+ break;
188
+ }
189
+ return _context2.abrupt("return");
190
+ case 8:
191
+ requestVersion = ++this.scheduleListRequestVersion;
192
+ promise = this.loadScheduleCatalog(useCache, requestVersion);
193
+ this.scheduleListPromise = promise;
194
+ _context2.prev = 11;
195
+ _context2.next = 14;
196
+ return promise;
197
+ case 14:
198
+ _context2.prev = 14;
199
+ if (this.scheduleListPromise === promise) {
200
+ this.scheduleListPromise = null;
201
+ }
202
+ return _context2.finish(14);
203
+ case 17:
144
204
  case "end":
145
205
  return _context2.stop();
146
206
  }
147
- }, _callee2, this);
207
+ }, _callee2, this, [[11,, 14, 17]]);
148
208
  }));
149
209
  function loadAllSchedule() {
150
210
  return _loadAllSchedule.apply(this, arguments);
151
211
  }
152
212
  return loadAllSchedule;
153
213
  }())
214
+ }, {
215
+ key: "loadScheduleCatalog",
216
+ value: function () {
217
+ var _loadScheduleCatalog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(useCache, requestVersion) {
218
+ var response, _response$data;
219
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
220
+ while (1) switch (_context3.prev = _context3.next) {
221
+ case 0:
222
+ _context3.next = 2;
223
+ return this.request.get("/schedule", {
224
+ num: 999
225
+ }, {
226
+ useCache: useCache
227
+ });
228
+ case 2:
229
+ response = _context3.sent;
230
+ if (!(response.code !== undefined && Number(response.code) !== 200 || response.status === false || typeof response.status === 'number' && response.status >= 400 || response.success === false)) {
231
+ _context3.next = 5;
232
+ break;
233
+ }
234
+ throw new Error(response.message || 'Schedule catalog request failed');
235
+ case 5:
236
+ this.syncScheduleCatalogScope();
237
+ // A refresh or a different runtime may have superseded this request.
238
+ if (requestVersion === this.scheduleListRequestVersion) {
239
+ this.setScheduleList(((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.list) || []);
240
+ }
241
+ case 7:
242
+ case "end":
243
+ return _context3.stop();
244
+ }
245
+ }, _callee3, this);
246
+ }));
247
+ function loadScheduleCatalog(_x3, _x4) {
248
+ return _loadScheduleCatalog.apply(this, arguments);
249
+ }
250
+ return loadScheduleCatalog;
251
+ }()
154
252
  }, {
155
253
  key: "setScheduleList",
156
254
  value: function setScheduleList(list) {
255
+ this.syncScheduleCatalogScope();
157
256
  this.store.scheduleList = list;
158
257
  this.syncScheduleMap();
159
258
  this.hasLoadedScheduleList = true;
@@ -168,20 +267,22 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
168
267
  }, {
169
268
  key: "getScheduleList",
170
269
  value: function getScheduleList() {
270
+ this.syncScheduleCatalogScope();
171
271
  return this.store.scheduleList || [];
172
272
  }
173
273
  }, {
174
274
  key: "isScheduleListLoaded",
175
275
  value: function isScheduleListLoaded() {
276
+ this.syncScheduleCatalogScope();
176
277
  return this.hasLoadedScheduleList;
177
278
  }
178
279
  }, {
179
280
  key: "loadScheduleAvailableDate",
180
281
  value: function () {
181
- var _loadScheduleAvailableDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
282
+ var _loadScheduleAvailableDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref) {
182
283
  var startDate, endDate, custom_page_id, channel, dates, res, responseData, dateList, otherProductIds;
183
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
184
- while (1) switch (_context3.prev = _context3.next) {
284
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
285
+ while (1) switch (_context4.prev = _context4.next) {
185
286
  case 0:
186
287
  startDate = _ref.startDate, endDate = _ref.endDate, custom_page_id = _ref.custom_page_id, channel = _ref.channel;
187
288
  // 前端传递的 startDate,可能是今天之前的,如果 startDate 小于今天,需要把 startDate 置为今天
@@ -193,12 +294,12 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
193
294
  dates = disableAllDates(dates);
194
295
  // 如果 endDate 在今天之前,则不用查接口,直接返回 dates
195
296
  if (!dayjs(endDate).isBefore(dayjs(), 'day')) {
196
- _context3.next = 6;
297
+ _context4.next = 6;
197
298
  break;
198
299
  }
199
- return _context3.abrupt("return", dates);
300
+ return _context4.abrupt("return", dates);
200
301
  case 6:
201
- _context3.next = 8;
302
+ _context4.next = 8;
202
303
  return this.request.get("/schedule/product/availability/v2", {
203
304
  start_date: startDate,
204
305
  end_date: endDate,
@@ -206,7 +307,7 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
206
307
  channel: channel
207
308
  });
208
309
  case 8:
209
- res = _context3.sent;
310
+ res = _context4.sent;
210
311
  responseData = res.data || {};
211
312
  dateList = Array.isArray(responseData.date_list) ? responseData.date_list : [];
212
313
  otherProductIds = Array.isArray(responseData.other_product_ids) ? responseData.other_product_ids : [];
@@ -214,10 +315,10 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
214
315
  this.setOtherProductsIds(otherProductIds);
215
316
  // 如果没有schedule或者结束日期在今天之前,则所有日期均不可用
216
317
  if (!(!dateList.length && !otherProductIds.length || dayjs(endDate).isBefore(dayjs(), 'day'))) {
217
- _context3.next = 16;
318
+ _context4.next = 16;
218
319
  break;
219
320
  }
220
- return _context3.abrupt("return", dates);
321
+ return _context4.abrupt("return", dates);
221
322
  case 16:
222
323
  if (otherProductIds.length) {
223
324
  // 如果后端有返回 other_product_ids ,意味着有 duration 商品,则今天以及今天以后的日期均可用
@@ -235,14 +336,14 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
235
336
  });
236
337
  }
237
338
  dates = disableDatesBeforeOneDay(dates);
238
- return _context3.abrupt("return", dates);
339
+ return _context4.abrupt("return", dates);
239
340
  case 19:
240
341
  case "end":
241
- return _context3.stop();
342
+ return _context4.stop();
242
343
  }
243
- }, _callee3, this);
344
+ }, _callee4, this);
244
345
  }));
245
- function loadScheduleAvailableDate(_x3) {
346
+ function loadScheduleAvailableDate(_x5) {
246
347
  return _loadScheduleAvailableDate.apply(this, arguments);
247
348
  }
248
349
  return loadScheduleAvailableDate;
@@ -252,6 +353,7 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
252
353
  value: function getScheduleListByIds(ids) {
253
354
  var _this2 = this,
254
355
  _this$store$scheduleL;
356
+ this.syncScheduleCatalogScope();
255
357
  var idSet = new Set(ids.map(function (id) {
256
358
  return String(id);
257
359
  }));
@@ -17,6 +17,7 @@ export * from './Schedule';
17
17
  export * from './Quotation';
18
18
  export * from './ScanOrderLogger';
19
19
  export * from './OpenData';
20
+ export * from './FulfillmentTiming';
20
21
  export * from './BookingContext';
21
22
  export * from './Holder';
22
23
  export * from './ResourcePlanner';
@@ -17,6 +17,7 @@ export * from "./Schedule";
17
17
  export * from "./Quotation";
18
18
  export * from "./ScanOrderLogger";
19
19
  export * from "./OpenData";
20
+ export * from "./FulfillmentTiming";
20
21
  export * from "./BookingContext";
21
22
  export * from "./Holder";
22
23
  export * from "./ResourcePlanner";
@@ -56,6 +56,13 @@ export interface CacheProps {
56
56
  * 请求配置
57
57
  */
58
58
  export interface RequestOptions {
59
+ /** Customer-only, credential-free GET /open/document/{id} on picoding. */
60
+ publicInvoiceDocument?: boolean;
61
+ /** Route through the host's configured picoding environment. */
62
+ pisell2?: boolean;
63
+ /** Let the caller handle read-only preview failures without host navigation/toasts. */
64
+ manualErrorHandling?: boolean;
65
+ skipErrorHandler?: boolean;
59
66
  url?: string;
60
67
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
61
68
  headers?: Record<string, string>;
@@ -499,6 +499,7 @@ declare class Server {
499
499
  private buildLocalPaymentSurchargeUpdate;
500
500
  private handleGetLocalPayment;
501
501
  private handleUpdateLocalPayment;
502
+ private handleFinalizeLocalEftposPayment;
502
503
  private runLocalPaymentUpdateInQueue;
503
504
  private processLocalPaymentUpdate;
504
505
  private processSuccessfulLocalPayment;