@pisell/pisellos 2.2.121 → 2.2.123
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/Rules/index.js +2 -2
- package/dist/server/index.d.ts +57 -3
- package/dist/server/index.js +735 -190
- package/dist/server/modules/order/index.d.ts +25 -3
- package/dist/server/modules/order/index.js +282 -136
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -1
- package/lib/modules/Rules/index.js +4 -4
- package/lib/server/index.d.ts +57 -3
- package/lib/server/index.js +471 -33
- package/lib/server/modules/order/index.d.ts +25 -3
- package/lib/server/modules/order/index.js +105 -24
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -1
- package/package.json +1 -1
|
@@ -124,7 +124,7 @@ export var searchProduct = /*#__PURE__*/function () {
|
|
|
124
124
|
skip: 1,
|
|
125
125
|
num: 20,
|
|
126
126
|
status: 'published',
|
|
127
|
-
with: ['variantGroup'],
|
|
127
|
+
with: ['variantGroup.variantItem', 'optionGroup.optionItem'],
|
|
128
128
|
with_count: ['bundleGroup', 'optionGroup'],
|
|
129
129
|
exclude_extension_type: ['product_party', 'product_event', 'product_series_event', 'product_package_ticket', 'ticket', 'event_item']
|
|
130
130
|
};
|
|
@@ -1591,7 +1591,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1591
1591
|
* @returns 是否可用
|
|
1592
1592
|
*/
|
|
1593
1593
|
checkPackageSubItemUsageRules(discount, flatItem) {
|
|
1594
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1594
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1595
1595
|
const limitedData = discount.limited_relation_product_data;
|
|
1596
1596
|
const usageRules = limitedData == null ? void 0 : limitedData.package_sub_item_usage_rules;
|
|
1597
1597
|
const rules = ["original_price", ...(usageRules == null ? void 0 : usageRules.rules) || []];
|
|
@@ -1613,7 +1613,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1613
1613
|
if (isBundleItem) {
|
|
1614
1614
|
const priceType = (_a = flatItem.bundleItem) == null ? void 0 : _a.price_type;
|
|
1615
1615
|
const priceTypeExt = (_b = flatItem.bundleItem) == null ? void 0 : _b.price_type_ext;
|
|
1616
|
-
const mainProductId = ((_c = flatItem == null ? void 0 : flatItem.originProduct) == null ? void 0 : _c.
|
|
1616
|
+
const mainProductId = ((_d = (_c = flatItem == null ? void 0 : flatItem.originProduct) == null ? void 0 : _c._productOrigin) == null ? void 0 : _d.id) || ((_e = flatItem == null ? void 0 : flatItem.parentProduct) == null ? void 0 : _e.id) || 0;
|
|
1617
1617
|
const isOriginalPrice = priceType === "markup" && priceTypeExt === "product_price";
|
|
1618
1618
|
const isMarkupPrice = priceType === "markup" && (priceTypeExt === "" || !priceTypeExt);
|
|
1619
1619
|
if (rules.length > 0) {
|
|
@@ -1645,8 +1645,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1645
1645
|
return false;
|
|
1646
1646
|
}
|
|
1647
1647
|
if (isBundleItem) {
|
|
1648
|
-
const priceType = (
|
|
1649
|
-
const priceTypeExt = (
|
|
1648
|
+
const priceType = (_f = flatItem.bundleItem) == null ? void 0 : _f.price_type;
|
|
1649
|
+
const priceTypeExt = (_g = flatItem.bundleItem) == null ? void 0 : _g.price_type_ext;
|
|
1650
1650
|
const isOriginalPrice = priceType === "markup" && priceTypeExt === "product_price";
|
|
1651
1651
|
const isMarkupPrice = priceType === "markup" && (priceTypeExt === "" || !priceTypeExt);
|
|
1652
1652
|
if (rules.length > 0) {
|
package/lib/server/index.d.ts
CHANGED
|
@@ -29,6 +29,10 @@ declare class Server {
|
|
|
29
29
|
private productQuerySubscribers;
|
|
30
30
|
private orderQuerySubscribers;
|
|
31
31
|
private bookingQuerySubscribers;
|
|
32
|
+
private bookingRemoteQuerySubscribers;
|
|
33
|
+
private bookingRemoteCache;
|
|
34
|
+
private readonly BOOKING_REMOTE_CACHE_TTL_MS;
|
|
35
|
+
private readonly BOOKING_REMOTE_CACHE_MAX_ENTRIES;
|
|
32
36
|
private floorPlanQuerySubscribers;
|
|
33
37
|
private moduleRegistry;
|
|
34
38
|
constructor(core: PisellCore);
|
|
@@ -176,11 +180,61 @@ declare class Server {
|
|
|
176
180
|
*/
|
|
177
181
|
private handleUnsubscribeOrderQuery;
|
|
178
182
|
/**
|
|
179
|
-
*
|
|
183
|
+
* 从查询值中提取 YYYY-MM-DD 日期串。
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* this.extractQueryDate('2026-04-15 09:58:00') // => '2026-04-15'
|
|
180
187
|
*/
|
|
181
|
-
private
|
|
188
|
+
private extractQueryDate;
|
|
182
189
|
/**
|
|
183
|
-
*
|
|
190
|
+
* 判断时间范围是否「开始和结束都不是今天」。
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* this.isRangeBothNotToday('2026-04-13', '2026-04-14') // => true
|
|
194
|
+
*/
|
|
195
|
+
private isRangeBothNotToday;
|
|
196
|
+
/**
|
|
197
|
+
* 订单查询是否走本地:
|
|
198
|
+
* - 当 start_time 与 end_time 都不是今天时,走远端;
|
|
199
|
+
* - 其余情况走本地。
|
|
200
|
+
*/
|
|
201
|
+
private shouldUseLocalOrderQuery;
|
|
202
|
+
/**
|
|
203
|
+
* 预约查询是否走本地:
|
|
204
|
+
* - 当 sales_time_between 的开始和结束都不是今天时,走远端;
|
|
205
|
+
* - 其余情况走本地。
|
|
206
|
+
*/
|
|
207
|
+
private shouldUseLocalBookingQuery;
|
|
208
|
+
/**
|
|
209
|
+
* 日历 SSE 精简 with:只拉日历渲染必需的关联字段
|
|
210
|
+
*/
|
|
211
|
+
private resolveBookingSalesWith;
|
|
212
|
+
/**
|
|
213
|
+
* 日历 SSE 精简 select:渲染 + filterBookingsFromOrders 所需的主表字段
|
|
214
|
+
* business_code / payment_status 不直接用于渲染,但 matchOrder 过滤依赖
|
|
215
|
+
*/
|
|
216
|
+
private resolveBookingSalesSelect;
|
|
217
|
+
private normalizeBookingRemoteQueryPayload;
|
|
218
|
+
/**
|
|
219
|
+
* 远端预约查询内存缓存开关:默认 false,仅显式 true 才启用。
|
|
220
|
+
*/
|
|
221
|
+
private isBookingRemoteMemoryCacheEnabled;
|
|
222
|
+
private stableSerialize;
|
|
223
|
+
private buildBookingRemoteCacheKey;
|
|
224
|
+
private parseBookingSalesRangeMeta;
|
|
225
|
+
private readBookingRemoteCache;
|
|
226
|
+
private writeBookingRemoteCache;
|
|
227
|
+
private toOrderIdKey;
|
|
228
|
+
private markBookingRemoteCacheAllStale;
|
|
229
|
+
private buildBookingResponse;
|
|
230
|
+
private notifyBookingRemoteSubscribersByCacheKey;
|
|
231
|
+
private syncBookingRemoteCacheFromOrderChanges;
|
|
232
|
+
/**
|
|
233
|
+
* 非本地窗口的订单查询:走真实 API。
|
|
234
|
+
*/
|
|
235
|
+
private fetchOrderListFromAPI;
|
|
236
|
+
/**
|
|
237
|
+
* 非今天的预约查询:通过 SSE 流式拉取订单,再做本地 booking 筛选展开
|
|
184
238
|
*/
|
|
185
239
|
private fetchBookingListFromAPI;
|
|
186
240
|
/**
|