@pisell/pisellos 2.2.294 → 2.2.295
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/itemRule/adapter.d.ts +1 -4
- package/dist/model/strategy/adapter/itemRule/adapter.js +35 -135
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +1 -8
- package/dist/model/strategy/adapter/itemRule/evaluator.js +1 -25
- package/dist/model/strategy/adapter/itemRule/type.d.ts +0 -44
- package/dist/model/strategy/adapter/itemRule/type.js +1 -19
- package/dist/modules/Order/index.d.ts +3 -18
- package/dist/modules/Order/index.js +485 -885
- package/dist/modules/Order/types.d.ts +5 -91
- package/dist/modules/Order/types.js +0 -5
- package/dist/modules/Order/utils.js +10 -22
- package/dist/modules/ProductList/index.d.ts +1 -2
- package/dist/modules/ProductList/index.js +20 -100
- package/dist/modules/ProductList/types.d.ts +0 -10
- package/dist/server/index.d.ts +0 -6
- package/dist/server/index.js +3 -43
- package/dist/solution/BaseSales/index.d.ts +1 -9
- package/dist/solution/BaseSales/index.js +706 -894
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/utils/orderCustomer.js +2 -3
- package/dist/solution/RegisterAndLogin/config.d.ts +3 -9
- package/dist/solution/RegisterAndLogin/config.js +40 -95
- package/dist/solution/RegisterAndLogin/index.js +1 -4
- package/dist/solution/ScanOrder/index.d.ts +0 -1
- package/dist/solution/ScanOrder/index.js +27 -31
- package/dist/solution/ScanOrder/utils.d.ts +0 -1
- package/dist/solution/ScanOrder/utils.js +0 -2
- package/dist/solution/UnifiedBookingSales/index.d.ts +2 -15
- package/dist/solution/UnifiedBookingSales/index.js +484 -752
- package/dist/solution/UnifiedBookingSales/types.d.ts +1 -14
- package/dist/solution/VenueBooking/index.d.ts +0 -1
- package/dist/solution/VenueBooking/index.js +4 -8
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +1 -4
- package/lib/model/strategy/adapter/itemRule/adapter.js +4 -73
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +1 -8
- package/lib/model/strategy/adapter/itemRule/evaluator.js +1 -23
- package/lib/model/strategy/adapter/itemRule/type.d.ts +0 -44
- package/lib/model/strategy/adapter/itemRule/type.js +1 -19
- package/lib/modules/Order/index.d.ts +3 -18
- package/lib/modules/Order/index.js +28 -325
- package/lib/modules/Order/types.d.ts +5 -91
- package/lib/modules/Order/types.js +0 -4
- package/lib/modules/Order/utils.js +1 -13
- package/lib/modules/ProductList/index.d.ts +1 -2
- package/lib/modules/ProductList/index.js +2 -47
- package/lib/modules/ProductList/types.d.ts +0 -10
- package/lib/server/index.d.ts +0 -6
- package/lib/server/index.js +3 -37
- package/lib/solution/BaseSales/index.d.ts +1 -9
- package/lib/solution/BaseSales/index.js +1 -105
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/utils/orderCustomer.js +1 -2
- package/lib/solution/RegisterAndLogin/config.d.ts +3 -9
- package/lib/solution/RegisterAndLogin/config.js +8 -49
- package/lib/solution/RegisterAndLogin/index.js +1 -4
- package/lib/solution/ScanOrder/index.d.ts +0 -1
- package/lib/solution/ScanOrder/index.js +1 -5
- package/lib/solution/ScanOrder/utils.d.ts +0 -1
- package/lib/solution/ScanOrder/utils.js +0 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +2 -15
- package/lib/solution/UnifiedBookingSales/index.js +1 -125
- package/lib/solution/UnifiedBookingSales/types.d.ts +1 -14
- package/lib/solution/VenueBooking/index.d.ts +0 -1
- package/lib/solution/VenueBooking/index.js +1 -5
- package/package.json +1 -1
- package/dist/modules/Order/salesNotes.d.ts +0 -31
- package/dist/modules/Order/salesNotes.js +0 -492
- package/lib/modules/Order/salesNotes.d.ts +0 -31
- package/lib/modules/Order/salesNotes.js +0 -382
|
@@ -2,11 +2,10 @@ import type { Module, ModuleOptions, PisellCore } from '../../types';
|
|
|
2
2
|
import type { ProductData } from '../../modules';
|
|
3
3
|
import type { OpenDataConfig } from '../../modules/OpenData';
|
|
4
4
|
import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
|
|
5
|
-
import type { ProductListLoadProductsParams
|
|
5
|
+
import type { ProductListLoadProductsParams } from '../../modules/ProductList';
|
|
6
6
|
import type { AvailabilityDateRange, AvailabilityOccupancy, AvailabilityProduct, AvailabilityResource, GetProductTimeRangesRequest } from '../../modules/ResourcePlanner';
|
|
7
|
-
import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse,
|
|
7
|
+
import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
|
|
8
8
|
import { BookingTicket } from '../BookingTicket';
|
|
9
|
-
import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
|
|
10
9
|
export * from './types';
|
|
11
10
|
export { AvailabilityError } from '../../modules/ResourcePlanner';
|
|
12
11
|
/**
|
|
@@ -77,9 +76,6 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
77
76
|
private availabilityRemoteResourceQuerySequence;
|
|
78
77
|
private availabilityRemoteResourceEpoch;
|
|
79
78
|
private availabilityCommitLocks;
|
|
80
|
-
private allergyItemRuleEvaluator;
|
|
81
|
-
private allergyItemRuleConfigs;
|
|
82
|
-
private allergyItemRuleConfigsPromise;
|
|
83
79
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
84
80
|
protected getSubmitOrderSalesChannel(): string;
|
|
85
81
|
private createAvailabilityFacadeError;
|
|
@@ -151,14 +147,6 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
151
147
|
*/
|
|
152
148
|
loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
|
|
153
149
|
getOpenData(): Promise<OpenDataConfig | null>;
|
|
154
|
-
private resetAllergyItemRuleState;
|
|
155
|
-
private fetchAllergyItemRuleConfigs;
|
|
156
|
-
private ensureAllergyItemRuleConfigsLoaded;
|
|
157
|
-
/**
|
|
158
|
-
* 评估当前渠道与商品是否命中 ALLERGY_CHECK。
|
|
159
|
-
* 只返回优先级最高 Action 中当前商品 Target 的 dataSource,不跨商品或 Action 合并。
|
|
160
|
-
*/
|
|
161
|
-
resolveProductAllergyRequirement(params: UnifiedBookingSalesResolveProductAllergyRequirementParams): Promise<AllergyRequirement | null>;
|
|
162
150
|
/**
|
|
163
151
|
* Load a resource policy without depending on the legacy appointmentBooking solution.
|
|
164
152
|
*/
|
|
@@ -171,7 +159,6 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
171
159
|
callback?: (result: any) => void;
|
|
172
160
|
subscriberId?: string;
|
|
173
161
|
}): Promise<ProductData[]>;
|
|
174
|
-
queryProducts(params?: ProductListStoreQueryParams): Promise<ProductData[]>;
|
|
175
162
|
/** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
|
|
176
163
|
loadScheduleAvailableDate(params: LoadScheduleAvailableDateParams): Promise<import("../../modules/Date/types").ITime[]>;
|
|
177
164
|
/**
|
|
@@ -51,7 +51,6 @@ var _remoteOccupancyCache = require("./remoteOccupancyCache");
|
|
|
51
51
|
var _BookingTicket = require("../BookingTicket");
|
|
52
52
|
var _localClock = require("../../modules/ResourcePlanner/localClock");
|
|
53
53
|
var _platform = require("../../utils/platform");
|
|
54
|
-
var _itemRule = require("../../model/strategy/adapter/itemRule");
|
|
55
54
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
56
55
|
const OPEN_DATA_SECTION_CODES = ['sale', 'reservation', 'fulfillment', 'menu', 'workflow', 'basic', 'checkout', 'availability'];
|
|
57
56
|
const OPEN_DATA_CACHE_TTL = 5 * 60 * 1000;
|
|
@@ -84,22 +83,6 @@ function getCandidateStartTime(candidate) {
|
|
|
84
83
|
return undefined;
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
|
-
function normalizePositiveIntegerList(value) {
|
|
88
|
-
if (!Array.isArray(value)) return [];
|
|
89
|
-
return Array.from(new Set(value.map(item => normalizePositiveInteger(item)).filter(item => item !== undefined)));
|
|
90
|
-
}
|
|
91
|
-
function toConfiguredBoolean(value) {
|
|
92
|
-
if (typeof value === 'boolean') return value;
|
|
93
|
-
if (typeof value === 'number') return value !== 0;
|
|
94
|
-
if (typeof value === 'string') {
|
|
95
|
-
return ['1', 'true', 'yes', 'y', 'on'].includes(value.trim().toLowerCase());
|
|
96
|
-
}
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
function normalizeItemRuleStrategyConfigs(value) {
|
|
100
|
-
if (!Array.isArray(value)) return [];
|
|
101
|
-
return value.filter(config => Boolean(config && typeof config === 'object' && config.metadata?.type === 'item_rule'));
|
|
102
|
-
}
|
|
103
86
|
function isRecord(value) {
|
|
104
87
|
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
105
88
|
}
|
|
@@ -1181,15 +1164,11 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
1181
1164
|
availabilityRemoteResourceQuerySequence = 0;
|
|
1182
1165
|
availabilityRemoteResourceEpoch = 0;
|
|
1183
1166
|
availabilityCommitLocks = new Set();
|
|
1184
|
-
allergyItemRuleEvaluator = new _itemRule.ItemRuleEvaluator();
|
|
1185
|
-
allergyItemRuleConfigs = [];
|
|
1186
|
-
allergyItemRuleConfigsPromise = null;
|
|
1187
1167
|
async initialize(core, options = {}) {
|
|
1188
1168
|
this.availabilityScheduleCatalog = null;
|
|
1189
1169
|
this.openDataTarget = null;
|
|
1190
1170
|
this.availabilityRuntimeOffsetMinutes = (0, _localClock.captureRuntimeOffsetMinutes)();
|
|
1191
1171
|
this.clearAvailabilityRemoteResourceState();
|
|
1192
|
-
this.resetAllergyItemRuleState();
|
|
1193
1172
|
await super.initialize(core, options);
|
|
1194
1173
|
const openDataBusinessCode = String(this.otherParams?.businessCode ?? this.otherParams?.business_code ?? '').trim();
|
|
1195
1174
|
const openDataChannel = String(this.otherParams?.channel ?? '').trim();
|
|
@@ -1334,7 +1313,6 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
1334
1313
|
cover = false
|
|
1335
1314
|
} = {}) {
|
|
1336
1315
|
const previousScope = this.getAvailabilityScopeDescriptor(this.otherParams || {});
|
|
1337
|
-
const previousItemRuleConfig = this.otherParams?.itemRule;
|
|
1338
1316
|
const explicitlySetsOpenData = Object.prototype.hasOwnProperty.call(params, 'openData');
|
|
1339
1317
|
await super.setOtherParams(params, {
|
|
1340
1318
|
cover
|
|
@@ -1347,15 +1325,11 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
1347
1325
|
if (shouldResetAvailabilityState) {
|
|
1348
1326
|
await this.resetAvailabilityProjectionState('set_other_params_reset');
|
|
1349
1327
|
}
|
|
1350
|
-
if (shouldResetAvailabilityState || explicitlySetsOpenData || previousItemRuleConfig !== this.otherParams?.itemRule) {
|
|
1351
|
-
this.resetAllergyItemRuleState();
|
|
1352
|
-
}
|
|
1353
1328
|
}
|
|
1354
1329
|
async destroy() {
|
|
1355
1330
|
this.availabilityScheduleCatalog = null;
|
|
1356
1331
|
this.availabilityRuntimeOffsetMinutes = null;
|
|
1357
1332
|
await this.resetAvailabilityProjectionState('destroy');
|
|
1358
|
-
this.resetAllergyItemRuleState();
|
|
1359
1333
|
await super.destroy();
|
|
1360
1334
|
}
|
|
1361
1335
|
createAvailabilityContextId() {
|
|
@@ -1709,98 +1683,6 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
1709
1683
|
channel
|
|
1710
1684
|
});
|
|
1711
1685
|
}
|
|
1712
|
-
resetAllergyItemRuleState() {
|
|
1713
|
-
this.allergyItemRuleConfigs = [];
|
|
1714
|
-
this.allergyItemRuleConfigsPromise = null;
|
|
1715
|
-
this.allergyItemRuleEvaluator.setStrategyConfigs([]);
|
|
1716
|
-
}
|
|
1717
|
-
async fetchAllergyItemRuleConfigs(strategyModelIds) {
|
|
1718
|
-
if (!strategyModelIds.length) return [];
|
|
1719
|
-
try {
|
|
1720
|
-
const response = await this.request.get('/promotion', {
|
|
1721
|
-
skip: 1,
|
|
1722
|
-
num: 99,
|
|
1723
|
-
status: 'active',
|
|
1724
|
-
ids: strategyModelIds
|
|
1725
|
-
});
|
|
1726
|
-
if (response?.code !== 200 || !Array.isArray(response?.data?.list)) {
|
|
1727
|
-
throw new Error('[UnifiedBookingSales] 商品过敏策略加载失败');
|
|
1728
|
-
}
|
|
1729
|
-
const list = response.data.list;
|
|
1730
|
-
return normalizeItemRuleStrategyConfigs(list.map(item => item?.metadata));
|
|
1731
|
-
} catch (error) {
|
|
1732
|
-
// this.logMethodError('fetchAllergyItemRuleConfigs', error, {
|
|
1733
|
-
// strategyModelIds,
|
|
1734
|
-
// });
|
|
1735
|
-
throw error;
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
async ensureAllergyItemRuleConfigsLoaded() {
|
|
1739
|
-
if (this.allergyItemRuleConfigs.length > 0) {
|
|
1740
|
-
return this.allergyItemRuleConfigs;
|
|
1741
|
-
}
|
|
1742
|
-
if (this.allergyItemRuleConfigsPromise) {
|
|
1743
|
-
return this.allergyItemRuleConfigsPromise;
|
|
1744
|
-
}
|
|
1745
|
-
this.allergyItemRuleConfigsPromise = (async () => {
|
|
1746
|
-
const staticConfigs = normalizeItemRuleStrategyConfigs(this.otherParams?.itemRule?.strategyConfigs);
|
|
1747
|
-
if (staticConfigs.length > 0) {
|
|
1748
|
-
this.allergyItemRuleConfigs = staticConfigs;
|
|
1749
|
-
this.allergyItemRuleEvaluator.setStrategyConfigs(staticConfigs);
|
|
1750
|
-
return staticConfigs;
|
|
1751
|
-
}
|
|
1752
|
-
const openData = await this.getOpenData();
|
|
1753
|
-
const enabled = toConfiguredBoolean(openData?.['sale.enable_item_rules']);
|
|
1754
|
-
const strategyModelIds = normalizePositiveIntegerList(openData?.['sale.enabled_item_rules']);
|
|
1755
|
-
if (!enabled || !strategyModelIds.length) {
|
|
1756
|
-
this.allergyItemRuleEvaluator.setStrategyConfigs([]);
|
|
1757
|
-
return [];
|
|
1758
|
-
}
|
|
1759
|
-
const loaded = await this.fetchAllergyItemRuleConfigs(strategyModelIds);
|
|
1760
|
-
this.allergyItemRuleConfigs = loaded;
|
|
1761
|
-
this.allergyItemRuleEvaluator.setStrategyConfigs(loaded);
|
|
1762
|
-
return loaded;
|
|
1763
|
-
})();
|
|
1764
|
-
return this.allergyItemRuleConfigsPromise;
|
|
1765
|
-
}
|
|
1766
|
-
|
|
1767
|
-
/**
|
|
1768
|
-
* 评估当前渠道与商品是否命中 ALLERGY_CHECK。
|
|
1769
|
-
* 只返回优先级最高 Action 中当前商品 Target 的 dataSource,不跨商品或 Action 合并。
|
|
1770
|
-
*/
|
|
1771
|
-
async resolveProductAllergyRequirement(params) {
|
|
1772
|
-
const productId = normalizePositiveInteger(params.productId);
|
|
1773
|
-
if (!productId) return null;
|
|
1774
|
-
const strategyConfigs = await this.ensureAllergyItemRuleConfigsLoaded();
|
|
1775
|
-
if (!strategyConfigs.length) return null;
|
|
1776
|
-
const productVariantId = normalizePositiveInteger(params.productVariantId);
|
|
1777
|
-
const runtimeConfig = this.otherParams?.itemRule || {};
|
|
1778
|
-
const runtimePax = runtimeConfig.pax || {};
|
|
1779
|
-
const cartItems = (this.getOrderProducts?.() || []).map(item => ({
|
|
1780
|
-
product_id: Number(item?.product_id ?? item?.id),
|
|
1781
|
-
product_variant_id: Number(item?.product_variant_id ?? 0) || undefined,
|
|
1782
|
-
quantity: Number(item?.num ?? item?.quantity ?? 0)
|
|
1783
|
-
})).filter(item => Number.isFinite(item.product_id) && item.product_id > 0 && Number.isFinite(item.quantity) && item.quantity > 0);
|
|
1784
|
-
return this.allergyItemRuleEvaluator.getAllergyRequirement({
|
|
1785
|
-
pax: {
|
|
1786
|
-
total: Number(runtimePax.total ?? 0) || 0,
|
|
1787
|
-
adult: Number(runtimePax.adult ?? 0) || 0,
|
|
1788
|
-
child: Number(runtimePax.child ?? 0) || 0
|
|
1789
|
-
},
|
|
1790
|
-
cartItems,
|
|
1791
|
-
serviceType: String(runtimeConfig.serviceType ?? this.otherParams?.serviceType ?? ''),
|
|
1792
|
-
channel: String(params.channel ?? this.otherParams?.channel ?? this.otherParams?.platform ?? ''),
|
|
1793
|
-
currentProduct: {
|
|
1794
|
-
product_id: productId,
|
|
1795
|
-
...(productVariantId ? {
|
|
1796
|
-
product_variant_id: productVariantId
|
|
1797
|
-
} : {})
|
|
1798
|
-
},
|
|
1799
|
-
submissionIndex: Number(runtimeConfig.submissionIndex ?? 0) || 0,
|
|
1800
|
-
strategyConfigs,
|
|
1801
|
-
custom: runtimeConfig.custom
|
|
1802
|
-
});
|
|
1803
|
-
}
|
|
1804
1686
|
|
|
1805
1687
|
/**
|
|
1806
1688
|
* Load a resource policy without depending on the legacy appointmentBooking solution.
|
|
@@ -1837,10 +1719,6 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
1837
1719
|
await this.core.effects.emit(`${this.name}:onProductsLoaded`, result);
|
|
1838
1720
|
return result;
|
|
1839
1721
|
}
|
|
1840
|
-
async queryProducts(params = {}) {
|
|
1841
|
-
if (!this.store.products) throw new Error('[UnifiedBookingSales] products 模块未初始化');
|
|
1842
|
-
return this.store.products.queryProducts(params);
|
|
1843
|
-
}
|
|
1844
1722
|
|
|
1845
1723
|
/** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
|
|
1846
1724
|
async loadScheduleAvailableDate(params) {
|
|
@@ -3356,9 +3234,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
3356
3234
|
} else {
|
|
3357
3235
|
const beforeProductLineUids = new Set((this.getTempOrder()?.products || []).map(line => getProductLineUid(line)).filter(Boolean));
|
|
3358
3236
|
const beforeBookingUids = new Set((this.getTempOrder()?.bookings || []).map(item => getBookingUid(item)).filter(Boolean));
|
|
3359
|
-
const products = await this.addProductToOrder(transformed, booking
|
|
3360
|
-
salesNotes: params.salesNotes
|
|
3361
|
-
} : undefined);
|
|
3237
|
+
const products = await this.addProductToOrder(transformed, booking);
|
|
3362
3238
|
const addedLines = products.filter(line => sameAvailabilityId(line.product_id ?? line.id, refreshedCandidate.productId) && line.metadata?.availability_candidate_key === refreshedCandidate.key && !beforeProductLineUids.has(getProductLineUid(line)));
|
|
3363
3239
|
productLineUids = addedLines.map(line => getProductLineUid(line)).filter(Boolean);
|
|
3364
3240
|
const addedBookings = (this.getTempOrder()?.bookings || []).filter(item => item.metadata?.availability_candidate_key === refreshedCandidate.key && !beforeBookingUids.has(getBookingUid(item)));
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { OpenDataConfig } from '../../modules/OpenData';
|
|
2
|
-
import type { ProductListLoadProductsParams
|
|
3
|
-
import type { ProductData } from '../../modules/Product/types';
|
|
2
|
+
import type { ProductListLoadProductsParams } from '../../modules/ProductList';
|
|
4
3
|
import type { LoadScheduleAvailableDateParams } from '../../modules/Schedule/types';
|
|
5
4
|
import type { AvailabilityDateRange, AvailabilityErrorCode, AvailabilityId, AvailabilityOccupancy, AvailabilityProduct, AvailabilityProjection, AvailabilityQuery, AvailabilityRequirementSelection, AvailabilityResource, AvailabilitySelectionValidationResult, DateAvailabilityQueryResult, GetProductTimeRangesRequest, ProductAvailabilityQueryResult, ProductTimeRange, ProductTimeRangeGroup, ResourceAvailabilityGroup, ResourceAvailabilityRangeGroup, TimeAvailabilityGroup, TimeAvailabilityItem } from '../../modules/ResourcePlanner';
|
|
6
5
|
import type { BookingTicketState } from '../BookingTicket/types';
|
|
7
|
-
import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
|
|
8
|
-
import type { SalesNoteDraftInput } from '../../modules/Order/types';
|
|
9
|
-
export type { ProductListStoreQueryParams } from '../../modules/ProductList';
|
|
10
6
|
export type { AvailabilityAbsoluteRange, AvailabilityAssignment, AvailabilityCell, AvailabilityDateRange, AvailabilityDisplayRange, AvailabilityErrorCode, AvailabilityId, AvailabilityMode, AvailabilityOccupancy, AvailabilityProduct, AvailabilityProductKind, AvailabilityProjection, AvailabilityProjectionInput, AvailabilityProjectionMeta, AvailabilityQuery, AvailabilityQueryResult, AvailabilityRequirementGroup, AvailabilityRequirementGroupResult, AvailabilityRequirementSelection, AvailabilityResource, AvailabilityResourceOption, AvailabilityResourceType, AvailabilityResourceWindow, AvailabilityScheduleMode, AvailabilityScheduleRef, AvailabilityScheduleRule, AvailabilitySelectionValidationParams, AvailabilitySelectionValidationResult, AvailabilitySessionRange, AvailabilityStatus, DateAvailabilityGroup, DateAvailabilityItem, DateAvailabilityQuery, DateAvailabilityQueryResult, GetProductTimeRangesRequest, ProductAvailabilityGroup, ProductAvailabilityItem, ProductAvailabilityQuery, ProductAvailabilityQueryResult, ProductTimeRange, ProductTimeRangeGroup, QueryAvailabilityBaseRequest, ResourceAvailabilityGroup, ResourceAvailabilityQuery, ResourceAvailabilityQueryResult, ResourceAvailabilityRangeGroup, TimeAvailabilityGroup, TimeAvailabilityItem, TimeAvailabilityQuery, TimeAvailabilityQueryResult, } from '../../modules/ResourcePlanner';
|
|
11
7
|
export interface UnifiedBookingSalesState extends BookingTicketState {
|
|
12
8
|
}
|
|
@@ -28,12 +24,6 @@ export declare enum UnifiedBookingSalesHooks {
|
|
|
28
24
|
export interface UnifiedBookingSalesOtherParams extends Record<string, any> {
|
|
29
25
|
enableSessionStoragePersist?: boolean;
|
|
30
26
|
}
|
|
31
|
-
export type UnifiedBookingSalesAllergyRequirement = AllergyRequirement;
|
|
32
|
-
export interface UnifiedBookingSalesResolveProductAllergyRequirementParams {
|
|
33
|
-
productId: number | string;
|
|
34
|
-
productVariantId?: number | string;
|
|
35
|
-
channel?: string;
|
|
36
|
-
}
|
|
37
27
|
export interface UnifiedBookingSalesLoadOpenDataParams {
|
|
38
28
|
businessCode: string;
|
|
39
29
|
channel: string;
|
|
@@ -161,8 +151,6 @@ export interface ContextualCommitAvailabilitySelectionParams {
|
|
|
161
151
|
requirementSelections: AvailabilityRequirementSelection[];
|
|
162
152
|
partySize: number;
|
|
163
153
|
bookingCount?: number;
|
|
164
|
-
/** 新增商品行时与商品、预约在同一次 Order mutation 内写入的 Sales Notes。 */
|
|
165
|
-
salesNotes?: SalesNoteDraftInput[];
|
|
166
154
|
/** 编辑预约时,允许本次显式报价覆盖已落库订单行的历史价格。 */
|
|
167
155
|
allowBookingReprice?: boolean;
|
|
168
156
|
/** 编辑预约重报价后,允许订单模块重新应用已选编辑态折扣。 */
|
|
@@ -220,7 +208,6 @@ export interface UnifiedBookingSalesApi {
|
|
|
220
208
|
getOpenData: () => Promise<OpenDataConfig | null>;
|
|
221
209
|
loadScheduleAvailableDate: (params: LoadScheduleAvailableDateParams) => Promise<unknown>;
|
|
222
210
|
loadProductsByScheduleDate: (params: UnifiedBookingSalesLoadProductsByScheduleDateParams) => Promise<unknown[]>;
|
|
223
|
-
queryProducts: (params?: ProductListStoreQueryParams) => Promise<ProductData[]>;
|
|
224
211
|
stageRetailProducts: (params: UnifiedBookingSalesStageRetailProductsParams) => Promise<Record<string, any> | null>;
|
|
225
212
|
addRetailProduct: (params: UnifiedBookingSalesAddRetailProductParams) => Promise<Record<string, any>[]>;
|
|
226
213
|
prepareAvailabilityProjection: (params: UnifiedBookingSalesPrepareAvailabilityProjectionParams) => Promise<AvailabilityContextRef>;
|
|
@@ -1758,11 +1758,7 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1758
1758
|
return sourceMap;
|
|
1759
1759
|
}
|
|
1760
1760
|
getItemRuleRuntimeConfig() {
|
|
1761
|
-
|
|
1762
|
-
return {
|
|
1763
|
-
...runtimeConfig,
|
|
1764
|
-
channel: runtimeConfig.channel ?? runtimeConfig.custom?.channel ?? this.otherParams?.channel
|
|
1765
|
-
};
|
|
1761
|
+
return this.itemRuleRuntimeConfig || {};
|
|
1766
1762
|
}
|
|
1767
1763
|
async ensureItemRuleConfigsLoaded() {
|
|
1768
1764
|
if (this.itemRuleConfigs.length > 0) return this.itemRuleConfigs;
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { SalesNote, SalesNoteProtocol, SalesNoteTextInput } from './types';
|
|
2
|
-
export interface SalesNotePolicy {
|
|
3
|
-
note_type: string;
|
|
4
|
-
importance: string;
|
|
5
|
-
uniquePerPrimaryTarget: boolean;
|
|
6
|
-
primary_relation_type: 'about';
|
|
7
|
-
secondary_order_relation_type: 'related_to';
|
|
8
|
-
}
|
|
9
|
-
export declare function getSalesNotePolicy(note_type: string): SalesNotePolicy | null;
|
|
10
|
-
export declare function buildSalesNoteText(input: SalesNoteTextInput): Record<string, string>;
|
|
11
|
-
export interface SalesNoteValidationOptions {
|
|
12
|
-
allowUnresolvedOrderTarget?: boolean;
|
|
13
|
-
expectedOrderTargetUuid?: string;
|
|
14
|
-
productTargetUuids?: ReadonlySet<string>;
|
|
15
|
-
}
|
|
16
|
-
export type EncodeSalesNotesOptions = SalesNoteValidationOptions;
|
|
17
|
-
export declare function encodeSalesNotes(notes: SalesNote[], options?: EncodeSalesNotesOptions): SalesNoteProtocol[];
|
|
18
|
-
export interface DecodedSalesNotesSnapshot {
|
|
19
|
-
notes: SalesNote[];
|
|
20
|
-
complete: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface DecodeSalesNotesOptions {
|
|
23
|
-
allowUnresolvedOrderTarget?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare function decodeSalesNotesSnapshot(value: unknown, options?: DecodeSalesNotesOptions): DecodedSalesNotesSnapshot;
|
|
26
|
-
export declare function decodeSalesNotes(value: unknown, options?: DecodeSalesNotesOptions): SalesNote[];
|
|
27
|
-
export declare function finalizeSalesNotesForCheckout(params: {
|
|
28
|
-
notes: unknown;
|
|
29
|
-
shopOrderNumber: unknown;
|
|
30
|
-
productTargetUuids: string[];
|
|
31
|
-
}): SalesNoteProtocol[];
|