@pisell/pisellos 0.10.8 → 0.10.10
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/core/index.js +0 -1
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +18 -2
- package/dist/model/strategy/adapter/dataVariant/evaluator.js +287 -101
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +25 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -2
- package/dist/model/strategy/adapter/walletPass/type.d.ts +5 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +57 -26
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +7 -3
- package/dist/modules/BookingContext/utils/productExtend.js +5 -9
- package/dist/modules/BookingContext/utils/timeSlices.js +24 -3
- package/dist/modules/Customer/index.d.ts +4 -0
- package/dist/modules/Customer/index.js +91 -59
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/index.d.ts +2 -0
- package/dist/modules/Discount/index.js +38 -5
- package/dist/modules/Discount/types.d.ts +11 -0
- package/dist/modules/OpenData/types.d.ts +1 -0
- package/dist/modules/Order/index.d.ts +20 -1
- package/dist/modules/Order/index.js +976 -730
- package/dist/modules/Order/types.d.ts +6 -1
- package/dist/modules/Order/utils/virtualSettlement.d.ts +56 -0
- package/dist/modules/Order/utils/virtualSettlement.js +271 -0
- package/dist/modules/Order/utils.js +89 -48
- package/dist/modules/Payment/types.d.ts +2 -0
- package/dist/modules/Payment/utils.js +4 -1
- package/dist/modules/Payment/walletpass.d.ts +11 -0
- package/dist/modules/Payment/walletpass.js +235 -60
- package/dist/modules/Product/types.d.ts +23 -0
- package/dist/modules/ProductList/index.d.ts +15 -2
- package/dist/modules/ProductList/index.js +92 -13
- package/dist/modules/ResourcePlanner/index.d.ts +0 -22
- package/dist/modules/ResourcePlanner/index.js +1 -180
- package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/dist/modules/ResourcePlanner/localClock.js +183 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +5 -14
- package/dist/modules/ResourcePlanner/planner.js +2019 -936
- package/dist/modules/ResourcePlanner/types.d.ts +346 -187
- package/dist/modules/ResourcePlanner/types.js +33 -1
- package/dist/modules/SalesSummary/index.d.ts +1 -0
- package/dist/modules/SalesSummary/index.js +4 -3
- package/dist/modules/SalesSummary/types.d.ts +1 -0
- package/dist/modules/SalesSummary/utils.d.ts +1 -0
- package/dist/modules/SalesSummary/utils.js +21 -1
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +90 -58
- package/dist/server/modules/order/index.d.ts +1 -0
- package/dist/server/modules/order/index.js +252 -94
- package/dist/server/utils/small-ticket.js +2 -1
- package/dist/solution/BaseSales/index.d.ts +26 -2
- package/dist/solution/BaseSales/index.js +1310 -931
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +78 -12
- package/dist/solution/BookingByStep/index.d.ts +4 -4
- package/dist/solution/BookingTicket/index.d.ts +5 -1
- package/dist/solution/BookingTicket/index.js +225 -161
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +5 -3
- package/dist/solution/ScanOrder/index.js +25 -64
- package/dist/solution/UnifiedBookingSales/index.d.ts +110 -73
- package/dist/solution/UnifiedBookingSales/index.js +3349 -971
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +430 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +133 -76
- package/dist/solution/UnifiedBookingSales/types.js +4 -9
- package/lib/core/index.js +0 -1
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +18 -2
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +170 -7
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +25 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -2
- package/lib/model/strategy/adapter/walletPass/type.d.ts +5 -0
- package/lib/model/strategy/adapter/walletPass/utils.js +62 -11
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -0
- package/lib/modules/BookingContext/utils/productExtend.js +4 -3
- package/lib/modules/BookingContext/utils/timeSlices.js +18 -3
- package/lib/modules/Customer/index.d.ts +4 -0
- package/lib/modules/Customer/index.js +11 -0
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/index.d.ts +2 -0
- package/lib/modules/Discount/index.js +37 -3
- package/lib/modules/Discount/types.d.ts +11 -0
- package/lib/modules/OpenData/types.d.ts +1 -0
- package/lib/modules/Order/index.d.ts +20 -1
- package/lib/modules/Order/index.js +393 -128
- package/lib/modules/Order/types.d.ts +6 -1
- package/lib/modules/Order/utils/virtualSettlement.d.ts +56 -0
- package/lib/modules/Order/utils/virtualSettlement.js +300 -0
- package/lib/modules/Order/utils.js +65 -21
- package/lib/modules/Payment/types.d.ts +2 -0
- package/lib/modules/Payment/utils.js +5 -1
- package/lib/modules/Payment/walletpass.d.ts +11 -0
- package/lib/modules/Payment/walletpass.js +198 -17
- package/lib/modules/Product/types.d.ts +23 -0
- package/lib/modules/ProductList/index.d.ts +15 -2
- package/lib/modules/ProductList/index.js +85 -3
- package/lib/modules/ResourcePlanner/index.d.ts +0 -22
- package/lib/modules/ResourcePlanner/index.js +0 -123
- package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/lib/modules/ResourcePlanner/localClock.js +270 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +5 -14
- package/lib/modules/ResourcePlanner/planner.js +1903 -798
- package/lib/modules/ResourcePlanner/types.d.ts +346 -187
- package/lib/modules/ResourcePlanner/types.js +19 -0
- package/lib/modules/SalesSummary/index.d.ts +1 -0
- package/lib/modules/SalesSummary/index.js +10 -2
- package/lib/modules/SalesSummary/types.d.ts +1 -0
- package/lib/modules/SalesSummary/utils.d.ts +1 -0
- package/lib/modules/SalesSummary/utils.js +25 -1
- package/lib/server/index.d.ts +9 -0
- package/lib/server/index.js +54 -14
- package/lib/server/modules/order/index.d.ts +1 -0
- package/lib/server/modules/order/index.js +66 -2
- package/lib/server/utils/small-ticket.js +1 -1
- package/lib/solution/BaseSales/index.d.ts +26 -2
- package/lib/solution/BaseSales/index.js +261 -23
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +61 -11
- package/lib/solution/BookingByStep/index.d.ts +4 -4
- package/lib/solution/BookingTicket/index.d.ts +5 -1
- package/lib/solution/BookingTicket/index.js +32 -3
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -1
- package/lib/solution/ScanOrder/index.js +17 -54
- package/lib/solution/UnifiedBookingSales/index.d.ts +110 -73
- package/lib/solution/UnifiedBookingSales/index.js +2289 -374
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +376 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +133 -76
- package/lib/solution/UnifiedBookingSales/types.js +3 -2
- package/package.json +1 -1
|
@@ -691,11 +691,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
691
691
|
return null;
|
|
692
692
|
}
|
|
693
693
|
}, {
|
|
694
|
-
key: "
|
|
694
|
+
key: "resolveCustomerById",
|
|
695
695
|
value: function () {
|
|
696
|
-
var
|
|
696
|
+
var _resolveCustomerById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(customerId) {
|
|
697
697
|
var _result$list;
|
|
698
|
-
var localCustomers, localCustomer, normalizedLocalCustomer, result, remoteCustomer;
|
|
698
|
+
var localCustomers, localCustomer, normalizedLocalCustomer, result, remoteCustomer, detailCustomer;
|
|
699
699
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
700
700
|
while (1) switch (_context9.prev = _context9.next) {
|
|
701
701
|
case 0:
|
|
@@ -717,18 +717,42 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
717
717
|
case 7:
|
|
718
718
|
result = _context9.sent;
|
|
719
719
|
remoteCustomer = this.findCustomerById((result === null || result === void 0 ? void 0 : result.list) || [], customerId) || (result === null || result === void 0 || (_result$list = result.list) === null || _result$list === void 0 ? void 0 : _result$list[0]) || null;
|
|
720
|
-
|
|
721
|
-
|
|
720
|
+
if (!remoteCustomer) {
|
|
721
|
+
_context9.next = 11;
|
|
722
|
+
break;
|
|
723
|
+
}
|
|
724
|
+
return _context9.abrupt("return", this.normalizeCustomer(remoteCustomer));
|
|
725
|
+
case 11:
|
|
726
|
+
_context9.prev = 11;
|
|
727
|
+
_context9.next = 14;
|
|
728
|
+
return this.store.customer.queryCustomerDetail(customerId);
|
|
729
|
+
case 14:
|
|
730
|
+
detailCustomer = _context9.sent;
|
|
731
|
+
return _context9.abrupt("return", detailCustomer ? this.normalizeCustomer(detailCustomer) : null);
|
|
732
|
+
case 18:
|
|
733
|
+
_context9.prev = 18;
|
|
734
|
+
_context9.t0 = _context9["catch"](11);
|
|
735
|
+
console.warn('[BookingTicket] resolveCustomerById detail request failed', {
|
|
736
|
+
customerId: customerId,
|
|
737
|
+
error: _context9.t0
|
|
738
|
+
});
|
|
739
|
+
return _context9.abrupt("return", null);
|
|
740
|
+
case 22:
|
|
722
741
|
case "end":
|
|
723
742
|
return _context9.stop();
|
|
724
743
|
}
|
|
725
|
-
}, _callee9, this);
|
|
744
|
+
}, _callee9, this, [[11, 18]]);
|
|
726
745
|
}));
|
|
727
|
-
function
|
|
728
|
-
return
|
|
746
|
+
function resolveCustomerById(_x6) {
|
|
747
|
+
return _resolveCustomerById.apply(this, arguments);
|
|
729
748
|
}
|
|
730
|
-
return
|
|
731
|
-
}()
|
|
749
|
+
return resolveCustomerById;
|
|
750
|
+
}() /** 兼容既有优惠码扫码逻辑。 */
|
|
751
|
+
}, {
|
|
752
|
+
key: "resolveCustomerByDiscountCustomerId",
|
|
753
|
+
value: function resolveCustomerByDiscountCustomerId(customerId) {
|
|
754
|
+
return this.resolveCustomerById(customerId);
|
|
755
|
+
}
|
|
732
756
|
}, {
|
|
733
757
|
key: "findCustomerById",
|
|
734
758
|
value: function findCustomerById() {
|
|
@@ -1739,6 +1763,44 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1739
1763
|
value: function waitForOrderCustomerPromotionRefresh() {
|
|
1740
1764
|
return this.orderCustomerPromotionRefreshInFlight || Promise.resolve();
|
|
1741
1765
|
}
|
|
1766
|
+
}, {
|
|
1767
|
+
key: "prepareProductPriceQueryContext",
|
|
1768
|
+
value: function () {
|
|
1769
|
+
var _prepareProductPriceQueryContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(customerId) {
|
|
1770
|
+
var normalizedCustomerId, refreshTask, shouldWait;
|
|
1771
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
1772
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1773
|
+
case 0:
|
|
1774
|
+
_context23.next = 2;
|
|
1775
|
+
return Promise.resolve();
|
|
1776
|
+
case 2:
|
|
1777
|
+
normalizedCustomerId = Number(customerId || 0);
|
|
1778
|
+
refreshTask = this.orderCustomerDiscountRefreshInFlight;
|
|
1779
|
+
shouldWait = normalizedCustomerId > 1 && this.orderCustomerDiscountRefreshCustomerId === normalizedCustomerId && Boolean(refreshTask);
|
|
1780
|
+
if (!(shouldWait && refreshTask)) {
|
|
1781
|
+
_context23.next = 8;
|
|
1782
|
+
break;
|
|
1783
|
+
}
|
|
1784
|
+
_context23.next = 8;
|
|
1785
|
+
return refreshTask;
|
|
1786
|
+
case 8:
|
|
1787
|
+
case "end":
|
|
1788
|
+
return _context23.stop();
|
|
1789
|
+
}
|
|
1790
|
+
}, _callee23, this);
|
|
1791
|
+
}));
|
|
1792
|
+
function prepareProductPriceQueryContext(_x16) {
|
|
1793
|
+
return _prepareProductPriceQueryContext.apply(this, arguments);
|
|
1794
|
+
}
|
|
1795
|
+
return prepareProductPriceQueryContext;
|
|
1796
|
+
}()
|
|
1797
|
+
}, {
|
|
1798
|
+
key: "preferAuthoritativeProductQueryPrice",
|
|
1799
|
+
value: function preferAuthoritativeProductQueryPrice() {
|
|
1800
|
+
// BookingTicket 的 /product/query 已按预约时间、客户及 Wallet 上下文执行
|
|
1801
|
+
// 智能定价;再次应用 legacy quotation 会把最终价覆盖成另一套时段价格。
|
|
1802
|
+
return true;
|
|
1803
|
+
}
|
|
1742
1804
|
|
|
1743
1805
|
/**
|
|
1744
1806
|
* 获取客户分页信息
|
|
@@ -1780,29 +1842,29 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1780
1842
|
}, {
|
|
1781
1843
|
key: "changeCustomerPage",
|
|
1782
1844
|
value: (function () {
|
|
1783
|
-
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1845
|
+
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(page, pageSize) {
|
|
1784
1846
|
var _result4;
|
|
1785
|
-
return _regeneratorRuntime().wrap(function
|
|
1786
|
-
while (1) switch (
|
|
1847
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
1848
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1787
1849
|
case 0:
|
|
1788
|
-
|
|
1789
|
-
|
|
1850
|
+
_context24.prev = 0;
|
|
1851
|
+
_context24.next = 3;
|
|
1790
1852
|
return this.store.customer.changeCustomerPage(page, pageSize);
|
|
1791
1853
|
case 3:
|
|
1792
|
-
_result4 =
|
|
1793
|
-
return
|
|
1854
|
+
_result4 = _context24.sent;
|
|
1855
|
+
return _context24.abrupt("return", _result4);
|
|
1794
1856
|
case 7:
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
console.error('Failed to change customer page:',
|
|
1798
|
-
throw
|
|
1857
|
+
_context24.prev = 7;
|
|
1858
|
+
_context24.t0 = _context24["catch"](0);
|
|
1859
|
+
console.error('Failed to change customer page:', _context24.t0);
|
|
1860
|
+
throw _context24.t0;
|
|
1799
1861
|
case 11:
|
|
1800
1862
|
case "end":
|
|
1801
|
-
return
|
|
1863
|
+
return _context24.stop();
|
|
1802
1864
|
}
|
|
1803
|
-
},
|
|
1865
|
+
}, _callee24, this, [[0, 7]]);
|
|
1804
1866
|
}));
|
|
1805
|
-
function changeCustomerPage(
|
|
1867
|
+
function changeCustomerPage(_x17, _x18) {
|
|
1806
1868
|
return _changeCustomerPage.apply(this, arguments);
|
|
1807
1869
|
}
|
|
1808
1870
|
return changeCustomerPage;
|
|
@@ -1815,28 +1877,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1815
1877
|
}, {
|
|
1816
1878
|
key: "loadMoreCustomers",
|
|
1817
1879
|
value: (function () {
|
|
1818
|
-
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1880
|
+
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
1819
1881
|
var _result5;
|
|
1820
|
-
return _regeneratorRuntime().wrap(function
|
|
1821
|
-
while (1) switch (
|
|
1882
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1883
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1822
1884
|
case 0:
|
|
1823
|
-
|
|
1824
|
-
|
|
1885
|
+
_context25.prev = 0;
|
|
1886
|
+
_context25.next = 3;
|
|
1825
1887
|
return this.store.customer.loadMoreCustomers();
|
|
1826
1888
|
case 3:
|
|
1827
|
-
_result5 =
|
|
1889
|
+
_result5 = _context25.sent;
|
|
1828
1890
|
this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result5);
|
|
1829
|
-
return
|
|
1891
|
+
return _context25.abrupt("return", _result5);
|
|
1830
1892
|
case 8:
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
console.error('Failed to load more customers:',
|
|
1834
|
-
throw
|
|
1893
|
+
_context25.prev = 8;
|
|
1894
|
+
_context25.t0 = _context25["catch"](0);
|
|
1895
|
+
console.error('Failed to load more customers:', _context25.t0);
|
|
1896
|
+
throw _context25.t0;
|
|
1835
1897
|
case 12:
|
|
1836
1898
|
case "end":
|
|
1837
|
-
return
|
|
1899
|
+
return _context25.stop();
|
|
1838
1900
|
}
|
|
1839
|
-
},
|
|
1901
|
+
}, _callee25, this, [[0, 8]]);
|
|
1840
1902
|
}));
|
|
1841
1903
|
function loadMoreCustomers() {
|
|
1842
1904
|
return _loadMoreCustomers.apply(this, arguments);
|
|
@@ -1852,31 +1914,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1852
1914
|
}, {
|
|
1853
1915
|
key: "resetAndLoadCustomers",
|
|
1854
1916
|
value: (function () {
|
|
1855
|
-
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1917
|
+
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
1856
1918
|
var params,
|
|
1857
1919
|
_result6,
|
|
1858
|
-
|
|
1859
|
-
return _regeneratorRuntime().wrap(function
|
|
1860
|
-
while (1) switch (
|
|
1920
|
+
_args26 = arguments;
|
|
1921
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
1922
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1861
1923
|
case 0:
|
|
1862
|
-
params =
|
|
1863
|
-
|
|
1864
|
-
|
|
1924
|
+
params = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
|
|
1925
|
+
_context26.prev = 1;
|
|
1926
|
+
_context26.next = 4;
|
|
1865
1927
|
return this.store.customer.resetAndLoadCustomers(params);
|
|
1866
1928
|
case 4:
|
|
1867
|
-
_result6 =
|
|
1929
|
+
_result6 = _context26.sent;
|
|
1868
1930
|
this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result6);
|
|
1869
|
-
return
|
|
1931
|
+
return _context26.abrupt("return", _result6);
|
|
1870
1932
|
case 9:
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
console.error('Failed to reset and load customers:',
|
|
1874
|
-
throw
|
|
1933
|
+
_context26.prev = 9;
|
|
1934
|
+
_context26.t0 = _context26["catch"](1);
|
|
1935
|
+
console.error('Failed to reset and load customers:', _context26.t0);
|
|
1936
|
+
throw _context26.t0;
|
|
1875
1937
|
case 13:
|
|
1876
1938
|
case "end":
|
|
1877
|
-
return
|
|
1939
|
+
return _context26.stop();
|
|
1878
1940
|
}
|
|
1879
|
-
},
|
|
1941
|
+
}, _callee26, this, [[1, 9]]);
|
|
1880
1942
|
}));
|
|
1881
1943
|
function resetAndLoadCustomers() {
|
|
1882
1944
|
return _resetAndLoadCustomers.apply(this, arguments);
|
|
@@ -2037,16 +2099,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2037
2099
|
}, {
|
|
2038
2100
|
key: "getOtherParams",
|
|
2039
2101
|
value: (function () {
|
|
2040
|
-
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2041
|
-
return _regeneratorRuntime().wrap(function
|
|
2042
|
-
while (1) switch (
|
|
2102
|
+
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
|
|
2103
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2104
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2043
2105
|
case 0:
|
|
2044
|
-
return
|
|
2106
|
+
return _context27.abrupt("return", this.otherParams);
|
|
2045
2107
|
case 1:
|
|
2046
2108
|
case "end":
|
|
2047
|
-
return
|
|
2109
|
+
return _context27.stop();
|
|
2048
2110
|
}
|
|
2049
|
-
},
|
|
2111
|
+
}, _callee27, this);
|
|
2050
2112
|
}));
|
|
2051
2113
|
function getOtherParams() {
|
|
2052
2114
|
return _getOtherParams.apply(this, arguments);
|
|
@@ -2260,14 +2322,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2260
2322
|
var bookingContextState = this.store.bookingContext.getState();
|
|
2261
2323
|
var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
|
|
2262
2324
|
var orderCustomerId = (_ref12 = (_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$get4 = this.store.order.getTempOrder()) === null || _this$store$order$get4 === void 0 ? void 0 : _this$store$order$get4.customer_id) !== null && _ref12 !== void 0 ? _ref12 : undefined;
|
|
2263
|
-
return _objectSpread({
|
|
2325
|
+
return _objectSpread(_objectSpread({
|
|
2264
2326
|
bookingConfig: bookingContextState.bookingConfig,
|
|
2265
2327
|
resourcesOrigin: bookingContextState.resourcesOrigin,
|
|
2266
2328
|
resourcesOriginMap: bookingContextState.resourcesOriginMap,
|
|
2267
2329
|
date: date,
|
|
2268
2330
|
presetStartTime: (_extra$presetStartTim2 = extra === null || extra === void 0 ? void 0 : extra.presetStartTime) !== null && _extra$presetStartTim2 !== void 0 ? _extra$presetStartTim2 : derivePresetStartTimeFromDate(date),
|
|
2269
2331
|
customerId: orderCustomerId
|
|
2270
|
-
}, extra || {})
|
|
2332
|
+
}, extra || {}), {}, {
|
|
2333
|
+
channel: this.getSubmitOrderSalesChannel()
|
|
2334
|
+
});
|
|
2271
2335
|
}
|
|
2272
2336
|
|
|
2273
2337
|
/**
|
|
@@ -2365,18 +2429,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2365
2429
|
}, {
|
|
2366
2430
|
key: "updateProductInOrder",
|
|
2367
2431
|
value: (function () {
|
|
2368
|
-
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2369
|
-
return _regeneratorRuntime().wrap(function
|
|
2370
|
-
while (1) switch (
|
|
2432
|
+
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
|
|
2433
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2434
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2371
2435
|
case 0:
|
|
2372
|
-
return
|
|
2436
|
+
return _context28.abrupt("return", this.updateOrderProduct(params));
|
|
2373
2437
|
case 1:
|
|
2374
2438
|
case "end":
|
|
2375
|
-
return
|
|
2439
|
+
return _context28.stop();
|
|
2376
2440
|
}
|
|
2377
|
-
},
|
|
2441
|
+
}, _callee28, this);
|
|
2378
2442
|
}));
|
|
2379
|
-
function updateProductInOrder(
|
|
2443
|
+
function updateProductInOrder(_x19) {
|
|
2380
2444
|
return _updateProductInOrder.apply(this, arguments);
|
|
2381
2445
|
}
|
|
2382
2446
|
return updateProductInOrder;
|
|
@@ -2398,47 +2462,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2398
2462
|
}, {
|
|
2399
2463
|
key: "handleGlobalScanCode",
|
|
2400
2464
|
value: (function () {
|
|
2401
|
-
var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2465
|
+
var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(code, bridge) {
|
|
2402
2466
|
var _this7 = this;
|
|
2403
2467
|
var trimmed, _bridge$onNotify, _bridge$refresh, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
|
|
2404
|
-
return _regeneratorRuntime().wrap(function
|
|
2405
|
-
while (1) switch (
|
|
2468
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2469
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2406
2470
|
case 0:
|
|
2407
2471
|
trimmed = typeof code === 'string' ? code.trim() : '';
|
|
2408
2472
|
if (trimmed) {
|
|
2409
|
-
|
|
2473
|
+
_context29.next = 4;
|
|
2410
2474
|
break;
|
|
2411
2475
|
}
|
|
2412
2476
|
bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
2413
|
-
return
|
|
2477
|
+
return _context29.abrupt("return", {
|
|
2414
2478
|
status: 'failed',
|
|
2415
2479
|
reason: 'empty_code'
|
|
2416
2480
|
});
|
|
2417
2481
|
case 4:
|
|
2418
|
-
|
|
2482
|
+
_context29.prev = 4;
|
|
2419
2483
|
localSearch = function localSearch(v) {
|
|
2420
2484
|
return _this7.store.products.findProductsByCodeOrBarcode(v);
|
|
2421
2485
|
};
|
|
2422
2486
|
scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
|
|
2423
|
-
|
|
2487
|
+
_context29.next = 9;
|
|
2424
2488
|
return scanCallback({
|
|
2425
2489
|
type: 'nativeScanner',
|
|
2426
2490
|
value: trimmed
|
|
2427
2491
|
});
|
|
2428
2492
|
case 9:
|
|
2429
|
-
raw =
|
|
2493
|
+
raw = _context29.sent;
|
|
2430
2494
|
formatted = formatGlobalScanResult(raw, trimmed);
|
|
2431
2495
|
if (formatted) {
|
|
2432
|
-
|
|
2496
|
+
_context29.next = 14;
|
|
2433
2497
|
break;
|
|
2434
2498
|
}
|
|
2435
2499
|
bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
2436
|
-
return
|
|
2500
|
+
return _context29.abrupt("return", {
|
|
2437
2501
|
status: 'failed',
|
|
2438
2502
|
reason: 'not_found'
|
|
2439
2503
|
});
|
|
2440
2504
|
case 14:
|
|
2441
|
-
|
|
2505
|
+
_context29.next = 16;
|
|
2442
2506
|
return applyGlobalScan({
|
|
2443
2507
|
setOrderCustomer: function setOrderCustomer(customer) {
|
|
2444
2508
|
return _this7.setOrderCustomer(customer);
|
|
@@ -2473,25 +2537,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2473
2537
|
}
|
|
2474
2538
|
}, formatted, bridge);
|
|
2475
2539
|
case 16:
|
|
2476
|
-
_result7 =
|
|
2540
|
+
_result7 = _context29.sent;
|
|
2477
2541
|
bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
|
|
2478
|
-
return
|
|
2542
|
+
return _context29.abrupt("return", _result7);
|
|
2479
2543
|
case 21:
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
console.error('[BookingTicket] handleGlobalScanCode failed',
|
|
2544
|
+
_context29.prev = 21;
|
|
2545
|
+
_context29.t0 = _context29["catch"](4);
|
|
2546
|
+
console.error('[BookingTicket] handleGlobalScanCode failed', _context29.t0);
|
|
2483
2547
|
bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
2484
|
-
return
|
|
2548
|
+
return _context29.abrupt("return", {
|
|
2485
2549
|
status: 'failed',
|
|
2486
2550
|
reason: 'not_found'
|
|
2487
2551
|
});
|
|
2488
2552
|
case 26:
|
|
2489
2553
|
case "end":
|
|
2490
|
-
return
|
|
2554
|
+
return _context29.stop();
|
|
2491
2555
|
}
|
|
2492
|
-
},
|
|
2556
|
+
}, _callee29, this, [[4, 21]]);
|
|
2493
2557
|
}));
|
|
2494
|
-
function handleGlobalScanCode(
|
|
2558
|
+
function handleGlobalScanCode(_x20, _x21) {
|
|
2495
2559
|
return _handleGlobalScanCode.apply(this, arguments);
|
|
2496
2560
|
}
|
|
2497
2561
|
return handleGlobalScanCode;
|
|
@@ -2573,11 +2637,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2573
2637
|
}, {
|
|
2574
2638
|
key: "addAddTimeProductToBooking",
|
|
2575
2639
|
value: (function () {
|
|
2576
|
-
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2577
|
-
return _regeneratorRuntime().wrap(function
|
|
2578
|
-
while (1) switch (
|
|
2640
|
+
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(input) {
|
|
2641
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2642
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2579
2643
|
case 0:
|
|
2580
|
-
return
|
|
2644
|
+
return _context30.abrupt("return", this.addAddTimeProductsToBooking({
|
|
2581
2645
|
booking: input.booking,
|
|
2582
2646
|
products: [input],
|
|
2583
2647
|
coveredMinutes: input.coveredMinutes,
|
|
@@ -2585,11 +2649,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2585
2649
|
}));
|
|
2586
2650
|
case 1:
|
|
2587
2651
|
case "end":
|
|
2588
|
-
return
|
|
2652
|
+
return _context30.stop();
|
|
2589
2653
|
}
|
|
2590
|
-
},
|
|
2654
|
+
}, _callee30, this);
|
|
2591
2655
|
}));
|
|
2592
|
-
function addAddTimeProductToBooking(
|
|
2656
|
+
function addAddTimeProductToBooking(_x22) {
|
|
2593
2657
|
return _addAddTimeProductToBooking.apply(this, arguments);
|
|
2594
2658
|
}
|
|
2595
2659
|
return addAddTimeProductToBooking;
|
|
@@ -2607,16 +2671,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2607
2671
|
}, {
|
|
2608
2672
|
key: "addAddTimeProductsToBooking",
|
|
2609
2673
|
value: (function () {
|
|
2610
|
-
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2674
|
+
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(input) {
|
|
2611
2675
|
var _this8 = this,
|
|
2612
2676
|
_input$bookingPatch;
|
|
2613
2677
|
var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
|
|
2614
|
-
return _regeneratorRuntime().wrap(function
|
|
2615
|
-
while (1) switch (
|
|
2678
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2679
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2616
2680
|
case 0:
|
|
2617
2681
|
bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
|
|
2618
2682
|
if (bookingUid) {
|
|
2619
|
-
|
|
2683
|
+
_context31.next = 3;
|
|
2620
2684
|
break;
|
|
2621
2685
|
}
|
|
2622
2686
|
throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
|
|
@@ -2627,7 +2691,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2627
2691
|
};
|
|
2628
2692
|
});
|
|
2629
2693
|
if (this.store.order) {
|
|
2630
|
-
|
|
2694
|
+
_context31.next = 6;
|
|
2631
2695
|
break;
|
|
2632
2696
|
}
|
|
2633
2697
|
throw new Error('order 模块未初始化');
|
|
@@ -2641,55 +2705,55 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2641
2705
|
});
|
|
2642
2706
|
}
|
|
2643
2707
|
if (!(typeof this.store.order.addProductsToOrder === 'function')) {
|
|
2644
|
-
|
|
2708
|
+
_context31.next = 11;
|
|
2645
2709
|
break;
|
|
2646
2710
|
}
|
|
2647
|
-
return
|
|
2711
|
+
return _context31.abrupt("return", this.store.order.addProductsToOrder(orderLines));
|
|
2648
2712
|
case 11:
|
|
2649
2713
|
result = [];
|
|
2650
2714
|
_iterator2 = _createForOfIteratorHelper(orderLines);
|
|
2651
|
-
|
|
2715
|
+
_context31.prev = 13;
|
|
2652
2716
|
_iterator2.s();
|
|
2653
2717
|
case 15:
|
|
2654
2718
|
if ((_step2 = _iterator2.n()).done) {
|
|
2655
|
-
|
|
2719
|
+
_context31.next = 29;
|
|
2656
2720
|
break;
|
|
2657
2721
|
}
|
|
2658
2722
|
line = _step2.value;
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2723
|
+
_context31.t0 = result.splice;
|
|
2724
|
+
_context31.t1 = result;
|
|
2725
|
+
_context31.t2 = [0, result.length];
|
|
2726
|
+
_context31.t3 = _toConsumableArray;
|
|
2727
|
+
_context31.next = 23;
|
|
2664
2728
|
return this.addProductToOrder(line.product);
|
|
2665
2729
|
case 23:
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2730
|
+
_context31.t4 = _context31.sent;
|
|
2731
|
+
_context31.t5 = (0, _context31.t3)(_context31.t4);
|
|
2732
|
+
_context31.t6 = _context31.t2.concat.call(_context31.t2, _context31.t5);
|
|
2733
|
+
_context31.t0.apply.call(_context31.t0, _context31.t1, _context31.t6);
|
|
2670
2734
|
case 27:
|
|
2671
|
-
|
|
2735
|
+
_context31.next = 15;
|
|
2672
2736
|
break;
|
|
2673
2737
|
case 29:
|
|
2674
|
-
|
|
2738
|
+
_context31.next = 34;
|
|
2675
2739
|
break;
|
|
2676
2740
|
case 31:
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
_iterator2.e(
|
|
2741
|
+
_context31.prev = 31;
|
|
2742
|
+
_context31.t7 = _context31["catch"](13);
|
|
2743
|
+
_iterator2.e(_context31.t7);
|
|
2680
2744
|
case 34:
|
|
2681
|
-
|
|
2745
|
+
_context31.prev = 34;
|
|
2682
2746
|
_iterator2.f();
|
|
2683
|
-
return
|
|
2747
|
+
return _context31.finish(34);
|
|
2684
2748
|
case 37:
|
|
2685
|
-
return
|
|
2749
|
+
return _context31.abrupt("return", result);
|
|
2686
2750
|
case 38:
|
|
2687
2751
|
case "end":
|
|
2688
|
-
return
|
|
2752
|
+
return _context31.stop();
|
|
2689
2753
|
}
|
|
2690
|
-
},
|
|
2754
|
+
}, _callee31, this, [[13, 31, 34, 37]]);
|
|
2691
2755
|
}));
|
|
2692
|
-
function addAddTimeProductsToBooking(
|
|
2756
|
+
function addAddTimeProductsToBooking(_x23) {
|
|
2693
2757
|
return _addAddTimeProductsToBooking.apply(this, arguments);
|
|
2694
2758
|
}
|
|
2695
2759
|
return addAddTimeProductsToBooking;
|
|
@@ -2697,33 +2761,33 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2697
2761
|
}, {
|
|
2698
2762
|
key: "setOtherParams",
|
|
2699
2763
|
value: function () {
|
|
2700
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2764
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
|
|
2701
2765
|
var _ref19,
|
|
2702
2766
|
_ref19$cover,
|
|
2703
2767
|
cover,
|
|
2704
|
-
|
|
2705
|
-
return _regeneratorRuntime().wrap(function
|
|
2706
|
-
while (1) switch (
|
|
2768
|
+
_args32 = arguments;
|
|
2769
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2770
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2707
2771
|
case 0:
|
|
2708
|
-
_ref19 =
|
|
2709
|
-
|
|
2772
|
+
_ref19 = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
|
|
2773
|
+
_context32.next = 3;
|
|
2710
2774
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
|
|
2711
2775
|
cover: cover
|
|
2712
2776
|
});
|
|
2713
2777
|
case 3:
|
|
2714
2778
|
if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
|
|
2715
|
-
|
|
2779
|
+
_context32.next = 6;
|
|
2716
2780
|
break;
|
|
2717
2781
|
}
|
|
2718
|
-
|
|
2782
|
+
_context32.next = 6;
|
|
2719
2783
|
return this.configureIdGeneratorFromOpenData();
|
|
2720
2784
|
case 6:
|
|
2721
2785
|
case "end":
|
|
2722
|
-
return
|
|
2786
|
+
return _context32.stop();
|
|
2723
2787
|
}
|
|
2724
|
-
},
|
|
2788
|
+
}, _callee32, this);
|
|
2725
2789
|
}));
|
|
2726
|
-
function setOtherParams(
|
|
2790
|
+
function setOtherParams(_x24) {
|
|
2727
2791
|
return _setOtherParams.apply(this, arguments);
|
|
2728
2792
|
}
|
|
2729
2793
|
return setOtherParams;
|
|
@@ -2740,15 +2804,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2740
2804
|
}, {
|
|
2741
2805
|
key: "handlePrintWristband",
|
|
2742
2806
|
value: function () {
|
|
2743
|
-
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2807
|
+
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
|
|
2744
2808
|
var _this$getOrderIdentit;
|
|
2745
2809
|
var deviceTask, deviceId, idempotencyKey;
|
|
2746
|
-
return _regeneratorRuntime().wrap(function
|
|
2747
|
-
while (1) switch (
|
|
2810
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2811
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2748
2812
|
case 0:
|
|
2749
2813
|
deviceTask = this.getDeviceTaskPlugin();
|
|
2750
2814
|
if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
|
|
2751
|
-
|
|
2815
|
+
_context33.next = 4;
|
|
2752
2816
|
break;
|
|
2753
2817
|
}
|
|
2754
2818
|
this.logger.addLog({
|
|
@@ -2758,7 +2822,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2758
2822
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
2759
2823
|
}
|
|
2760
2824
|
});
|
|
2761
|
-
return
|
|
2825
|
+
return _context33.abrupt("return");
|
|
2762
2826
|
case 4:
|
|
2763
2827
|
this.logger.addLog({
|
|
2764
2828
|
type: 'info',
|
|
@@ -2767,10 +2831,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2767
2831
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
2768
2832
|
}
|
|
2769
2833
|
});
|
|
2770
|
-
|
|
2834
|
+
_context33.next = 7;
|
|
2771
2835
|
return this.getShortNumberOrDeviceId();
|
|
2772
2836
|
case 7:
|
|
2773
|
-
deviceId =
|
|
2837
|
+
deviceId = _context33.sent;
|
|
2774
2838
|
idempotencyKey = createUuidV4();
|
|
2775
2839
|
deviceTask.dispatch({
|
|
2776
2840
|
action: 'print_all',
|
|
@@ -2790,11 +2854,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2790
2854
|
});
|
|
2791
2855
|
case 10:
|
|
2792
2856
|
case "end":
|
|
2793
|
-
return
|
|
2857
|
+
return _context33.stop();
|
|
2794
2858
|
}
|
|
2795
|
-
},
|
|
2859
|
+
}, _callee33, this);
|
|
2796
2860
|
}));
|
|
2797
|
-
function handlePrintWristband(
|
|
2861
|
+
function handlePrintWristband(_x25) {
|
|
2798
2862
|
return _handlePrintWristband.apply(this, arguments);
|
|
2799
2863
|
}
|
|
2800
2864
|
return handlePrintWristband;
|
|
@@ -2802,11 +2866,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2802
2866
|
}, {
|
|
2803
2867
|
key: "handleRedeem",
|
|
2804
2868
|
value: function () {
|
|
2805
|
-
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2869
|
+
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(params) {
|
|
2806
2870
|
var _this$store$order5, _this$store$order5$ge, _this$store$order6, _ref20, _tempOrder$order_id2;
|
|
2807
2871
|
var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
|
|
2808
|
-
return _regeneratorRuntime().wrap(function
|
|
2809
|
-
while (1) switch (
|
|
2872
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2873
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2810
2874
|
case 0:
|
|
2811
2875
|
voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
|
|
2812
2876
|
status = params.is_checkin ? 'used' : 'unused';
|
|
@@ -2830,20 +2894,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2830
2894
|
});
|
|
2831
2895
|
});
|
|
2832
2896
|
if (!(tempOrder && hasUpdatedVoucher)) {
|
|
2833
|
-
|
|
2897
|
+
_context34.next = 11;
|
|
2834
2898
|
break;
|
|
2835
2899
|
}
|
|
2836
|
-
|
|
2900
|
+
_context34.next = 11;
|
|
2837
2901
|
return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
|
|
2838
2902
|
vouchers: nextVouchers
|
|
2839
2903
|
}));
|
|
2840
2904
|
case 11:
|
|
2841
2905
|
this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
|
|
2842
2906
|
if (!(voucherIds.length === 0)) {
|
|
2843
|
-
|
|
2907
|
+
_context34.next = 14;
|
|
2844
2908
|
break;
|
|
2845
2909
|
}
|
|
2846
|
-
return
|
|
2910
|
+
return _context34.abrupt("return", {
|
|
2847
2911
|
code: 200,
|
|
2848
2912
|
status: true,
|
|
2849
2913
|
message: '',
|
|
@@ -2854,7 +2918,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2854
2918
|
externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
|
|
2855
2919
|
orderId = (_ref20 = (_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 && _ref20 !== void 0 ? _ref20 : undefined;
|
|
2856
2920
|
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;
|
|
2857
|
-
return
|
|
2921
|
+
return _context34.abrupt("return", this.request.post('/machinecode/batch', {
|
|
2858
2922
|
ids: voucherIds,
|
|
2859
2923
|
status: status,
|
|
2860
2924
|
order_lookup: orderLookup,
|
|
@@ -2865,11 +2929,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2865
2929
|
}));
|
|
2866
2930
|
case 19:
|
|
2867
2931
|
case "end":
|
|
2868
|
-
return
|
|
2932
|
+
return _context34.stop();
|
|
2869
2933
|
}
|
|
2870
|
-
},
|
|
2934
|
+
}, _callee34, this);
|
|
2871
2935
|
}));
|
|
2872
|
-
function handleRedeem(
|
|
2936
|
+
function handleRedeem(_x26) {
|
|
2873
2937
|
return _handleRedeem.apply(this, arguments);
|
|
2874
2938
|
}
|
|
2875
2939
|
return handleRedeem;
|
|
@@ -2881,12 +2945,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2881
2945
|
}, {
|
|
2882
2946
|
key: "destroy",
|
|
2883
2947
|
value: (function () {
|
|
2884
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2948
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
|
|
2885
2949
|
var _this$scan;
|
|
2886
|
-
return _regeneratorRuntime().wrap(function
|
|
2887
|
-
while (1) switch (
|
|
2950
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
2951
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2888
2952
|
case 0:
|
|
2889
|
-
|
|
2953
|
+
_context35.next = 2;
|
|
2890
2954
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
|
|
2891
2955
|
case 2:
|
|
2892
2956
|
try {
|
|
@@ -2897,9 +2961,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2897
2961
|
scanCache.clear();
|
|
2898
2962
|
case 4:
|
|
2899
2963
|
case "end":
|
|
2900
|
-
return
|
|
2964
|
+
return _context35.stop();
|
|
2901
2965
|
}
|
|
2902
|
-
},
|
|
2966
|
+
}, _callee35, this);
|
|
2903
2967
|
}));
|
|
2904
2968
|
function destroy() {
|
|
2905
2969
|
return _destroy.apply(this, arguments);
|