@pisell/pisellos 0.10.50 → 0.10.52
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/modules/FulfillmentTiming/index.d.ts +11 -0
- package/dist/modules/FulfillmentTiming/index.js +407 -0
- package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
- package/dist/modules/FulfillmentTiming/types.js +1 -0
- package/dist/modules/OpenData/types.d.ts +6 -0
- package/dist/modules/Order/index.d.ts +18 -1
- package/dist/modules/Order/index.js +322 -195
- package/dist/modules/Order/pickupTiming.d.ts +46 -0
- package/dist/modules/Order/pickupTiming.js +53 -0
- package/dist/modules/Order/types.d.ts +11 -1
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +145 -85
- package/dist/modules/Rules/index.js +3 -2
- package/dist/modules/Schedule/index.d.ts +8 -0
- package/dist/modules/Schedule/index.js +134 -37
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/server/modules/order/index.d.ts +8 -0
- package/dist/server/modules/order/index.js +506 -453
- package/dist/server/modules/order/types.d.ts +1 -0
- package/dist/server/utils/small-ticket.js +165 -94
- package/dist/solution/BaseSales/index.d.ts +24 -0
- package/dist/solution/BaseSales/index.js +1231 -1037
- package/dist/solution/BaseSales/pickupTiming.d.ts +43 -0
- package/dist/solution/BaseSales/pickupTiming.js +589 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +3 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +2 -2
- package/dist/solution/BookingTicket/utils/cartView.js +3 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +13 -4
- package/dist/solution/UnifiedBookingSales/index.js +873 -708
- package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
- package/lib/modules/FulfillmentTiming/index.js +359 -0
- package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
- package/lib/modules/FulfillmentTiming/types.js +5 -0
- package/lib/modules/OpenData/types.d.ts +6 -0
- package/lib/modules/Order/index.d.ts +18 -1
- package/lib/modules/Order/index.js +101 -3
- package/lib/modules/Order/pickupTiming.d.ts +46 -0
- package/lib/modules/Order/pickupTiming.js +61 -0
- package/lib/modules/Order/types.d.ts +11 -1
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +58 -4
- package/lib/modules/Rules/index.js +3 -2
- package/lib/modules/Schedule/index.d.ts +8 -0
- package/lib/modules/Schedule/index.js +64 -11
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +11 -0
- package/lib/server/modules/order/index.d.ts +8 -0
- package/lib/server/modules/order/index.js +19 -0
- package/lib/server/modules/order/types.d.ts +1 -0
- package/lib/server/utils/small-ticket.js +86 -22
- package/lib/solution/BaseSales/index.d.ts +24 -0
- package/lib/solution/BaseSales/index.js +109 -1
- package/lib/solution/BaseSales/pickupTiming.d.ts +43 -0
- package/lib/solution/BaseSales/pickupTiming.js +269 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +3 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +2 -2
- package/lib/solution/BookingTicket/utils/cartView.js +3 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +13 -4
- package/lib/solution/UnifiedBookingSales/index.js +130 -46
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { normalizeOrderCollections } from "../../../modules/Order/utils/orderCollectionIdentity";
|
|
27
|
+
import { isFulfillmentTimingBooking } from "../../../modules/Order/pickupTiming";
|
|
27
28
|
/** OrderData 中除大数组外的"顶层 header 字段"白名单,按需扩展。 */
|
|
28
29
|
var HEADER_KEYS = ['order_id', 'order_number', 'shop_order_number', 'shop_full_order_number', 'type', 'business_code', 'platform', 'sales_channel', 'order_sales_channel', 'vouchers', 'status', 'payment_status', 'shipping_status', 'customer_id', 'customer_name', 'country_calling_code', 'phone', 'email', 'is_price_include_tax', 'tax_title', 'tax_country_code', 'currency_code', 'currency_symbol', 'currency_format', 'is_deposit', 'deposit_amount', 'shop_discount', 'surcharge_fee', 'note', 'schedule_date', 'created_at', 'updated_at', 'order_meta_list', 'metadata', 'total_amount', 'shop_id', 'create_date', 'holder', 'relation_forms', 'contacts', 'contacts_info'];
|
|
29
30
|
function pickHeader(raw) {
|
|
@@ -78,6 +79,7 @@ function pickCustomer(raw) {
|
|
|
78
79
|
*/
|
|
79
80
|
function isRootBooking(booking) {
|
|
80
81
|
if (!booking || _typeof(booking) !== 'object') return false;
|
|
82
|
+
if (isFulfillmentTimingBooking(booking)) return false;
|
|
81
83
|
var parentId = booking.parent_id;
|
|
82
84
|
if (parentId === 0 || parentId === null || parentId === undefined) return true;
|
|
83
85
|
return false;
|
|
@@ -90,6 +92,7 @@ function indexBookingsByProductUid(bookings) {
|
|
|
90
92
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
91
93
|
var _b$metadata;
|
|
92
94
|
var b = _step2.value;
|
|
95
|
+
if (isFulfillmentTimingBooking(b)) continue;
|
|
93
96
|
var uid = b && (b.product_uid || ((_b$metadata = b.metadata) === null || _b$metadata === void 0 ? void 0 : _b$metadata.product_uid)) || '';
|
|
94
97
|
if (!uid) continue;
|
|
95
98
|
var _key2 = String(uid);
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 | 2 | 1 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 5 | 4 | 3 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -52,10 +52,10 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
52
52
|
* 在解决方案对外 ready 前准备 Invoice Document;失败只降级模板,不阻断销售。
|
|
53
53
|
* 已由页面取得的 OpenData 直接交给模块接管,没有注入数据时再走 target-scoped 加载。
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
protected prepareInvoiceTemplateAtSolutionReady(injectedOpenData?: OpenDataConfig): Promise<void>;
|
|
56
56
|
protected getBookingTicketBusinessCode(): string | null;
|
|
57
57
|
private getIdGeneratorPlugin;
|
|
58
|
-
|
|
58
|
+
protected loadOpenDataConfig(): Promise<OpenDataConfig | null>;
|
|
59
59
|
getOpenData(): Promise<OpenDataConfig | null>;
|
|
60
60
|
getInvoiceLayoutConfig(): Promise<InvoiceLayoutConfig>;
|
|
61
61
|
getInvoiceTemplateSettings(): Promise<InvoiceTemplateSettings>;
|
|
@@ -5,12 +5,14 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { resolveBookingCanAddTime } from "./addTimeAvailability";
|
|
8
|
+
import { isFulfillmentTimingBooking } from "../../../modules/Order/pickupTiming";
|
|
8
9
|
/**
|
|
9
10
|
* 仅按 booking.product_uid 建索引,避免发明 booking 与商品行之间的其它等价关系。
|
|
10
11
|
*/
|
|
11
12
|
export function indexBookingsByProductUid(bookings) {
|
|
12
13
|
if (!Array.isArray(bookings) || bookings.length === 0) return {};
|
|
13
14
|
return bookings.reduce(function (acc, booking) {
|
|
15
|
+
if (isFulfillmentTimingBooking(booking)) return acc;
|
|
14
16
|
var uid = booking === null || booking === void 0 ? void 0 : booking.product_uid;
|
|
15
17
|
if (uid === undefined || uid === null || uid === '') return acc;
|
|
16
18
|
var key = String(uid);
|
|
@@ -109,7 +111,7 @@ export function buildCartView(lines, bookings) {
|
|
|
109
111
|
var productLines = Array.isArray(lines) ? lines : [];
|
|
110
112
|
var bookingList = Array.isArray(bookings) ? bookings : [];
|
|
111
113
|
var childBookings = bookingList.filter(function (booking) {
|
|
112
|
-
return booking.parent_id !== 0;
|
|
114
|
+
return booking.parent_id !== 0 && !isFulfillmentTimingBooking(booking);
|
|
113
115
|
});
|
|
114
116
|
var bookingsByProductUid = indexBookingsByProductUid(childBookings);
|
|
115
117
|
var linesByUid = indexProductsByUid(productLines);
|
|
@@ -59,6 +59,13 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
59
59
|
protected defaultName: string;
|
|
60
60
|
protected defaultVersion: string;
|
|
61
61
|
protected store: UnifiedBookingSalesState;
|
|
62
|
+
protected pickupTimingEnabled: boolean;
|
|
63
|
+
private runtimeOpenDataScope;
|
|
64
|
+
private runtimeOpenDataSnapshot;
|
|
65
|
+
private runtimeOpenDataModule;
|
|
66
|
+
private runtimeOpenDataCore;
|
|
67
|
+
private runtimeOpenDataGeneration;
|
|
68
|
+
private runtimeOpenDataDestroyed;
|
|
62
69
|
private unifiedProductCatalog;
|
|
63
70
|
private availabilityRuntimeOffsetMinutes;
|
|
64
71
|
private availabilityScheduleCatalog;
|
|
@@ -142,12 +149,14 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
142
149
|
private resolveDiscountAction;
|
|
143
150
|
private resetCachedCustomerDiscountState;
|
|
144
151
|
private refreshLegacySessionCustomerDiscounts;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
private getRuntimeOpenDataScope;
|
|
153
|
+
private resetRuntimeOpenData;
|
|
154
|
+
protected prepareInvoiceTemplateAtSolutionReady(injectedOpenData?: OpenDataConfig): Promise<void>;
|
|
155
|
+
protected loadOpenDataConfig(): Promise<OpenDataConfig | null>;
|
|
156
|
+
/** A successful configuration belongs to this business runtime until an explicit refresh. */
|
|
149
157
|
loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
|
|
150
158
|
getOpenData(): Promise<OpenDataConfig | null>;
|
|
159
|
+
protected loadPickupTimingOpenData(_force: boolean): Promise<Record<string, unknown>>;
|
|
151
160
|
private resetAllergyItemRuleState;
|
|
152
161
|
private fetchAllergyItemRuleConfigs;
|
|
153
162
|
private ensureAllergyItemRuleConfigsLoaded;
|