@pisell/pisellos 2.3.208 → 2.3.209
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.
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/solution/BaseSales/index.d.ts +0 -2
- package/dist/solution/BaseSales/index.js +37 -65
- package/dist/solution/BaseSales/types.d.ts +0 -2
- package/dist/solution/BookingTicket/index.d.ts +0 -7
- package/dist/solution/BookingTicket/index.js +323 -448
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/solution/BaseSales/index.d.ts +0 -2
- package/lib/solution/BaseSales/index.js +6 -27
- package/lib/solution/BaseSales/types.d.ts +0 -2
- package/lib/solution/BookingTicket/index.d.ts +0 -7
- package/lib/solution/BookingTicket/index.js +4 -50
- package/package.json +1 -1
|
@@ -187,9 +187,6 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
187
187
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshCustomerId", null);
|
|
188
188
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshTarget", null);
|
|
189
189
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerPromotionRefreshInFlight", null);
|
|
190
|
-
// Retain the settled result too: a failed refresh must remain observable by checkout callers.
|
|
191
|
-
_defineProperty(_assertThisInitialized(_this), "orderCustomerRefreshTask", Promise.resolve());
|
|
192
|
-
_defineProperty(_assertThisInitialized(_this), "orderCustomerRefreshRevision", 0);
|
|
193
190
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerContactRequest", null);
|
|
194
191
|
_defineProperty(_assertThisInitialized(_this), "customerResolveRequests", new Map());
|
|
195
192
|
_defineProperty(_assertThisInitialized(_this), "loadOpenDataInFlight", null);
|
|
@@ -1856,16 +1853,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1856
1853
|
}
|
|
1857
1854
|
return;
|
|
1858
1855
|
}
|
|
1859
|
-
var enableMemberCartConsistency = this.isMemberCartConsistencyEnabled();
|
|
1860
1856
|
var next = this.buildOrderCustomerPayload();
|
|
1861
1857
|
this.core.effects.emit("".concat(this.name, ":onOrderCustomerChange"), next && options !== null && options !== void 0 && options.source ? _objectSpread(_objectSpread({}, next), {}, {
|
|
1862
1858
|
source: options.source
|
|
1863
1859
|
}) : next);
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
return;
|
|
1867
|
-
}
|
|
1868
|
-
void this.refreshDiscountConfigAfterOrderCustomerChange(patch.customer_id);
|
|
1860
|
+
this.refreshDiscountConfigAfterOrderCustomerChange(patch.customer_id);
|
|
1861
|
+
// 客户切换可能改变可用促销/赠品;触发一次重算(recursion-safe)。
|
|
1869
1862
|
var promotionRefreshTask = this.store.order.applyPromotion().then(function () {
|
|
1870
1863
|
return undefined;
|
|
1871
1864
|
});
|
|
@@ -1879,85 +1872,6 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1879
1872
|
_this3.orderCustomerPromotionRefreshInFlight = null;
|
|
1880
1873
|
});
|
|
1881
1874
|
}
|
|
1882
|
-
|
|
1883
|
-
/** Shared by customer changes and an explicit retry; keep the selected customer/cart intact. */
|
|
1884
|
-
}, {
|
|
1885
|
-
key: "refreshMemberCartContext",
|
|
1886
|
-
value: function refreshMemberCartContext(customerId) {
|
|
1887
|
-
var _this4 = this;
|
|
1888
|
-
var revision = ++this.orderCustomerRefreshRevision;
|
|
1889
|
-
var orderKey = this.getCustomerContactOrderKey();
|
|
1890
|
-
var isCurrent = function isCurrent() {
|
|
1891
|
-
var _this4$store$order$ge;
|
|
1892
|
-
return revision === _this4.orderCustomerRefreshRevision && _this4.getCustomerContactOrderKey() === orderKey && Number(((_this4$store$order$ge = _this4.store.order.getOrderCustomer()) === null || _this4$store$order$ge === void 0 ? void 0 : _this4$store$order$ge.customer_id) || 0) === Number(customerId || 0);
|
|
1893
|
-
};
|
|
1894
|
-
var task = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
1895
|
-
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
1896
|
-
while (1) switch (_context26.prev = _context26.next) {
|
|
1897
|
-
case 0:
|
|
1898
|
-
if (!customerId) {
|
|
1899
|
-
_context26.next = 5;
|
|
1900
|
-
break;
|
|
1901
|
-
}
|
|
1902
|
-
_context26.next = 3;
|
|
1903
|
-
return _this4.refreshDiscountConfigAfterOrderCustomerChange(customerId);
|
|
1904
|
-
case 3:
|
|
1905
|
-
_context26.next = 7;
|
|
1906
|
-
break;
|
|
1907
|
-
case 5:
|
|
1908
|
-
_context26.next = 7;
|
|
1909
|
-
return _this4.loadDiscountConfig({
|
|
1910
|
-
force: true
|
|
1911
|
-
});
|
|
1912
|
-
case 7:
|
|
1913
|
-
if (!isCurrent()) {
|
|
1914
|
-
_context26.next = 10;
|
|
1915
|
-
break;
|
|
1916
|
-
}
|
|
1917
|
-
_context26.next = 10;
|
|
1918
|
-
return _this4.store.order.applyPromotion();
|
|
1919
|
-
case 10:
|
|
1920
|
-
case "end":
|
|
1921
|
-
return _context26.stop();
|
|
1922
|
-
}
|
|
1923
|
-
}, _callee26);
|
|
1924
|
-
}))();
|
|
1925
|
-
this.orderCustomerRefreshTask = task;
|
|
1926
|
-
this.orderCustomerPromotionRefreshInFlight = task;
|
|
1927
|
-
void task.catch(function (error) {
|
|
1928
|
-
if (isCurrent()) console.error('[BookingTicket] Member cart refresh failed', error);
|
|
1929
|
-
}).finally(function () {
|
|
1930
|
-
if (_this4.orderCustomerPromotionRefreshInFlight === task) _this4.orderCustomerPromotionRefreshInFlight = null;
|
|
1931
|
-
});
|
|
1932
|
-
}
|
|
1933
|
-
}, {
|
|
1934
|
-
key: "retryOrderCustomerRefresh",
|
|
1935
|
-
value: function () {
|
|
1936
|
-
var _retryOrderCustomerRefresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
|
|
1937
|
-
var _this$store$order$get4, _this$store$order$get5;
|
|
1938
|
-
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
1939
|
-
while (1) switch (_context27.prev = _context27.next) {
|
|
1940
|
-
case 0:
|
|
1941
|
-
if (this.isMemberCartConsistencyEnabled()) {
|
|
1942
|
-
_context27.next = 2;
|
|
1943
|
-
break;
|
|
1944
|
-
}
|
|
1945
|
-
return _context27.abrupt("return");
|
|
1946
|
-
case 2:
|
|
1947
|
-
this.refreshMemberCartContext((_this$store$order$get4 = (_this$store$order$get5 = this.store.order.getOrderCustomer()) === null || _this$store$order$get5 === void 0 ? void 0 : _this$store$order$get5.customer_id) !== null && _this$store$order$get4 !== void 0 ? _this$store$order$get4 : null);
|
|
1948
|
-
_context27.next = 5;
|
|
1949
|
-
return this.waitForOrderCustomerRefresh();
|
|
1950
|
-
case 5:
|
|
1951
|
-
case "end":
|
|
1952
|
-
return _context27.stop();
|
|
1953
|
-
}
|
|
1954
|
-
}, _callee27, this);
|
|
1955
|
-
}));
|
|
1956
|
-
function retryOrderCustomerRefresh() {
|
|
1957
|
-
return _retryOrderCustomerRefresh.apply(this, arguments);
|
|
1958
|
-
}
|
|
1959
|
-
return retryOrderCustomerRefresh;
|
|
1960
|
-
}()
|
|
1961
1875
|
}, {
|
|
1962
1876
|
key: "resetOrderCustomerContactInfo",
|
|
1963
1877
|
value: function resetOrderCustomerContactInfo() {
|
|
@@ -1994,25 +1908,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1994
1908
|
}, {
|
|
1995
1909
|
key: "replaceTempOrder",
|
|
1996
1910
|
value: function () {
|
|
1997
|
-
var _replaceTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1911
|
+
var _replaceTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
1998
1912
|
var _get2;
|
|
1999
1913
|
var _len2,
|
|
2000
1914
|
args,
|
|
2001
1915
|
_key2,
|
|
2002
|
-
|
|
2003
|
-
return _regeneratorRuntime().wrap(function
|
|
2004
|
-
while (1) switch (
|
|
1916
|
+
_args26 = arguments;
|
|
1917
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
1918
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2005
1919
|
case 0:
|
|
2006
1920
|
this.orderCustomerContactRequest = null;
|
|
2007
|
-
for (_len2 =
|
|
2008
|
-
args[_key2] =
|
|
1921
|
+
for (_len2 = _args26.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1922
|
+
args[_key2] = _args26[_key2];
|
|
2009
1923
|
}
|
|
2010
|
-
return
|
|
1924
|
+
return _context26.abrupt("return", (_get2 = _get(_getPrototypeOf(BookingTicketImpl.prototype), "replaceTempOrder", this)).call.apply(_get2, [this].concat(args)));
|
|
2011
1925
|
case 3:
|
|
2012
1926
|
case "end":
|
|
2013
|
-
return
|
|
1927
|
+
return _context26.stop();
|
|
2014
1928
|
}
|
|
2015
|
-
},
|
|
1929
|
+
}, _callee26, this);
|
|
2016
1930
|
}));
|
|
2017
1931
|
function replaceTempOrder() {
|
|
2018
1932
|
return _replaceTempOrder.apply(this, arguments);
|
|
@@ -2022,21 +1936,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2022
1936
|
}, {
|
|
2023
1937
|
key: "applyDefaultOrderCustomerContactInfo",
|
|
2024
1938
|
value: function () {
|
|
2025
|
-
var _applyDefaultOrderCustomerContactInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2026
|
-
return _regeneratorRuntime().wrap(function
|
|
2027
|
-
while (1) switch (
|
|
1939
|
+
var _applyDefaultOrderCustomerContactInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(contact) {
|
|
1940
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
1941
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2028
1942
|
case 0:
|
|
2029
1943
|
this.store.order.updateTempOrderContactsInfo(cloneDeep(contact));
|
|
2030
1944
|
// Metadata may finish after promotion/discount refresh; publish the updated cart explicitly.
|
|
2031
|
-
|
|
1945
|
+
_context27.next = 3;
|
|
2032
1946
|
return this.effectsEmit('onTempOrderReplaced', {
|
|
2033
1947
|
tempOrder: this.getTempOrder()
|
|
2034
1948
|
});
|
|
2035
1949
|
case 3:
|
|
2036
1950
|
case "end":
|
|
2037
|
-
return
|
|
1951
|
+
return _context27.stop();
|
|
2038
1952
|
}
|
|
2039
|
-
},
|
|
1953
|
+
}, _callee27, this);
|
|
2040
1954
|
}));
|
|
2041
1955
|
function applyDefaultOrderCustomerContactInfo(_x17) {
|
|
2042
1956
|
return _applyDefaultOrderCustomerContactInfo.apply(this, arguments);
|
|
@@ -2048,7 +1962,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2048
1962
|
value: function prefillOrderCustomerContactInfo(customer, customerChanged) {
|
|
2049
1963
|
var _order$_extend2,
|
|
2050
1964
|
_this$otherParams9,
|
|
2051
|
-
|
|
1965
|
+
_this4 = this;
|
|
2052
1966
|
var order = this.getTempOrder();
|
|
2053
1967
|
var customerId = Number(order === null || order === void 0 ? void 0 : order.customer_id);
|
|
2054
1968
|
if (!order || !Number.isInteger(customerId) || customerId <= 1 || order.contacts_info != null || (_order$_extend2 = order._extend) !== null && _order$_extend2 !== void 0 && _order$_extend2.contactInfoEdited) return;
|
|
@@ -2065,8 +1979,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2065
1979
|
if (customer.contacts_info !== undefined) return;
|
|
2066
1980
|
var userPlatform = isCustomerUserPlatform((_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.platform);
|
|
2067
1981
|
var getAuthenticatedCustomerId = function getAuthenticatedCustomerId() {
|
|
2068
|
-
var
|
|
2069
|
-
return Number((
|
|
1982
|
+
var _this4$core, _this4$core$getPlugin, _this4$core$getPlugin2;
|
|
1983
|
+
return Number((_this4$core = _this4.core) === null || _this4$core === void 0 || (_this4$core$getPlugin = _this4$core.getPlugin) === null || _this4$core$getPlugin === void 0 || (_this4$core$getPlugin = _this4$core$getPlugin.call(_this4$core, 'user')) === null || _this4$core$getPlugin === void 0 || (_this4$core$getPlugin2 = _this4$core$getPlugin.get) === null || _this4$core$getPlugin2 === void 0 || (_this4$core$getPlugin2 = _this4$core$getPlugin2.call(_this4$core$getPlugin)) === null || _this4$core$getPlugin2 === void 0 ? void 0 : _this4$core$getPlugin2.id);
|
|
2070
1984
|
};
|
|
2071
1985
|
if (userPlatform && getAuthenticatedCustomerId() !== customerId) return;
|
|
2072
1986
|
var scope = this.getCustomerContactScope();
|
|
@@ -2081,76 +1995,76 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2081
1995
|
};
|
|
2082
1996
|
this.orderCustomerContactRequest = pending;
|
|
2083
1997
|
var loadContact = /*#__PURE__*/function () {
|
|
2084
|
-
var
|
|
1998
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
|
|
2085
1999
|
var _result4, resolved;
|
|
2086
|
-
return _regeneratorRuntime().wrap(function
|
|
2087
|
-
while (1) switch (
|
|
2000
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2001
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2088
2002
|
case 0:
|
|
2089
2003
|
if (!userPlatform) {
|
|
2090
|
-
|
|
2004
|
+
_context28.next = 7;
|
|
2091
2005
|
break;
|
|
2092
2006
|
}
|
|
2093
|
-
|
|
2094
|
-
return
|
|
2007
|
+
_context28.next = 3;
|
|
2008
|
+
return _this4.request.get('/customer/metadata', {
|
|
2095
2009
|
key: 'contacts_info'
|
|
2096
2010
|
});
|
|
2097
2011
|
case 3:
|
|
2098
|
-
_result4 =
|
|
2012
|
+
_result4 = _context28.sent;
|
|
2099
2013
|
if (!((_result4 === null || _result4 === void 0 ? void 0 : _result4.code) !== 200 || (_result4 === null || _result4 === void 0 ? void 0 : _result4.status) === false)) {
|
|
2100
|
-
|
|
2014
|
+
_context28.next = 6;
|
|
2101
2015
|
break;
|
|
2102
2016
|
}
|
|
2103
2017
|
throw new Error('Customer contact lookup failed');
|
|
2104
2018
|
case 6:
|
|
2105
|
-
return
|
|
2019
|
+
return _context28.abrupt("return", isContactRecord(_result4.data) ? _result4.data : null);
|
|
2106
2020
|
case 7:
|
|
2107
|
-
|
|
2108
|
-
return
|
|
2021
|
+
_context28.next = 9;
|
|
2022
|
+
return _this4.resolveCustomerById(customerId);
|
|
2109
2023
|
case 9:
|
|
2110
|
-
resolved =
|
|
2111
|
-
return
|
|
2024
|
+
resolved = _context28.sent;
|
|
2025
|
+
return _context28.abrupt("return", Number(resolved === null || resolved === void 0 ? void 0 : resolved.id) === customerId ? extractCustomerContactInfo(resolved) : null);
|
|
2112
2026
|
case 11:
|
|
2113
2027
|
case "end":
|
|
2114
|
-
return
|
|
2028
|
+
return _context28.stop();
|
|
2115
2029
|
}
|
|
2116
|
-
},
|
|
2030
|
+
}, _callee28);
|
|
2117
2031
|
}));
|
|
2118
2032
|
return function loadContact() {
|
|
2119
|
-
return
|
|
2033
|
+
return _ref11.apply(this, arguments);
|
|
2120
2034
|
};
|
|
2121
2035
|
}();
|
|
2122
2036
|
pending.promise = loadContact().then( /*#__PURE__*/function () {
|
|
2123
|
-
var
|
|
2037
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(value) {
|
|
2124
2038
|
var _current$_extend;
|
|
2125
2039
|
var current;
|
|
2126
|
-
return _regeneratorRuntime().wrap(function
|
|
2127
|
-
while (1) switch (
|
|
2040
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2041
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2128
2042
|
case 0:
|
|
2129
|
-
current =
|
|
2130
|
-
if (!(
|
|
2131
|
-
|
|
2043
|
+
current = _this4.getTempOrder();
|
|
2044
|
+
if (!(_this4.orderCustomerContactRequest !== pending || _this4.getCustomerContactOrderKey() !== orderKey || Number(current === null || current === void 0 ? void 0 : current.customer_id) !== customerId || scope !== _this4.getCustomerContactScope() || current !== null && current !== void 0 && (_current$_extend = current._extend) !== null && _current$_extend !== void 0 && _current$_extend.contactInfoEdited || (current === null || current === void 0 ? void 0 : current.contacts_info) != null || userPlatform && getAuthenticatedCustomerId() !== customerId)) {
|
|
2045
|
+
_context29.next = 3;
|
|
2132
2046
|
break;
|
|
2133
2047
|
}
|
|
2134
|
-
return
|
|
2048
|
+
return _context29.abrupt("return");
|
|
2135
2049
|
case 3:
|
|
2136
2050
|
if (!value) {
|
|
2137
|
-
|
|
2051
|
+
_context29.next = 6;
|
|
2138
2052
|
break;
|
|
2139
2053
|
}
|
|
2140
|
-
|
|
2141
|
-
return
|
|
2054
|
+
_context29.next = 6;
|
|
2055
|
+
return _this4.applyDefaultOrderCustomerContactInfo(value);
|
|
2142
2056
|
case 6:
|
|
2143
2057
|
case "end":
|
|
2144
|
-
return
|
|
2058
|
+
return _context29.stop();
|
|
2145
2059
|
}
|
|
2146
|
-
},
|
|
2060
|
+
}, _callee29);
|
|
2147
2061
|
}));
|
|
2148
2062
|
return function (_x18) {
|
|
2149
|
-
return
|
|
2063
|
+
return _ref12.apply(this, arguments);
|
|
2150
2064
|
};
|
|
2151
2065
|
}()).catch(function () {
|
|
2152
2066
|
// A failed default does not prevent manual entry; a subsequent sync can retry.
|
|
2153
|
-
if (
|
|
2067
|
+
if (_this4.orderCustomerContactRequest === pending) _this4.orderCustomerContactRequest = null;
|
|
2154
2068
|
console.warn('[BookingTicket] Failed to load saved customer contact information');
|
|
2155
2069
|
});
|
|
2156
2070
|
}
|
|
@@ -2163,31 +2077,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2163
2077
|
}, {
|
|
2164
2078
|
key: "validateContactInfo",
|
|
2165
2079
|
value: function () {
|
|
2166
|
-
var _validateContactInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2080
|
+
var _validateContactInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
2167
2081
|
var _this$getTempOrder, _this$getTempOrder2;
|
|
2168
2082
|
var orderKey, customerId, scope;
|
|
2169
|
-
return _regeneratorRuntime().wrap(function
|
|
2170
|
-
while (1) switch (
|
|
2083
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2084
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2171
2085
|
case 0:
|
|
2172
2086
|
orderKey = this.getCustomerContactOrderKey();
|
|
2173
2087
|
customerId = (_this$getTempOrder = this.getTempOrder()) === null || _this$getTempOrder === void 0 ? void 0 : _this$getTempOrder.customer_id;
|
|
2174
2088
|
scope = this.getCustomerContactScope();
|
|
2175
|
-
|
|
2089
|
+
_context30.next = 5;
|
|
2176
2090
|
return this.waitForOrderCustomerContactInfo();
|
|
2177
2091
|
case 5:
|
|
2178
2092
|
if (!(this.getCustomerContactOrderKey() !== orderKey || ((_this$getTempOrder2 = this.getTempOrder()) === null || _this$getTempOrder2 === void 0 ? void 0 : _this$getTempOrder2.customer_id) !== customerId || this.getCustomerContactScope() !== scope)) {
|
|
2179
|
-
|
|
2093
|
+
_context30.next = 7;
|
|
2180
2094
|
break;
|
|
2181
2095
|
}
|
|
2182
2096
|
throw new Error('The order changed. Please try again.');
|
|
2183
2097
|
case 7:
|
|
2184
|
-
|
|
2098
|
+
_context30.next = 9;
|
|
2185
2099
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "validateContactInfo", this).call(this);
|
|
2186
2100
|
case 9:
|
|
2187
2101
|
case "end":
|
|
2188
|
-
return
|
|
2102
|
+
return _context30.stop();
|
|
2189
2103
|
}
|
|
2190
|
-
},
|
|
2104
|
+
}, _callee30, this);
|
|
2191
2105
|
}));
|
|
2192
2106
|
function validateContactInfo() {
|
|
2193
2107
|
return _validateContactInfo.apply(this, arguments);
|
|
@@ -2220,9 +2134,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2220
2134
|
value: function clearOrderCustomer(options) {
|
|
2221
2135
|
var _discountModule$setOr,
|
|
2222
2136
|
_discountModule$setDi,
|
|
2223
|
-
|
|
2224
|
-
var enableMemberCartConsistency = this.isMemberCartConsistencyEnabled();
|
|
2225
|
-
var refreshRevision = enableMemberCartConsistency ? ++this.orderCustomerRefreshRevision : undefined;
|
|
2137
|
+
_this5 = this;
|
|
2226
2138
|
this.orderCustomerContactRequest = null;
|
|
2227
2139
|
if (!(options !== null && options !== void 0 && options.preserveContactInfo)) this.resetOrderCustomerContactInfo();
|
|
2228
2140
|
if (!(options !== null && options !== void 0 && options.preserveContactInfo)) this.store.order.updateTempOrderContactsInfo(null);
|
|
@@ -2234,25 +2146,19 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2234
2146
|
void (discountModule === null || discountModule === void 0 || (_discountModule$setOr = discountModule.setOriginalDiscountList) === null || _discountModule$setOr === void 0 ? void 0 : _discountModule$setOr.call(discountModule, []));
|
|
2235
2147
|
void (discountModule === null || discountModule === void 0 || (_discountModule$setDi = discountModule.setDiscountList) === null || _discountModule$setDi === void 0 ? void 0 : _discountModule$setDi.call(discountModule, []));
|
|
2236
2148
|
this.store.order.applyDiscount();
|
|
2237
|
-
|
|
2238
|
-
var refreshTask = this.store.order.recalculateSummary({
|
|
2149
|
+
void this.store.order.recalculateSummary({
|
|
2239
2150
|
createIfMissing: true
|
|
2240
2151
|
}).then(function () {
|
|
2241
2152
|
var _discountModule$getDi;
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
return _this6.effectsEmit('onDiscountApplied', {
|
|
2153
|
+
var tempOrder = _this5.store.order.ensureTempOrder();
|
|
2154
|
+
_this5.store.order.persistTempOrder();
|
|
2155
|
+
return _this5.effectsEmit('onDiscountApplied', {
|
|
2246
2156
|
productList: tempOrder.products || [],
|
|
2247
2157
|
discountList: (discountModule === null || discountModule === void 0 || (_discountModule$getDi = discountModule.getDiscountList) === null || _discountModule$getDi === void 0 ? void 0 : _discountModule$getDi.call(discountModule)) || [],
|
|
2248
2158
|
selectedDiscountList: tempOrder.discount_list || [],
|
|
2249
2159
|
tempOrder: tempOrder
|
|
2250
2160
|
});
|
|
2251
|
-
})
|
|
2252
|
-
if (enableMemberCartConsistency) this.orderCustomerRefreshTask = refreshTask.then(function () {
|
|
2253
|
-
return undefined;
|
|
2254
|
-
});
|
|
2255
|
-
void (enableMemberCartConsistency ? this.orderCustomerRefreshTask : refreshTask).catch(function (error) {
|
|
2161
|
+
}).catch(function (error) {
|
|
2256
2162
|
console.error('Failed to recalculate summary after clearing customer:', error);
|
|
2257
2163
|
});
|
|
2258
2164
|
this.core.effects.emit("".concat(this.name, ":onOrderCustomerChange"), null);
|
|
@@ -2270,24 +2176,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2270
2176
|
}, {
|
|
2271
2177
|
key: "restoreOrder",
|
|
2272
2178
|
value: (function () {
|
|
2273
|
-
var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2179
|
+
var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
2274
2180
|
var _this$store$customer;
|
|
2275
2181
|
var tempOrder;
|
|
2276
|
-
return _regeneratorRuntime().wrap(function
|
|
2277
|
-
while (1) switch (
|
|
2182
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2183
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2278
2184
|
case 0:
|
|
2279
|
-
|
|
2185
|
+
_context31.next = 2;
|
|
2280
2186
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "restoreOrder", this).call(this);
|
|
2281
2187
|
case 2:
|
|
2282
|
-
tempOrder =
|
|
2188
|
+
tempOrder = _context31.sent;
|
|
2283
2189
|
this.clearOrderCustomer();
|
|
2284
2190
|
(_this$store$customer = this.store.customer) === null || _this$store$customer === void 0 || _this$store$customer.setSelectedCustomer(null);
|
|
2285
|
-
return
|
|
2191
|
+
return _context31.abrupt("return", tempOrder);
|
|
2286
2192
|
case 6:
|
|
2287
2193
|
case "end":
|
|
2288
|
-
return
|
|
2194
|
+
return _context31.stop();
|
|
2289
2195
|
}
|
|
2290
|
-
},
|
|
2196
|
+
}, _callee31, this);
|
|
2291
2197
|
}));
|
|
2292
2198
|
function restoreOrder() {
|
|
2293
2199
|
return _restoreOrder.apply(this, arguments);
|
|
@@ -2307,12 +2213,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2307
2213
|
}, {
|
|
2308
2214
|
key: "refreshDiscountConfigAfterOrderCustomerChange",
|
|
2309
2215
|
value: function refreshDiscountConfigAfterOrderCustomerChange(customerId) {
|
|
2310
|
-
var _this$store$order$
|
|
2216
|
+
var _this$store$order$get4,
|
|
2311
2217
|
_this$store$order6,
|
|
2312
2218
|
_this$getOrderIdentit,
|
|
2313
|
-
|
|
2219
|
+
_this6 = this;
|
|
2314
2220
|
if (!customerId || customerId === 1) return Promise.resolve();
|
|
2315
|
-
var tempOrder = (_this$store$order$
|
|
2221
|
+
var tempOrder = (_this$store$order$get4 = (_this$store$order6 = this.store.order).getTempOrder) === null || _this$store$order$get4 === void 0 ? void 0 : _this$store$order$get4.call(_this$store$order6);
|
|
2316
2222
|
var orderIdentity = (_this$getOrderIdentit = this.getOrderIdentity) === null || _this$getOrderIdentit === void 0 ? void 0 : _this$getOrderIdentit.call(this);
|
|
2317
2223
|
var orderId = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) || (orderIdentity === null || orderIdentity === void 0 ? void 0 : orderIdentity.orderId);
|
|
2318
2224
|
var action = !orderId || String(orderId).startsWith('local_order') ? 'create' : 'edit';
|
|
@@ -2322,50 +2228,50 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2322
2228
|
return this.orderCustomerDiscountRefreshInFlight;
|
|
2323
2229
|
}
|
|
2324
2230
|
var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
|
|
2325
|
-
var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2326
|
-
var
|
|
2231
|
+
var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
|
|
2232
|
+
var _this6$store$order$ge, _this6$store$order, _this6$getOrderIdenti;
|
|
2327
2233
|
var currentCustomer, currentTempOrder, currentOrderIdentity, currentOrderId, currentAction, currentOrderTarget;
|
|
2328
|
-
return _regeneratorRuntime().wrap(function
|
|
2329
|
-
while (1) switch (
|
|
2234
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2235
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2330
2236
|
case 0:
|
|
2331
2237
|
if (!previousRefresh) {
|
|
2332
|
-
|
|
2238
|
+
_context32.next = 3;
|
|
2333
2239
|
break;
|
|
2334
2240
|
}
|
|
2335
|
-
|
|
2241
|
+
_context32.next = 3;
|
|
2336
2242
|
return previousRefresh.catch(function () {
|
|
2337
2243
|
return undefined;
|
|
2338
2244
|
});
|
|
2339
2245
|
case 3:
|
|
2340
|
-
currentCustomer =
|
|
2246
|
+
currentCustomer = _this6.store.order.getOrderCustomer();
|
|
2341
2247
|
if (!(!currentCustomer || Number(currentCustomer.customer_id) !== customerId)) {
|
|
2342
|
-
|
|
2248
|
+
_context32.next = 6;
|
|
2343
2249
|
break;
|
|
2344
2250
|
}
|
|
2345
|
-
return
|
|
2251
|
+
return _context32.abrupt("return");
|
|
2346
2252
|
case 6:
|
|
2347
|
-
currentTempOrder = (
|
|
2348
|
-
currentOrderIdentity = (
|
|
2253
|
+
currentTempOrder = (_this6$store$order$ge = (_this6$store$order = _this6.store.order).getTempOrder) === null || _this6$store$order$ge === void 0 ? void 0 : _this6$store$order$ge.call(_this6$store$order);
|
|
2254
|
+
currentOrderIdentity = (_this6$getOrderIdenti = _this6.getOrderIdentity) === null || _this6$getOrderIdenti === void 0 ? void 0 : _this6$getOrderIdenti.call(_this6);
|
|
2349
2255
|
currentOrderId = (currentTempOrder === null || currentTempOrder === void 0 ? void 0 : currentTempOrder.order_id) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.orderId);
|
|
2350
2256
|
currentAction = !currentOrderId || String(currentOrderId).startsWith('local_order') ? 'create' : 'edit';
|
|
2351
2257
|
currentOrderTarget = currentOrderId ? "order:".concat(String(currentOrderId)) : "external:".concat(String((currentTempOrder === null || currentTempOrder === void 0 ? void 0 : currentTempOrder.external_sale_number) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.externalSaleNumber) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.localId) || 'new'));
|
|
2352
2258
|
if (!("".concat(customerId, ":").concat(currentAction, ":").concat(currentOrderTarget) !== refreshTarget)) {
|
|
2353
|
-
|
|
2259
|
+
_context32.next = 13;
|
|
2354
2260
|
break;
|
|
2355
2261
|
}
|
|
2356
|
-
return
|
|
2262
|
+
return _context32.abrupt("return");
|
|
2357
2263
|
case 13:
|
|
2358
|
-
|
|
2359
|
-
return
|
|
2264
|
+
_context32.next = 15;
|
|
2265
|
+
return _this6.loadDiscountConfig({
|
|
2360
2266
|
customerId: customerId,
|
|
2361
2267
|
action: action,
|
|
2362
2268
|
force: true
|
|
2363
2269
|
});
|
|
2364
2270
|
case 15:
|
|
2365
2271
|
case "end":
|
|
2366
|
-
return
|
|
2272
|
+
return _context32.stop();
|
|
2367
2273
|
}
|
|
2368
|
-
},
|
|
2274
|
+
}, _callee32);
|
|
2369
2275
|
}))();
|
|
2370
2276
|
this.orderCustomerDiscountRefreshInFlight = refreshTask;
|
|
2371
2277
|
this.orderCustomerDiscountRefreshCustomerId = customerId;
|
|
@@ -2373,10 +2279,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2373
2279
|
refreshTask.catch(function (error) {
|
|
2374
2280
|
console.error('Failed to load discount config after customer change:', error);
|
|
2375
2281
|
}).finally(function () {
|
|
2376
|
-
if (
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2282
|
+
if (_this6.orderCustomerDiscountRefreshInFlight !== refreshTask) return;
|
|
2283
|
+
_this6.orderCustomerDiscountRefreshInFlight = null;
|
|
2284
|
+
_this6.orderCustomerDiscountRefreshCustomerId = null;
|
|
2285
|
+
_this6.orderCustomerDiscountRefreshTarget = null;
|
|
2380
2286
|
});
|
|
2381
2287
|
return refreshTask;
|
|
2382
2288
|
}
|
|
@@ -2385,62 +2291,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2385
2291
|
value: function waitForOrderCustomerPromotionRefresh() {
|
|
2386
2292
|
return this.orderCustomerPromotionRefreshInFlight || Promise.resolve();
|
|
2387
2293
|
}
|
|
2388
|
-
|
|
2389
|
-
/** Wait before reading cart rows: member coupons can split or consolidate them. */
|
|
2390
|
-
}, {
|
|
2391
|
-
key: "waitForOrderCustomerRefresh",
|
|
2392
|
-
value: (function () {
|
|
2393
|
-
var _waitForOrderCustomerRefresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
|
|
2394
|
-
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
2395
|
-
while (1) switch (_context35.prev = _context35.next) {
|
|
2396
|
-
case 0:
|
|
2397
|
-
if (this.isMemberCartConsistencyEnabled()) {
|
|
2398
|
-
_context35.next = 2;
|
|
2399
|
-
break;
|
|
2400
|
-
}
|
|
2401
|
-
return _context35.abrupt("return");
|
|
2402
|
-
case 2:
|
|
2403
|
-
_context35.next = 4;
|
|
2404
|
-
return Promise.resolve();
|
|
2405
|
-
case 4:
|
|
2406
|
-
_context35.next = 6;
|
|
2407
|
-
return this.orderCustomerRefreshTask;
|
|
2408
|
-
case 6:
|
|
2409
|
-
case "end":
|
|
2410
|
-
return _context35.stop();
|
|
2411
|
-
}
|
|
2412
|
-
}, _callee35, this);
|
|
2413
|
-
}));
|
|
2414
|
-
function waitForOrderCustomerRefresh() {
|
|
2415
|
-
return _waitForOrderCustomerRefresh.apply(this, arguments);
|
|
2416
|
-
}
|
|
2417
|
-
return waitForOrderCustomerRefresh;
|
|
2418
|
-
}())
|
|
2419
2294
|
}, {
|
|
2420
2295
|
key: "prepareProductPriceQueryContext",
|
|
2421
2296
|
value: function () {
|
|
2422
|
-
var _prepareProductPriceQueryContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2297
|
+
var _prepareProductPriceQueryContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(customerId) {
|
|
2423
2298
|
var normalizedCustomerId, refreshTask, shouldWait;
|
|
2424
|
-
return _regeneratorRuntime().wrap(function
|
|
2425
|
-
while (1) switch (
|
|
2299
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2300
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2426
2301
|
case 0:
|
|
2427
|
-
|
|
2302
|
+
_context33.next = 2;
|
|
2428
2303
|
return Promise.resolve();
|
|
2429
2304
|
case 2:
|
|
2430
2305
|
normalizedCustomerId = Number(customerId || 0);
|
|
2431
2306
|
refreshTask = this.orderCustomerDiscountRefreshInFlight;
|
|
2432
2307
|
shouldWait = normalizedCustomerId > 1 && this.orderCustomerDiscountRefreshCustomerId === normalizedCustomerId && Boolean(refreshTask);
|
|
2433
2308
|
if (!(shouldWait && refreshTask)) {
|
|
2434
|
-
|
|
2309
|
+
_context33.next = 8;
|
|
2435
2310
|
break;
|
|
2436
2311
|
}
|
|
2437
|
-
|
|
2312
|
+
_context33.next = 8;
|
|
2438
2313
|
return refreshTask;
|
|
2439
2314
|
case 8:
|
|
2440
2315
|
case "end":
|
|
2441
|
-
return
|
|
2316
|
+
return _context33.stop();
|
|
2442
2317
|
}
|
|
2443
|
-
},
|
|
2318
|
+
}, _callee33, this);
|
|
2444
2319
|
}));
|
|
2445
2320
|
function prepareProductPriceQueryContext(_x19) {
|
|
2446
2321
|
return _prepareProductPriceQueryContext.apply(this, arguments);
|
|
@@ -2495,27 +2370,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2495
2370
|
}, {
|
|
2496
2371
|
key: "changeCustomerPage",
|
|
2497
2372
|
value: (function () {
|
|
2498
|
-
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2373
|
+
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(page, pageSize) {
|
|
2499
2374
|
var _result5;
|
|
2500
|
-
return _regeneratorRuntime().wrap(function
|
|
2501
|
-
while (1) switch (
|
|
2375
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2376
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2502
2377
|
case 0:
|
|
2503
|
-
|
|
2504
|
-
|
|
2378
|
+
_context34.prev = 0;
|
|
2379
|
+
_context34.next = 3;
|
|
2505
2380
|
return this.store.customer.changeCustomerPage(page, pageSize);
|
|
2506
2381
|
case 3:
|
|
2507
|
-
_result5 =
|
|
2508
|
-
return
|
|
2382
|
+
_result5 = _context34.sent;
|
|
2383
|
+
return _context34.abrupt("return", _result5);
|
|
2509
2384
|
case 7:
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
console.error('Failed to change customer page:',
|
|
2513
|
-
throw
|
|
2385
|
+
_context34.prev = 7;
|
|
2386
|
+
_context34.t0 = _context34["catch"](0);
|
|
2387
|
+
console.error('Failed to change customer page:', _context34.t0);
|
|
2388
|
+
throw _context34.t0;
|
|
2514
2389
|
case 11:
|
|
2515
2390
|
case "end":
|
|
2516
|
-
return
|
|
2391
|
+
return _context34.stop();
|
|
2517
2392
|
}
|
|
2518
|
-
},
|
|
2393
|
+
}, _callee34, this, [[0, 7]]);
|
|
2519
2394
|
}));
|
|
2520
2395
|
function changeCustomerPage(_x20, _x21) {
|
|
2521
2396
|
return _changeCustomerPage.apply(this, arguments);
|
|
@@ -2530,28 +2405,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2530
2405
|
}, {
|
|
2531
2406
|
key: "loadMoreCustomers",
|
|
2532
2407
|
value: (function () {
|
|
2533
|
-
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2408
|
+
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
|
|
2534
2409
|
var _result6;
|
|
2535
|
-
return _regeneratorRuntime().wrap(function
|
|
2536
|
-
while (1) switch (
|
|
2410
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
2411
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2537
2412
|
case 0:
|
|
2538
|
-
|
|
2539
|
-
|
|
2413
|
+
_context35.prev = 0;
|
|
2414
|
+
_context35.next = 3;
|
|
2540
2415
|
return this.store.customer.loadMoreCustomers();
|
|
2541
2416
|
case 3:
|
|
2542
|
-
_result6 =
|
|
2417
|
+
_result6 = _context35.sent;
|
|
2543
2418
|
this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result6);
|
|
2544
|
-
return
|
|
2419
|
+
return _context35.abrupt("return", _result6);
|
|
2545
2420
|
case 8:
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
console.error('Failed to load more customers:',
|
|
2549
|
-
throw
|
|
2421
|
+
_context35.prev = 8;
|
|
2422
|
+
_context35.t0 = _context35["catch"](0);
|
|
2423
|
+
console.error('Failed to load more customers:', _context35.t0);
|
|
2424
|
+
throw _context35.t0;
|
|
2550
2425
|
case 12:
|
|
2551
2426
|
case "end":
|
|
2552
|
-
return
|
|
2427
|
+
return _context35.stop();
|
|
2553
2428
|
}
|
|
2554
|
-
},
|
|
2429
|
+
}, _callee35, this, [[0, 8]]);
|
|
2555
2430
|
}));
|
|
2556
2431
|
function loadMoreCustomers() {
|
|
2557
2432
|
return _loadMoreCustomers.apply(this, arguments);
|
|
@@ -2567,31 +2442,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2567
2442
|
}, {
|
|
2568
2443
|
key: "resetAndLoadCustomers",
|
|
2569
2444
|
value: (function () {
|
|
2570
|
-
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2445
|
+
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
|
|
2571
2446
|
var params,
|
|
2572
2447
|
_result7,
|
|
2573
|
-
|
|
2574
|
-
return _regeneratorRuntime().wrap(function
|
|
2575
|
-
while (1) switch (
|
|
2448
|
+
_args36 = arguments;
|
|
2449
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
2450
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2576
2451
|
case 0:
|
|
2577
|
-
params =
|
|
2578
|
-
|
|
2579
|
-
|
|
2452
|
+
params = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {};
|
|
2453
|
+
_context36.prev = 1;
|
|
2454
|
+
_context36.next = 4;
|
|
2580
2455
|
return this.store.customer.resetAndLoadCustomers(params);
|
|
2581
2456
|
case 4:
|
|
2582
|
-
_result7 =
|
|
2457
|
+
_result7 = _context36.sent;
|
|
2583
2458
|
this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result7);
|
|
2584
|
-
return
|
|
2459
|
+
return _context36.abrupt("return", _result7);
|
|
2585
2460
|
case 9:
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
console.error('Failed to reset and load customers:',
|
|
2589
|
-
throw
|
|
2461
|
+
_context36.prev = 9;
|
|
2462
|
+
_context36.t0 = _context36["catch"](1);
|
|
2463
|
+
console.error('Failed to reset and load customers:', _context36.t0);
|
|
2464
|
+
throw _context36.t0;
|
|
2590
2465
|
case 13:
|
|
2591
2466
|
case "end":
|
|
2592
|
-
return
|
|
2467
|
+
return _context36.stop();
|
|
2593
2468
|
}
|
|
2594
|
-
},
|
|
2469
|
+
}, _callee36, this, [[1, 9]]);
|
|
2595
2470
|
}));
|
|
2596
2471
|
function resetAndLoadCustomers() {
|
|
2597
2472
|
return _resetAndLoadCustomers.apply(this, arguments);
|
|
@@ -2636,9 +2511,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2636
2511
|
}, {
|
|
2637
2512
|
key: "scanGlobalListener",
|
|
2638
2513
|
value: function scanGlobalListener(callback) {
|
|
2639
|
-
var
|
|
2514
|
+
var _this7 = this;
|
|
2640
2515
|
var localSearch = function localSearch(v) {
|
|
2641
|
-
return
|
|
2516
|
+
return _this7.store.products.findProductsByCodeOrBarcode(v);
|
|
2642
2517
|
};
|
|
2643
2518
|
var scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
|
|
2644
2519
|
var safeCallback = function safeCallback(d) {
|
|
@@ -2752,16 +2627,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2752
2627
|
}, {
|
|
2753
2628
|
key: "getOtherParams",
|
|
2754
2629
|
value: (function () {
|
|
2755
|
-
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2756
|
-
return _regeneratorRuntime().wrap(function
|
|
2757
|
-
while (1) switch (
|
|
2630
|
+
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
|
|
2631
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
2632
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2758
2633
|
case 0:
|
|
2759
|
-
return
|
|
2634
|
+
return _context37.abrupt("return", this.otherParams);
|
|
2760
2635
|
case 1:
|
|
2761
2636
|
case "end":
|
|
2762
|
-
return
|
|
2637
|
+
return _context37.stop();
|
|
2763
2638
|
}
|
|
2764
|
-
},
|
|
2639
|
+
}, _callee37, this);
|
|
2765
2640
|
}));
|
|
2766
2641
|
function getOtherParams() {
|
|
2767
2642
|
return _getOtherParams.apply(this, arguments);
|
|
@@ -2871,7 +2746,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2871
2746
|
var _extra$date,
|
|
2872
2747
|
_extra$presetStartTim,
|
|
2873
2748
|
_this$getOrderSession,
|
|
2874
|
-
|
|
2749
|
+
_this8 = this,
|
|
2875
2750
|
_this$otherParams10;
|
|
2876
2751
|
var state = this.store.bookingContext.getState();
|
|
2877
2752
|
var date = (_extra$date = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date !== void 0 ? _extra$date : state.date;
|
|
@@ -2884,7 +2759,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2884
2759
|
}, extra || {}), {}, {
|
|
2885
2760
|
orderSessionId: (_this$getOrderSession = this.getOrderSessionId()) !== null && _this$getOrderSession !== void 0 ? _this$getOrderSession : undefined,
|
|
2886
2761
|
isOrderSessionCurrent: function isOrderSessionCurrent(sessionId) {
|
|
2887
|
-
return
|
|
2762
|
+
return _this8.isOrderSessionCurrent(sessionId);
|
|
2888
2763
|
},
|
|
2889
2764
|
platform: String(((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.platform) || '').trim().toLowerCase()
|
|
2890
2765
|
});
|
|
@@ -2982,17 +2857,17 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2982
2857
|
key: "buildAddProductCtx",
|
|
2983
2858
|
value: function buildAddProductCtx(extra) {
|
|
2984
2859
|
var _extra$date2,
|
|
2985
|
-
|
|
2860
|
+
_ref14,
|
|
2986
2861
|
_this$getOrderCustome4,
|
|
2987
2862
|
_this$getOrderCustome5,
|
|
2988
|
-
_this$store$order$
|
|
2863
|
+
_this$store$order$get5,
|
|
2989
2864
|
_extra$presetStartTim2,
|
|
2990
2865
|
_this$getOrderSession2,
|
|
2991
|
-
|
|
2866
|
+
_this9 = this,
|
|
2992
2867
|
_this$otherParams11;
|
|
2993
2868
|
var bookingContextState = this.store.bookingContext.getState();
|
|
2994
2869
|
var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
|
|
2995
|
-
var orderCustomerId = (
|
|
2870
|
+
var orderCustomerId = (_ref14 = (_this$getOrderCustome4 = (_this$getOrderCustome5 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome5 === void 0 ? void 0 : _this$getOrderCustome5.id) !== null && _this$getOrderCustome4 !== void 0 ? _this$getOrderCustome4 : (_this$store$order$get5 = this.store.order.getTempOrder()) === null || _this$store$order$get5 === void 0 ? void 0 : _this$store$order$get5.customer_id) !== null && _ref14 !== void 0 ? _ref14 : undefined;
|
|
2996
2871
|
return _objectSpread(_objectSpread({
|
|
2997
2872
|
bookingConfig: bookingContextState.bookingConfig,
|
|
2998
2873
|
resourcesOrigin: bookingContextState.resourcesOrigin,
|
|
@@ -3004,7 +2879,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3004
2879
|
channel: this.getSubmitOrderSalesChannel(),
|
|
3005
2880
|
orderSessionId: (_this$getOrderSession2 = this.getOrderSessionId()) !== null && _this$getOrderSession2 !== void 0 ? _this$getOrderSession2 : undefined,
|
|
3006
2881
|
isOrderSessionCurrent: function isOrderSessionCurrent(sessionId) {
|
|
3007
|
-
return
|
|
2882
|
+
return _this9.isOrderSessionCurrent(sessionId);
|
|
3008
2883
|
},
|
|
3009
2884
|
platform: String(((_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.platform) || '').trim().toLowerCase()
|
|
3010
2885
|
});
|
|
@@ -3108,16 +2983,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3108
2983
|
}, {
|
|
3109
2984
|
key: "updateProductInOrder",
|
|
3110
2985
|
value: (function () {
|
|
3111
|
-
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3112
|
-
return _regeneratorRuntime().wrap(function
|
|
3113
|
-
while (1) switch (
|
|
2986
|
+
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(params) {
|
|
2987
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
2988
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
3114
2989
|
case 0:
|
|
3115
|
-
return
|
|
2990
|
+
return _context38.abrupt("return", this.updateOrderProduct(params));
|
|
3116
2991
|
case 1:
|
|
3117
2992
|
case "end":
|
|
3118
|
-
return
|
|
2993
|
+
return _context38.stop();
|
|
3119
2994
|
}
|
|
3120
|
-
},
|
|
2995
|
+
}, _callee38, this);
|
|
3121
2996
|
}));
|
|
3122
2997
|
function updateProductInOrder(_x22) {
|
|
3123
2998
|
return _updateProductInOrder.apply(this, arguments);
|
|
@@ -3141,24 +3016,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3141
3016
|
}, {
|
|
3142
3017
|
key: "handleGlobalScanCode",
|
|
3143
3018
|
value: (function () {
|
|
3144
|
-
var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3145
|
-
var
|
|
3019
|
+
var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(code, bridge) {
|
|
3020
|
+
var _this10 = this;
|
|
3146
3021
|
var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, _promotion$isAccepted, promotion, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, host, _result8, _bridge$onNotify3, _bridge$isCurrent;
|
|
3147
|
-
return _regeneratorRuntime().wrap(function
|
|
3148
|
-
while (1) switch (
|
|
3022
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
|
3023
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
3149
3024
|
case 0:
|
|
3150
3025
|
trimmed = typeof code === 'string' ? code.trim() : '';
|
|
3151
3026
|
if (trimmed) {
|
|
3152
|
-
|
|
3027
|
+
_context40.next = 4;
|
|
3153
3028
|
break;
|
|
3154
3029
|
}
|
|
3155
3030
|
bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
3156
|
-
return
|
|
3031
|
+
return _context40.abrupt("return", {
|
|
3157
3032
|
status: 'failed',
|
|
3158
3033
|
reason: 'empty_code'
|
|
3159
3034
|
});
|
|
3160
3035
|
case 4:
|
|
3161
|
-
|
|
3036
|
+
_context40.prev = 4;
|
|
3162
3037
|
// Capture before lookup/UI awaits, so a result cannot land in a new cart.
|
|
3163
3038
|
// Unscoped POS Order modules return a no-op guard.
|
|
3164
3039
|
beforeScanCommit = this.store.order.createCartIntentCommitGuard('add_product');
|
|
@@ -3185,23 +3060,23 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3185
3060
|
} : undefined
|
|
3186
3061
|
}) : undefined;
|
|
3187
3062
|
if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher')) {
|
|
3188
|
-
|
|
3063
|
+
_context40.next = 16;
|
|
3189
3064
|
break;
|
|
3190
3065
|
}
|
|
3191
3066
|
if (guardedBridge.applyPromotionCode) {
|
|
3192
|
-
|
|
3067
|
+
_context40.next = 12;
|
|
3193
3068
|
break;
|
|
3194
3069
|
}
|
|
3195
|
-
return
|
|
3070
|
+
return _context40.abrupt("return", {
|
|
3196
3071
|
status: 'failed',
|
|
3197
3072
|
reason: 'no_bridge'
|
|
3198
3073
|
});
|
|
3199
3074
|
case 12:
|
|
3200
|
-
|
|
3075
|
+
_context40.next = 14;
|
|
3201
3076
|
return guardedBridge.applyPromotionCode(trimmed);
|
|
3202
3077
|
case 14:
|
|
3203
|
-
promotion =
|
|
3204
|
-
return
|
|
3078
|
+
promotion = _context40.sent;
|
|
3079
|
+
return _context40.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
|
|
3205
3080
|
status: 'success',
|
|
3206
3081
|
kind: 'promotion'
|
|
3207
3082
|
} : {
|
|
@@ -3210,23 +3085,23 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3210
3085
|
});
|
|
3211
3086
|
case 16:
|
|
3212
3087
|
localSearch = function localSearch(v) {
|
|
3213
|
-
return
|
|
3088
|
+
return _this10.store.products.findProductsByCodeOrBarcode(v);
|
|
3214
3089
|
};
|
|
3215
3090
|
scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
|
|
3216
|
-
|
|
3091
|
+
_context40.next = 20;
|
|
3217
3092
|
return scanCallback({
|
|
3218
3093
|
type: 'nativeScanner',
|
|
3219
3094
|
value: trimmed
|
|
3220
3095
|
});
|
|
3221
3096
|
case 20:
|
|
3222
|
-
raw =
|
|
3097
|
+
raw = _context40.sent;
|
|
3223
3098
|
formatted = formatGlobalScanResult(raw, trimmed);
|
|
3224
3099
|
if (formatted) {
|
|
3225
|
-
|
|
3100
|
+
_context40.next = 25;
|
|
3226
3101
|
break;
|
|
3227
3102
|
}
|
|
3228
3103
|
bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
3229
|
-
return
|
|
3104
|
+
return _context40.abrupt("return", {
|
|
3230
3105
|
status: 'failed',
|
|
3231
3106
|
reason: 'not_found'
|
|
3232
3107
|
});
|
|
@@ -3234,73 +3109,73 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3234
3109
|
host = {
|
|
3235
3110
|
setOrderCustomer: function setOrderCustomer(customer) {
|
|
3236
3111
|
beforeScanCommit();
|
|
3237
|
-
|
|
3112
|
+
_this10.setOrderCustomer(customer);
|
|
3238
3113
|
},
|
|
3239
3114
|
getOrderCustomerSnapshot: function getOrderCustomerSnapshot() {
|
|
3240
|
-
return
|
|
3115
|
+
return _this10.getOrderCustomerSnapshot();
|
|
3241
3116
|
},
|
|
3242
3117
|
resolveCustomerById: function resolveCustomerById(customerId) {
|
|
3243
|
-
return
|
|
3118
|
+
return _this10.resolveCustomerById(customerId);
|
|
3244
3119
|
},
|
|
3245
3120
|
getBusinessCode: function getBusinessCode() {
|
|
3246
|
-
var
|
|
3247
|
-
return (
|
|
3121
|
+
var _this10$otherParams;
|
|
3122
|
+
return (_this10$otherParams = _this10.otherParams) === null || _this10$otherParams === void 0 ? void 0 : _this10$otherParams.businessCode;
|
|
3248
3123
|
},
|
|
3249
3124
|
buildAddProductCtx: function buildAddProductCtx(extra) {
|
|
3250
|
-
return
|
|
3125
|
+
return _this10.buildAddProductCtx(extra);
|
|
3251
3126
|
},
|
|
3252
3127
|
decideAddProduct: function decideAddProduct(item, options) {
|
|
3253
|
-
return
|
|
3128
|
+
return _this10.decideAddProduct(item, options);
|
|
3254
3129
|
},
|
|
3255
3130
|
decideAfterDetail: function decideAfterDetail(cacheItem, options) {
|
|
3256
|
-
return
|
|
3131
|
+
return _this10.decideAfterDetail(cacheItem, options);
|
|
3257
3132
|
},
|
|
3258
3133
|
transformDetailToProductAndBooking: function transformDetailToProductAndBooking(input) {
|
|
3259
|
-
return
|
|
3134
|
+
return _this10.transformDetailToProductAndBooking(input);
|
|
3260
3135
|
},
|
|
3261
3136
|
addProductToOrder: function addProductToOrder(product, booking) {
|
|
3262
3137
|
beforeScanCommit();
|
|
3263
|
-
return
|
|
3138
|
+
return _this10.addProductToOrder(product, booking);
|
|
3264
3139
|
},
|
|
3265
3140
|
refreshWalletAssets: function refreshWalletAssets(params) {
|
|
3266
|
-
return
|
|
3141
|
+
return _this10.refreshWalletAssets(params);
|
|
3267
3142
|
},
|
|
3268
3143
|
scanWalletAsset: function scanWalletAsset(scanCode) {
|
|
3269
3144
|
beforeScanCommit();
|
|
3270
|
-
return
|
|
3145
|
+
return _this10.scanWalletAsset(scanCode);
|
|
3271
3146
|
}
|
|
3272
3147
|
};
|
|
3273
3148
|
if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher-collection')) {
|
|
3274
|
-
|
|
3149
|
+
_context40.next = 32;
|
|
3275
3150
|
break;
|
|
3276
3151
|
}
|
|
3277
|
-
|
|
3152
|
+
_context40.next = 29;
|
|
3278
3153
|
return applyProductVoucherCollectionScan(_objectSpread(_objectSpread({}, host), {}, {
|
|
3279
3154
|
loadCustomerDiscounts: function () {
|
|
3280
|
-
var _loadCustomerDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3281
|
-
var
|
|
3155
|
+
var _loadCustomerDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
|
|
3156
|
+
var _this10$getOrderCusto;
|
|
3282
3157
|
var customerId;
|
|
3283
|
-
return _regeneratorRuntime().wrap(function
|
|
3284
|
-
while (1) switch (
|
|
3158
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
|
3159
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
3285
3160
|
case 0:
|
|
3286
3161
|
beforeScanCommit();
|
|
3287
|
-
customerId = Number(((
|
|
3162
|
+
customerId = Number(((_this10$getOrderCusto = _this10.getOrderCustomer()) === null || _this10$getOrderCusto === void 0 ? void 0 : _this10$getOrderCusto.customer_id) || 0);
|
|
3288
3163
|
if (!(customerId <= 1)) {
|
|
3289
|
-
|
|
3164
|
+
_context39.next = 4;
|
|
3290
3165
|
break;
|
|
3291
3166
|
}
|
|
3292
|
-
return
|
|
3167
|
+
return _context39.abrupt("return", []);
|
|
3293
3168
|
case 4:
|
|
3294
|
-
|
|
3295
|
-
return
|
|
3169
|
+
_context39.next = 6;
|
|
3170
|
+
return _this10.refreshDiscountConfigAfterOrderCustomerChange(customerId);
|
|
3296
3171
|
case 6:
|
|
3297
3172
|
beforeScanCommit();
|
|
3298
|
-
return
|
|
3173
|
+
return _context39.abrupt("return", _this10.getDiscountList());
|
|
3299
3174
|
case 8:
|
|
3300
3175
|
case "end":
|
|
3301
|
-
return
|
|
3176
|
+
return _context39.stop();
|
|
3302
3177
|
}
|
|
3303
|
-
},
|
|
3178
|
+
}, _callee39);
|
|
3304
3179
|
}));
|
|
3305
3180
|
function loadCustomerDiscounts() {
|
|
3306
3181
|
return _loadCustomerDiscounts.apply(this, arguments);
|
|
@@ -3309,49 +3184,49 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3309
3184
|
}()
|
|
3310
3185
|
}), formatted, guardedBridge);
|
|
3311
3186
|
case 29:
|
|
3312
|
-
|
|
3313
|
-
|
|
3187
|
+
_context40.t0 = _context40.sent;
|
|
3188
|
+
_context40.next = 35;
|
|
3314
3189
|
break;
|
|
3315
3190
|
case 32:
|
|
3316
|
-
|
|
3191
|
+
_context40.next = 34;
|
|
3317
3192
|
return applyGlobalScan(host, formatted, guardedBridge);
|
|
3318
3193
|
case 34:
|
|
3319
|
-
|
|
3194
|
+
_context40.t0 = _context40.sent;
|
|
3320
3195
|
case 35:
|
|
3321
|
-
_result8 =
|
|
3196
|
+
_result8 = _context40.t0;
|
|
3322
3197
|
bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
|
|
3323
|
-
return
|
|
3198
|
+
return _context40.abrupt("return", _result8);
|
|
3324
3199
|
case 40:
|
|
3325
|
-
|
|
3326
|
-
|
|
3200
|
+
_context40.prev = 40;
|
|
3201
|
+
_context40.t1 = _context40["catch"](4);
|
|
3327
3202
|
if (!((bridge === null || bridge === void 0 ? void 0 : bridge.scanScope) === 'product-voucher-collection')) {
|
|
3328
|
-
|
|
3203
|
+
_context40.next = 46;
|
|
3329
3204
|
break;
|
|
3330
3205
|
}
|
|
3331
3206
|
if (!(((_bridge$isCurrent = bridge.isCurrent) === null || _bridge$isCurrent === void 0 ? void 0 : _bridge$isCurrent.call(bridge)) === false)) {
|
|
3332
|
-
|
|
3207
|
+
_context40.next = 45;
|
|
3333
3208
|
break;
|
|
3334
3209
|
}
|
|
3335
|
-
return
|
|
3210
|
+
return _context40.abrupt("return", {
|
|
3336
3211
|
status: 'cancelled'
|
|
3337
3212
|
});
|
|
3338
3213
|
case 45:
|
|
3339
|
-
return
|
|
3214
|
+
return _context40.abrupt("return", {
|
|
3340
3215
|
status: 'failed',
|
|
3341
3216
|
reason: 'entry_resolution_failed'
|
|
3342
3217
|
});
|
|
3343
3218
|
case 46:
|
|
3344
|
-
console.error('[BookingTicket] handleGlobalScanCode failed',
|
|
3219
|
+
console.error('[BookingTicket] handleGlobalScanCode failed', _context40.t1);
|
|
3345
3220
|
bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
3346
|
-
return
|
|
3221
|
+
return _context40.abrupt("return", {
|
|
3347
3222
|
status: 'failed',
|
|
3348
3223
|
reason: 'not_found'
|
|
3349
3224
|
});
|
|
3350
3225
|
case 49:
|
|
3351
3226
|
case "end":
|
|
3352
|
-
return
|
|
3227
|
+
return _context40.stop();
|
|
3353
3228
|
}
|
|
3354
|
-
},
|
|
3229
|
+
}, _callee40, this, [[4, 40]]);
|
|
3355
3230
|
}));
|
|
3356
3231
|
function handleGlobalScanCode(_x23, _x24) {
|
|
3357
3232
|
return _handleGlobalScanCode.apply(this, arguments);
|
|
@@ -3361,37 +3236,37 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3361
3236
|
}, {
|
|
3362
3237
|
key: "getGlobalScanCodeType",
|
|
3363
3238
|
value: (function () {
|
|
3364
|
-
var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3365
|
-
var
|
|
3239
|
+
var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(code) {
|
|
3240
|
+
var _this11 = this,
|
|
3366
3241
|
_formatGlobalScanResu,
|
|
3367
3242
|
_formatGlobalScanResu2;
|
|
3368
3243
|
var trimmed, scan, raw;
|
|
3369
|
-
return _regeneratorRuntime().wrap(function
|
|
3370
|
-
while (1) switch (
|
|
3244
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
|
3245
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
3371
3246
|
case 0:
|
|
3372
3247
|
trimmed = typeof code === 'string' ? code.trim() : '';
|
|
3373
3248
|
if (trimmed) {
|
|
3374
|
-
|
|
3249
|
+
_context41.next = 3;
|
|
3375
3250
|
break;
|
|
3376
3251
|
}
|
|
3377
|
-
return
|
|
3252
|
+
return _context41.abrupt("return", null);
|
|
3378
3253
|
case 3:
|
|
3379
3254
|
scan = handleGlobalScan(this.request, function (value) {
|
|
3380
|
-
return
|
|
3255
|
+
return _this11.store.products.findProductsByCodeOrBarcode(value);
|
|
3381
3256
|
}, this.getSubmitOrderSalesChannel());
|
|
3382
|
-
|
|
3257
|
+
_context41.next = 6;
|
|
3383
3258
|
return scan({
|
|
3384
3259
|
type: 'nativeScanner',
|
|
3385
3260
|
value: trimmed
|
|
3386
3261
|
});
|
|
3387
3262
|
case 6:
|
|
3388
|
-
raw =
|
|
3389
|
-
return
|
|
3263
|
+
raw = _context41.sent;
|
|
3264
|
+
return _context41.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
|
|
3390
3265
|
case 8:
|
|
3391
3266
|
case "end":
|
|
3392
|
-
return
|
|
3267
|
+
return _context41.stop();
|
|
3393
3268
|
}
|
|
3394
|
-
},
|
|
3269
|
+
}, _callee41, this);
|
|
3395
3270
|
}));
|
|
3396
3271
|
function getGlobalScanCodeType(_x25) {
|
|
3397
3272
|
return _getGlobalScanCodeType.apply(this, arguments);
|
|
@@ -3413,7 +3288,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3413
3288
|
}, {
|
|
3414
3289
|
key: "buildAddTimeOrderLine",
|
|
3415
3290
|
value: function buildAddTimeOrderLine(input, bookingUid) {
|
|
3416
|
-
var _input$num, _product$id, _product$product_id,
|
|
3291
|
+
var _input$num, _product$id, _product$product_id, _ref15, _product$product_vari, _ref16, _product$variant_id, _product$original_pri, _ref17, _ref18, _product$option, _product$product_sku, _ref19, _ref20, _product$bundle, _product$id2;
|
|
3417
3292
|
var product = input === null || input === void 0 ? void 0 : input.product;
|
|
3418
3293
|
if (!product || _typeof(product) !== 'object') {
|
|
3419
3294
|
throw new Error('[BookingTicket] addAddTimeProductToBooking: product 不能为空');
|
|
@@ -3424,8 +3299,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3424
3299
|
var payload = {
|
|
3425
3300
|
id: (_product$id = product.id) !== null && _product$id !== void 0 ? _product$id : product.product_id,
|
|
3426
3301
|
product_id: (_product$product_id = product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product.id,
|
|
3427
|
-
product_variant_id: (
|
|
3428
|
-
variant_id: (
|
|
3302
|
+
product_variant_id: (_ref15 = (_product$product_vari = product.product_variant_id) !== null && _product$product_vari !== void 0 ? _product$product_vari : product.variant_id) !== null && _ref15 !== void 0 ? _ref15 : 0,
|
|
3303
|
+
variant_id: (_ref16 = (_product$variant_id = product.variant_id) !== null && _product$variant_id !== void 0 ? _product$variant_id : product.product_variant_id) !== null && _ref16 !== void 0 ? _ref16 : 0,
|
|
3429
3304
|
quantity: quantity,
|
|
3430
3305
|
num: quantity,
|
|
3431
3306
|
price: price,
|
|
@@ -3434,8 +3309,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3434
3309
|
line_total: price,
|
|
3435
3310
|
total: price,
|
|
3436
3311
|
product_sku: product.product_sku,
|
|
3437
|
-
option: (
|
|
3438
|
-
bundle: (
|
|
3312
|
+
option: (_ref17 = (_ref18 = (_product$option = product.option) !== null && _product$option !== void 0 ? _product$option : product.options) !== null && _ref18 !== void 0 ? _ref18 : (_product$product_sku = product.product_sku) === null || _product$product_sku === void 0 ? void 0 : _product$product_sku.option) !== null && _ref17 !== void 0 ? _ref17 : [],
|
|
3313
|
+
bundle: (_ref19 = (_ref20 = (_product$bundle = product.bundle) !== null && _product$bundle !== void 0 ? _product$bundle : product.bundles) !== null && _ref20 !== void 0 ? _ref20 : product.product_bundle) !== null && _ref19 !== void 0 ? _ref19 : []
|
|
3439
3314
|
};
|
|
3440
3315
|
var orderLine = this.transformBaseProductToOrderProduct({
|
|
3441
3316
|
payload: payload,
|
|
@@ -3475,11 +3350,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3475
3350
|
}, {
|
|
3476
3351
|
key: "addAddTimeProductToBooking",
|
|
3477
3352
|
value: (function () {
|
|
3478
|
-
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3479
|
-
return _regeneratorRuntime().wrap(function
|
|
3480
|
-
while (1) switch (
|
|
3353
|
+
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(input) {
|
|
3354
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context42) {
|
|
3355
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
3481
3356
|
case 0:
|
|
3482
|
-
return
|
|
3357
|
+
return _context42.abrupt("return", this.addAddTimeProductsToBooking({
|
|
3483
3358
|
booking: input.booking,
|
|
3484
3359
|
products: [input],
|
|
3485
3360
|
coveredMinutes: input.coveredMinutes,
|
|
@@ -3487,9 +3362,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3487
3362
|
}));
|
|
3488
3363
|
case 1:
|
|
3489
3364
|
case "end":
|
|
3490
|
-
return
|
|
3365
|
+
return _context42.stop();
|
|
3491
3366
|
}
|
|
3492
|
-
},
|
|
3367
|
+
}, _callee42, this);
|
|
3493
3368
|
}));
|
|
3494
3369
|
function addAddTimeProductToBooking(_x26) {
|
|
3495
3370
|
return _addAddTimeProductToBooking.apply(this, arguments);
|
|
@@ -3509,27 +3384,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3509
3384
|
}, {
|
|
3510
3385
|
key: "addAddTimeProductsToBooking",
|
|
3511
3386
|
value: (function () {
|
|
3512
|
-
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3513
|
-
var
|
|
3387
|
+
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(input) {
|
|
3388
|
+
var _this12 = this,
|
|
3514
3389
|
_input$bookingPatch;
|
|
3515
3390
|
var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
|
|
3516
|
-
return _regeneratorRuntime().wrap(function
|
|
3517
|
-
while (1) switch (
|
|
3391
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
|
3392
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
3518
3393
|
case 0:
|
|
3519
3394
|
bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
|
|
3520
3395
|
if (bookingUid) {
|
|
3521
|
-
|
|
3396
|
+
_context43.next = 3;
|
|
3522
3397
|
break;
|
|
3523
3398
|
}
|
|
3524
3399
|
throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
|
|
3525
3400
|
case 3:
|
|
3526
3401
|
orderLines = (input.products || []).map(function (line) {
|
|
3527
3402
|
return {
|
|
3528
|
-
product:
|
|
3403
|
+
product: _this12.buildAddTimeOrderLine(line, bookingUid)
|
|
3529
3404
|
};
|
|
3530
3405
|
});
|
|
3531
3406
|
if (this.store.order) {
|
|
3532
|
-
|
|
3407
|
+
_context43.next = 6;
|
|
3533
3408
|
break;
|
|
3534
3409
|
}
|
|
3535
3410
|
throw new Error('order 模块未初始化');
|
|
@@ -3543,53 +3418,53 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3543
3418
|
});
|
|
3544
3419
|
}
|
|
3545
3420
|
if (!(typeof this.store.order.addProductsToOrder === 'function')) {
|
|
3546
|
-
|
|
3421
|
+
_context43.next = 11;
|
|
3547
3422
|
break;
|
|
3548
3423
|
}
|
|
3549
|
-
return
|
|
3424
|
+
return _context43.abrupt("return", this.store.order.addProductsToOrder(orderLines));
|
|
3550
3425
|
case 11:
|
|
3551
3426
|
result = [];
|
|
3552
3427
|
_iterator2 = _createForOfIteratorHelper(orderLines);
|
|
3553
|
-
|
|
3428
|
+
_context43.prev = 13;
|
|
3554
3429
|
_iterator2.s();
|
|
3555
3430
|
case 15:
|
|
3556
3431
|
if ((_step2 = _iterator2.n()).done) {
|
|
3557
|
-
|
|
3432
|
+
_context43.next = 29;
|
|
3558
3433
|
break;
|
|
3559
3434
|
}
|
|
3560
3435
|
line = _step2.value;
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3436
|
+
_context43.t0 = result.splice;
|
|
3437
|
+
_context43.t1 = result;
|
|
3438
|
+
_context43.t2 = [0, result.length];
|
|
3439
|
+
_context43.t3 = _toConsumableArray;
|
|
3440
|
+
_context43.next = 23;
|
|
3566
3441
|
return this.addProductToOrder(line.product);
|
|
3567
3442
|
case 23:
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3443
|
+
_context43.t4 = _context43.sent;
|
|
3444
|
+
_context43.t5 = (0, _context43.t3)(_context43.t4);
|
|
3445
|
+
_context43.t6 = _context43.t2.concat.call(_context43.t2, _context43.t5);
|
|
3446
|
+
_context43.t0.apply.call(_context43.t0, _context43.t1, _context43.t6);
|
|
3572
3447
|
case 27:
|
|
3573
|
-
|
|
3448
|
+
_context43.next = 15;
|
|
3574
3449
|
break;
|
|
3575
3450
|
case 29:
|
|
3576
|
-
|
|
3451
|
+
_context43.next = 34;
|
|
3577
3452
|
break;
|
|
3578
3453
|
case 31:
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
_iterator2.e(
|
|
3454
|
+
_context43.prev = 31;
|
|
3455
|
+
_context43.t7 = _context43["catch"](13);
|
|
3456
|
+
_iterator2.e(_context43.t7);
|
|
3582
3457
|
case 34:
|
|
3583
|
-
|
|
3458
|
+
_context43.prev = 34;
|
|
3584
3459
|
_iterator2.f();
|
|
3585
|
-
return
|
|
3460
|
+
return _context43.finish(34);
|
|
3586
3461
|
case 37:
|
|
3587
|
-
return
|
|
3462
|
+
return _context43.abrupt("return", result);
|
|
3588
3463
|
case 38:
|
|
3589
3464
|
case "end":
|
|
3590
|
-
return
|
|
3465
|
+
return _context43.stop();
|
|
3591
3466
|
}
|
|
3592
|
-
},
|
|
3467
|
+
}, _callee43, this, [[13, 31, 34, 37]]);
|
|
3593
3468
|
}));
|
|
3594
3469
|
function addAddTimeProductsToBooking(_x27) {
|
|
3595
3470
|
return _addAddTimeProductsToBooking.apply(this, arguments);
|
|
@@ -3599,47 +3474,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3599
3474
|
}, {
|
|
3600
3475
|
key: "setOtherParams",
|
|
3601
3476
|
value: function () {
|
|
3602
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3603
|
-
var
|
|
3604
|
-
var
|
|
3605
|
-
|
|
3477
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
|
|
3478
|
+
var _this13 = this;
|
|
3479
|
+
var _ref21,
|
|
3480
|
+
_ref21$cover,
|
|
3606
3481
|
cover,
|
|
3607
3482
|
nextParams,
|
|
3608
3483
|
invoiceContextChanged,
|
|
3609
|
-
|
|
3610
|
-
return _regeneratorRuntime().wrap(function
|
|
3611
|
-
while (1) switch (
|
|
3484
|
+
_args44 = arguments;
|
|
3485
|
+
return _regeneratorRuntime().wrap(function _callee44$(_context44) {
|
|
3486
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
3612
3487
|
case 0:
|
|
3613
|
-
|
|
3488
|
+
_ref21 = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {}, _ref21$cover = _ref21.cover, cover = _ref21$cover === void 0 ? false : _ref21$cover;
|
|
3614
3489
|
nextParams = cover ? params : _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
3615
3490
|
if (['businessCode', 'business_code', 'channel', 'platform', 'shop_id', 'tenantId', 'cacheId'].some(function (key) {
|
|
3616
|
-
var
|
|
3617
|
-
return (nextParams === null || nextParams === void 0 ? void 0 : nextParams[key]) !== ((
|
|
3491
|
+
var _this13$otherParams;
|
|
3492
|
+
return (nextParams === null || nextParams === void 0 ? void 0 : nextParams[key]) !== ((_this13$otherParams = _this13.otherParams) === null || _this13$otherParams === void 0 ? void 0 : _this13$otherParams[key]);
|
|
3618
3493
|
})) this.orderCustomerContactRequest = null;
|
|
3619
|
-
|
|
3494
|
+
_context44.next = 5;
|
|
3620
3495
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
|
|
3621
3496
|
cover: cover
|
|
3622
3497
|
});
|
|
3623
3498
|
case 5:
|
|
3624
3499
|
invoiceContextChanged = (params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined || (params === null || params === void 0 ? void 0 : params.channel) !== undefined || (params === null || params === void 0 ? void 0 : params.platform) !== undefined || Object.prototype.hasOwnProperty.call(params, 'openData');
|
|
3625
3500
|
if (!invoiceContextChanged) {
|
|
3626
|
-
|
|
3501
|
+
_context44.next = 9;
|
|
3627
3502
|
break;
|
|
3628
3503
|
}
|
|
3629
|
-
|
|
3504
|
+
_context44.next = 9;
|
|
3630
3505
|
return this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
|
|
3631
3506
|
case 9:
|
|
3632
3507
|
if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined || Object.prototype.hasOwnProperty.call(params !== null && params !== void 0 ? params : {}, 'openData'))) {
|
|
3633
|
-
|
|
3508
|
+
_context44.next = 12;
|
|
3634
3509
|
break;
|
|
3635
3510
|
}
|
|
3636
|
-
|
|
3511
|
+
_context44.next = 12;
|
|
3637
3512
|
return this.configureIdGeneratorFromOpenData();
|
|
3638
3513
|
case 12:
|
|
3639
3514
|
case "end":
|
|
3640
|
-
return
|
|
3515
|
+
return _context44.stop();
|
|
3641
3516
|
}
|
|
3642
|
-
},
|
|
3517
|
+
}, _callee44, this);
|
|
3643
3518
|
}));
|
|
3644
3519
|
function setOtherParams(_x28) {
|
|
3645
3520
|
return _setOtherParams.apply(this, arguments);
|
|
@@ -3658,15 +3533,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3658
3533
|
}, {
|
|
3659
3534
|
key: "handlePrintWristband",
|
|
3660
3535
|
value: function () {
|
|
3661
|
-
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3536
|
+
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
|
|
3662
3537
|
var _this$getOrderIdentit2;
|
|
3663
3538
|
var deviceTask, deviceId, idempotencyKey;
|
|
3664
|
-
return _regeneratorRuntime().wrap(function
|
|
3665
|
-
while (1) switch (
|
|
3539
|
+
return _regeneratorRuntime().wrap(function _callee45$(_context45) {
|
|
3540
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
3666
3541
|
case 0:
|
|
3667
3542
|
deviceTask = this.getDeviceTaskPlugin();
|
|
3668
3543
|
if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
|
|
3669
|
-
|
|
3544
|
+
_context45.next = 4;
|
|
3670
3545
|
break;
|
|
3671
3546
|
}
|
|
3672
3547
|
this.logger.addLog({
|
|
@@ -3676,7 +3551,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3676
3551
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
3677
3552
|
}
|
|
3678
3553
|
});
|
|
3679
|
-
return
|
|
3554
|
+
return _context45.abrupt("return");
|
|
3680
3555
|
case 4:
|
|
3681
3556
|
this.logger.addLog({
|
|
3682
3557
|
type: 'info',
|
|
@@ -3685,10 +3560,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3685
3560
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
3686
3561
|
}
|
|
3687
3562
|
});
|
|
3688
|
-
|
|
3563
|
+
_context45.next = 7;
|
|
3689
3564
|
return this.getShortNumberOrDeviceId();
|
|
3690
3565
|
case 7:
|
|
3691
|
-
deviceId =
|
|
3566
|
+
deviceId = _context45.sent;
|
|
3692
3567
|
idempotencyKey = createUuidV4();
|
|
3693
3568
|
deviceTask.dispatch({
|
|
3694
3569
|
action: 'print_all',
|
|
@@ -3708,9 +3583,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3708
3583
|
});
|
|
3709
3584
|
case 10:
|
|
3710
3585
|
case "end":
|
|
3711
|
-
return
|
|
3586
|
+
return _context45.stop();
|
|
3712
3587
|
}
|
|
3713
|
-
},
|
|
3588
|
+
}, _callee45, this);
|
|
3714
3589
|
}));
|
|
3715
3590
|
function handlePrintWristband(_x29) {
|
|
3716
3591
|
return _handlePrintWristband.apply(this, arguments);
|
|
@@ -3720,11 +3595,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3720
3595
|
}, {
|
|
3721
3596
|
key: "handleRedeem",
|
|
3722
3597
|
value: function () {
|
|
3723
|
-
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3724
|
-
var _this$store$order8, _this$store$order8$ge, _this$store$order9,
|
|
3598
|
+
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(params) {
|
|
3599
|
+
var _this$store$order8, _this$store$order8$ge, _this$store$order9, _ref22, _tempOrder$order_id2;
|
|
3725
3600
|
var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
|
|
3726
|
-
return _regeneratorRuntime().wrap(function
|
|
3727
|
-
while (1) switch (
|
|
3601
|
+
return _regeneratorRuntime().wrap(function _callee46$(_context46) {
|
|
3602
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
3728
3603
|
case 0:
|
|
3729
3604
|
voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
|
|
3730
3605
|
status = params.is_checkin ? 'used' : 'unused';
|
|
@@ -3748,10 +3623,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3748
3623
|
});
|
|
3749
3624
|
});
|
|
3750
3625
|
if (!(tempOrder && hasUpdatedVoucher)) {
|
|
3751
|
-
|
|
3626
|
+
_context46.next = 11;
|
|
3752
3627
|
break;
|
|
3753
3628
|
}
|
|
3754
|
-
|
|
3629
|
+
_context46.next = 11;
|
|
3755
3630
|
return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
|
|
3756
3631
|
vouchers: nextVouchers
|
|
3757
3632
|
}), {
|
|
@@ -3760,10 +3635,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3760
3635
|
case 11:
|
|
3761
3636
|
this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
|
|
3762
3637
|
if (!(voucherIds.length === 0)) {
|
|
3763
|
-
|
|
3638
|
+
_context46.next = 14;
|
|
3764
3639
|
break;
|
|
3765
3640
|
}
|
|
3766
|
-
return
|
|
3641
|
+
return _context46.abrupt("return", {
|
|
3767
3642
|
code: 200,
|
|
3768
3643
|
status: true,
|
|
3769
3644
|
message: '',
|
|
@@ -3772,9 +3647,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3772
3647
|
case 14:
|
|
3773
3648
|
identity = this.getOrderIdentity();
|
|
3774
3649
|
externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
|
|
3775
|
-
orderId = (
|
|
3650
|
+
orderId = (_ref22 = (_tempOrder$order_id2 = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) !== null && _tempOrder$order_id2 !== void 0 ? _tempOrder$order_id2 : identity === null || identity === void 0 ? void 0 : identity.orderId) !== null && _ref22 !== void 0 ? _ref22 : undefined;
|
|
3776
3651
|
orderLookup = externalSaleNumber || orderId || (identity === null || identity === void 0 ? void 0 : identity.orderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopOrderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopFullOrderNumber) || undefined;
|
|
3777
|
-
return
|
|
3652
|
+
return _context46.abrupt("return", this.request.post('/machinecode/batch', {
|
|
3778
3653
|
ids: voucherIds,
|
|
3779
3654
|
status: status,
|
|
3780
3655
|
order_lookup: orderLookup,
|
|
@@ -3785,9 +3660,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3785
3660
|
}));
|
|
3786
3661
|
case 19:
|
|
3787
3662
|
case "end":
|
|
3788
|
-
return
|
|
3663
|
+
return _context46.stop();
|
|
3789
3664
|
}
|
|
3790
|
-
},
|
|
3665
|
+
}, _callee46, this);
|
|
3791
3666
|
}));
|
|
3792
3667
|
function handleRedeem(_x30) {
|
|
3793
3668
|
return _handleRedeem.apply(this, arguments);
|
|
@@ -3801,13 +3676,13 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3801
3676
|
}, {
|
|
3802
3677
|
key: "destroy",
|
|
3803
3678
|
value: (function () {
|
|
3804
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3679
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47() {
|
|
3805
3680
|
var _this$scan;
|
|
3806
|
-
return _regeneratorRuntime().wrap(function
|
|
3807
|
-
while (1) switch (
|
|
3681
|
+
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
|
3682
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
3808
3683
|
case 0:
|
|
3809
3684
|
this.orderCustomerContactRequest = null;
|
|
3810
|
-
|
|
3685
|
+
_context47.next = 3;
|
|
3811
3686
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
|
|
3812
3687
|
case 3:
|
|
3813
3688
|
try {
|
|
@@ -3818,9 +3693,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3818
3693
|
scanCache.clear();
|
|
3819
3694
|
case 5:
|
|
3820
3695
|
case "end":
|
|
3821
|
-
return
|
|
3696
|
+
return _context47.stop();
|
|
3822
3697
|
}
|
|
3823
|
-
},
|
|
3698
|
+
}, _callee47, this);
|
|
3824
3699
|
}));
|
|
3825
3700
|
function destroy() {
|
|
3826
3701
|
return _destroy.apply(this, arguments);
|