@pisell/pisellos 2.3.230 → 2.3.231
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/adapter.js +14 -2
- package/dist/model/strategy/adapter/promotion/evaluator.js +23 -8
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/promotion/type.d.ts +10 -2
- package/dist/modules/Customer/types.d.ts +0 -4
- package/dist/modules/Order/index.js +1411 -1318
- package/dist/modules/Order/types.d.ts +13 -36
- package/dist/modules/Order/types.js +2 -0
- package/dist/modules/Order/utils.js +0 -2
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/solution/BaseSales/index.js +0 -3
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +5 -18
- package/dist/solution/BaseSales/utils/cartPromotion.js +252 -168
- package/dist/solution/BookingByStep/index.d.ts +3 -3
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +45 -21
- package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +9 -9
- package/dist/solution/Checkout/index.js +69 -104
- package/dist/solution/Checkout/types.d.ts +0 -1
- package/dist/solution/ScanOrder/index.d.ts +1 -0
- package/dist/solution/ScanOrder/index.js +54 -48
- package/dist/solution/ScanOrder/menuAvailability.js +3 -25
- package/dist/solution/ScanOrder/shopTime.d.ts +6 -0
- package/dist/solution/ScanOrder/shopTime.js +36 -0
- package/dist/solution/VenueBooking/index.js +490 -522
- package/lib/model/strategy/adapter/promotion/adapter.js +10 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +18 -6
- package/lib/model/strategy/adapter/promotion/type.d.ts +10 -2
- package/lib/modules/Customer/types.d.ts +0 -4
- package/lib/modules/Order/index.js +109 -76
- package/lib/modules/Order/types.d.ts +13 -36
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/Order/utils.js +1 -5
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/solution/BaseSales/index.js +0 -3
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +5 -18
- package/lib/solution/BaseSales/utils/cartPromotion.js +87 -40
- package/lib/solution/BookingByStep/index.d.ts +3 -3
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +28 -11
- package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +9 -9
- package/lib/solution/Checkout/index.js +0 -21
- package/lib/solution/Checkout/types.d.ts +0 -1
- package/lib/solution/ScanOrder/index.d.ts +1 -0
- package/lib/solution/ScanOrder/index.js +26 -19
- package/lib/solution/ScanOrder/menuAvailability.js +3 -20
- package/lib/solution/ScanOrder/shopTime.d.ts +6 -0
- package/lib/solution/ScanOrder/shopTime.js +37 -0
- package/lib/solution/VenueBooking/index.js +1 -6
- package/package.json +1 -1
- package/dist/modules/Order/utils/bookingUuid.d.ts +0 -4
- package/dist/modules/Order/utils/bookingUuid.js +0 -24
- package/lib/modules/Order/utils/bookingUuid.d.ts +0 -4
- package/lib/modules/Order/utils/bookingUuid.js +0 -25
|
@@ -38,7 +38,6 @@ var _smartPricing = require("./utils/smartPricing");
|
|
|
38
38
|
var _slotMerge = require("./utils/slotMerge");
|
|
39
39
|
var _utils3 = require("../../modules/Order/utils");
|
|
40
40
|
var _Order = require("../../modules/Order");
|
|
41
|
-
var _bookingUuid = require("../../modules/Order/utils/bookingUuid");
|
|
42
41
|
var _types4 = require("../RegisterAndLogin/types");
|
|
43
42
|
var _decimal = _interopRequireDefault(require("decimal.js"));
|
|
44
43
|
var _Holder = require("../../modules/Holder");
|
|
@@ -1198,7 +1197,6 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1198
1197
|
if (!mapping) return;
|
|
1199
1198
|
const tempOrder = this.store.order.ensureTempOrder();
|
|
1200
1199
|
const matchesCurrent = (meta, pid) => !!meta?.venue_booking && String(meta?.resource_id) === String(resourceId) && Number(pid) === Number(productId);
|
|
1201
|
-
const previousBookings = (tempOrder.bookings || []).filter(row => row.uuid && matchesCurrent(row.metadata, row.metadata?.product_id ?? row.product?.product_id));
|
|
1202
1200
|
tempOrder.products = tempOrder.products.filter(p => !matchesCurrent(p.metadata, p.product_id));
|
|
1203
1201
|
tempOrder.bookings = (tempOrder.bookings || []).filter(b => {
|
|
1204
1202
|
if (!b.metadata?.venue_booking) return true;
|
|
@@ -1334,10 +1332,7 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1334
1332
|
productUid,
|
|
1335
1333
|
childResources: childRawResources
|
|
1336
1334
|
});
|
|
1337
|
-
|
|
1338
|
-
const original = previousBookings.findIndex(row => `${row.start_date} ${String(row.start_time).slice(0, 5)}` < group.endTime && `${row.end_date} ${String(row.end_time).slice(0, 5)}` > group.startTime);
|
|
1339
|
-
if (original >= 0) booking.uuid = previousBookings.splice(original, 1)[0].uuid;
|
|
1340
|
-
tempOrder.bookings.push((0, _bookingUuid.ensureBookingUuid)(booking));
|
|
1335
|
+
tempOrder.bookings.push(booking);
|
|
1341
1336
|
}
|
|
1342
1337
|
|
|
1343
1338
|
// 获取表单信息
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Cross-system booking identity; independent from the legacy cart-line UID. */
|
|
2
|
-
export declare function ensureBookingUuid<T extends Record<string, any>>(booking: T): T;
|
|
3
|
-
/** Retain a generated UUID on the draft so a checkout retry sends the same value. */
|
|
4
|
-
export declare function assignBookingUuid(booking: Record<string, any> | null | undefined): void;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
|
-
import { createUuidV4 } from "./orderCollectionIdentity";
|
|
8
|
-
|
|
9
|
-
/** Cross-system booking identity; independent from the legacy cart-line UID. */
|
|
10
|
-
export function ensureBookingUuid(booking) {
|
|
11
|
-
if (booking.uuid) return booking;
|
|
12
|
-
// Only an explicit null confirms that an existing booking needs a UUID when saved.
|
|
13
|
-
if (booking.uuid !== null && Number(booking.schedule_event_id || booking.id) > 0) return booking;
|
|
14
|
-
return _objectSpread(_objectSpread({}, booking), {}, {
|
|
15
|
-
uuid: createUuidV4()
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** Retain a generated UUID on the draft so a checkout retry sends the same value. */
|
|
20
|
-
export function assignBookingUuid(booking) {
|
|
21
|
-
if (!booking) return;
|
|
22
|
-
var resolved = ensureBookingUuid(booking);
|
|
23
|
-
if (resolved !== booking) booking.uuid = resolved.uuid;
|
|
24
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Cross-system booking identity; independent from the legacy cart-line UID. */
|
|
2
|
-
export declare function ensureBookingUuid<T extends Record<string, any>>(booking: T): T;
|
|
3
|
-
/** Retain a generated UUID on the draft so a checkout retry sends the same value. */
|
|
4
|
-
export declare function assignBookingUuid(booking: Record<string, any> | null | undefined): void;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.assignBookingUuid = assignBookingUuid;
|
|
7
|
-
exports.ensureBookingUuid = ensureBookingUuid;
|
|
8
|
-
var _orderCollectionIdentity = require("./orderCollectionIdentity");
|
|
9
|
-
/** Cross-system booking identity; independent from the legacy cart-line UID. */
|
|
10
|
-
function ensureBookingUuid(booking) {
|
|
11
|
-
if (booking.uuid) return booking;
|
|
12
|
-
// Only an explicit null confirms that an existing booking needs a UUID when saved.
|
|
13
|
-
if (booking.uuid !== null && Number(booking.schedule_event_id || booking.id) > 0) return booking;
|
|
14
|
-
return {
|
|
15
|
-
...booking,
|
|
16
|
-
uuid: (0, _orderCollectionIdentity.createUuidV4)()
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** Retain a generated UUID on the draft so a checkout retry sends the same value. */
|
|
21
|
-
function assignBookingUuid(booking) {
|
|
22
|
-
if (!booking) return;
|
|
23
|
-
const resolved = ensureBookingUuid(booking);
|
|
24
|
-
if (resolved !== booking) booking.uuid = resolved.uuid;
|
|
25
|
-
}
|