@pisell/pisellos 0.10.59 → 0.10.61
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/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +3 -1
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +25 -2
- package/dist/modules/Discount/index.js +1 -0
- package/dist/modules/Order/holderRelations.d.ts +14 -0
- package/dist/modules/Order/holderRelations.js +154 -0
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Order/index.js +92 -47
- package/dist/modules/Order/types.d.ts +19 -1
- package/dist/modules/Order/types.js +2 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +1 -1
- package/dist/modules/Order/utils/discountProductLineIdentity.js +142 -7
- package/dist/modules/Order/utils/orderCollectionIdentity.js +24 -10
- package/dist/modules/Order/utils.d.ts +1 -1
- package/dist/modules/Order/utils.js +35 -9
- package/dist/server/index.js +18 -12
- package/dist/server/modules/order/index.d.ts +4 -0
- package/dist/server/modules/order/index.js +255 -190
- package/dist/server/modules/order/types.d.ts +3 -0
- package/dist/shared/receipt/small-ticket.js +17 -0
- package/dist/shared/sales/loadSalesOrderSnapshot.js +1 -1
- package/dist/solution/BaseSales/index.js +97 -27
- package/dist/solution/BaseSales/types.d.ts +2 -1
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -1
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +7 -3
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +12 -3
- package/dist/solution/BookingTicket/index.js +7 -4
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +4 -3
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +6 -2
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +1 -1
- package/dist/solution/UnifiedBookingSales/index.js +4 -4
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.js +6 -0
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +3 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +16 -1
- package/lib/modules/Discount/index.js +1 -0
- package/lib/modules/Order/holderRelations.d.ts +14 -0
- package/lib/modules/Order/holderRelations.js +98 -0
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/index.js +44 -12
- package/lib/modules/Order/types.d.ts +19 -1
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +1 -1
- package/lib/modules/Order/utils/discountProductLineIdentity.js +51 -2
- package/lib/modules/Order/utils/orderCollectionIdentity.js +5 -0
- package/lib/modules/Order/utils.d.ts +1 -1
- package/lib/modules/Order/utils.js +27 -6
- package/lib/server/index.js +6 -0
- package/lib/server/modules/order/index.d.ts +4 -0
- package/lib/server/modules/order/index.js +46 -4
- package/lib/server/modules/order/types.d.ts +3 -0
- package/lib/shared/receipt/small-ticket.js +15 -0
- package/lib/shared/sales/loadSalesOrderSnapshot.js +1 -1
- package/lib/solution/BaseSales/index.js +39 -2
- package/lib/solution/BaseSales/types.d.ts +2 -1
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -1
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +4 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +7 -0
- package/lib/solution/BookingTicket/index.js +4 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -3
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +7 -1
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +1 -1
- package/lib/solution/UnifiedBookingSales/index.js +3 -3
- package/lib/utils/platform.d.ts +2 -0
- package/lib/utils/platform.js +7 -0
- package/package.json +1 -1
|
@@ -1653,14 +1653,14 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
1653
1653
|
}
|
|
1654
1654
|
|
|
1655
1655
|
/**
|
|
1656
|
-
* PC/H5
|
|
1656
|
+
* PC/H5 及自助终端结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
|
|
1657
1657
|
* 显式传 checkoutSyncTaskEnabled: true 时仍可回退到本地同步模式。
|
|
1658
1658
|
*/
|
|
1659
1659
|
shouldUseCheckoutSyncTask() {
|
|
1660
1660
|
const configured = this.otherParams?.checkoutSyncTaskEnabled;
|
|
1661
1661
|
if (configured === true) return true;
|
|
1662
1662
|
const platform = (0, _platform.normalizeRuntimePlatform)(this.otherParams?.platform);
|
|
1663
|
-
return !(0, _platform.isCustomerUserPlatform)(platform) && platform
|
|
1663
|
+
return !(0, _platform.isCustomerUserPlatform)(platform) && !(0, _platform.isSelfServicePlatform)(platform);
|
|
1664
1664
|
}
|
|
1665
1665
|
|
|
1666
1666
|
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|
|
@@ -2017,7 +2017,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
2017
2017
|
throw new Error('[UnifiedBookingSales] getProtocol 需要 policyId');
|
|
2018
2018
|
}
|
|
2019
2019
|
let policyUrl = 'shop-policy';
|
|
2020
|
-
if (this.otherParams.platform
|
|
2020
|
+
if ((0, _platform.isSelfServicePlatform)(this.otherParams.platform) || this.otherParams.platform === 'pos' || this.otherParams.platform === 'shop') {
|
|
2021
2021
|
policyUrl = 'policy';
|
|
2022
2022
|
}
|
|
2023
2023
|
return this.request.get(`/${policyUrl}/${encodeURIComponent(normalizedPolicyId)}`);
|
package/lib/utils/platform.d.ts
CHANGED
|
@@ -6,3 +6,5 @@ export declare function normalizeRuntimePlatform(platform: unknown): string;
|
|
|
6
6
|
* PC and H5 are authenticated-customer clients rather than staff terminals.
|
|
7
7
|
*/
|
|
8
8
|
export declare function isCustomerUserPlatform(platform: unknown): boolean;
|
|
9
|
+
/** Kiosk and vending retain distinct channels but share self-service checkout behavior. */
|
|
10
|
+
export declare function isSelfServicePlatform(platform: unknown): boolean;
|
package/lib/utils/platform.js
CHANGED
|
@@ -4,8 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isCustomerUserPlatform = isCustomerUserPlatform;
|
|
7
|
+
exports.isSelfServicePlatform = isSelfServicePlatform;
|
|
7
8
|
exports.normalizeRuntimePlatform = normalizeRuntimePlatform;
|
|
8
9
|
const CUSTOMER_USER_PLATFORMS = new Set(['pc', 'h5']);
|
|
10
|
+
const SELF_SERVICE_PLATFORMS = new Set(['kiosk', 'vending']);
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Normalize the runtime platform passed through solution/module otherParams.
|
|
@@ -19,4 +21,9 @@ function normalizeRuntimePlatform(platform) {
|
|
|
19
21
|
*/
|
|
20
22
|
function isCustomerUserPlatform(platform) {
|
|
21
23
|
return CUSTOMER_USER_PLATFORMS.has(normalizeRuntimePlatform(platform));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Kiosk and vending retain distinct channels but share self-service checkout behavior. */
|
|
27
|
+
function isSelfServicePlatform(platform) {
|
|
28
|
+
return SELF_SERVICE_PLATFORMS.has(normalizeRuntimePlatform(platform));
|
|
22
29
|
}
|