@pisell/pisellos 2.1.145 → 2.1.147
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/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/solution/ScanOrder/index.js +8 -7
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/solution/ScanOrder/index.js +6 -5
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ export declare class QuotationModule extends BaseModule implements Module {
|
|
|
19
19
|
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
20
20
|
* Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
|
|
21
21
|
*
|
|
22
|
-
* Priority: iterates quotations already sorted by `sort`
|
|
22
|
+
* Priority: iterates quotations already sorted by `sort` descending (highest = highest priority).
|
|
23
23
|
* First matching quotation whose schedule covers `datetime` and whose product_data contains
|
|
24
24
|
* the requested productId wins.
|
|
25
25
|
*/
|
|
@@ -89,7 +89,7 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
89
89
|
res = _context2.sent;
|
|
90
90
|
list = (res === null || res === void 0 || (_data = res.data) === null || _data === void 0 ? void 0 : _data.list) || (res === null || res === void 0 ? void 0 : res.list) || [];
|
|
91
91
|
list.sort(function (a, b) {
|
|
92
|
-
return
|
|
92
|
+
return b.sort - a.sort;
|
|
93
93
|
});
|
|
94
94
|
this.store.list = list;
|
|
95
95
|
case 9:
|
|
@@ -113,7 +113,7 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
113
113
|
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
114
114
|
* Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
|
|
115
115
|
*
|
|
116
|
-
* Priority: iterates quotations already sorted by `sort`
|
|
116
|
+
* Priority: iterates quotations already sorted by `sort` descending (highest = highest priority).
|
|
117
117
|
* First matching quotation whose schedule covers `datetime` and whose product_data contains
|
|
118
118
|
* the requested productId wins.
|
|
119
119
|
*/
|
|
@@ -1349,7 +1349,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1349
1349
|
var resourceState = this.store.resource;
|
|
1350
1350
|
var resourceSelectType = resourceState === null || resourceState === void 0 ? void 0 : resourceState.resourceSelectType;
|
|
1351
1351
|
|
|
1352
|
-
//
|
|
1352
|
+
// 无 collect_pax 时的资源占用兜底:single 独占整张桌台,其余模式占 1 个容量位。
|
|
1353
1353
|
var resolveResourceCapacity = function resolveResourceCapacity() {
|
|
1354
1354
|
if (resourceSelectType === 'single') {
|
|
1355
1355
|
var _resourceState$table_;
|
|
@@ -1361,10 +1361,13 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1361
1361
|
return 1;
|
|
1362
1362
|
};
|
|
1363
1363
|
return function (payload, _ref3) {
|
|
1364
|
-
var _tempOrder$resource_i, _ref4, _pickOriginal, _resourceState$table_2, _resourceState$relati,
|
|
1364
|
+
var _tempOrder$resource_i, _tempOrder$metadata, _ref4, _pickOriginal, _resourceState$table_2, _resourceState$relati, _pickFirstCustomCapac;
|
|
1365
1365
|
var bookingUuid = _ref3.bookingUuid,
|
|
1366
1366
|
tempOrder = _ref3.tempOrder;
|
|
1367
1367
|
var resourceId = (_tempOrder$resource_i = tempOrder.resource_id) !== null && _tempOrder$resource_i !== void 0 ? _tempOrder$resource_i : resourceState === null || resourceState === void 0 ? void 0 : resourceState.relationId;
|
|
1368
|
+
var rawCollectPax = (_tempOrder$metadata = tempOrder.metadata) === null || _tempOrder$metadata === void 0 ? void 0 : _tempOrder$metadata.collect_pax;
|
|
1369
|
+
var hasCollectPaxForCapacity = rawCollectPax !== null && rawCollectPax !== undefined && rawCollectPax !== '';
|
|
1370
|
+
var resourceCapacityValue = hasCollectPaxForCapacity ? normalizeSubmitCollectPaxValue(rawCollectPax) : resolveResourceCapacity();
|
|
1368
1371
|
var pickOriginal = function pickOriginal(value) {
|
|
1369
1372
|
if (value && _typeof(value) === 'object' && !Array.isArray(value)) {
|
|
1370
1373
|
var original = value.original;
|
|
@@ -1380,17 +1383,15 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1380
1383
|
main_field: mainField,
|
|
1381
1384
|
form_id: resourceState.tableFormId,
|
|
1382
1385
|
relation_id: (_resourceState$relati = resourceState.relationId) !== null && _resourceState$relati !== void 0 ? _resourceState$relati : resourceId,
|
|
1383
|
-
capacity:
|
|
1386
|
+
capacity: resourceCapacityValue,
|
|
1384
1387
|
metadata: _this5.buildScanOrderResourceMetadata({
|
|
1385
1388
|
resourceState: resourceState,
|
|
1386
1389
|
resourceName: mainField
|
|
1387
1390
|
})
|
|
1388
1391
|
} : undefined;
|
|
1389
1392
|
var ruleProductUid = ruleProduct ? createUuidV4() : undefined;
|
|
1390
|
-
//
|
|
1391
|
-
var
|
|
1392
|
-
var hasCollectPaxForCapacity = rawCollectPax !== null && rawCollectPax !== undefined && rawCollectPax !== '';
|
|
1393
|
-
var bookingCapacityValue = hasCollectPaxForCapacity ? normalizeSubmitCollectPaxValue(rawCollectPax) : resolveResourceCapacity();
|
|
1393
|
+
// 有 collect_pax 时 booking/resource capacity 都代表本次 pax;否则使用资源占用兜底值。
|
|
1394
|
+
var bookingCapacityValue = resourceCapacityValue;
|
|
1394
1395
|
var bookingCapacityDimensionId = (_pickFirstCustomCapac = pickFirstCustomCapacityDimensionId(_this5.enabledReservationRuleProducts)) !== null && _pickFirstCustomCapac !== void 0 ? _pickFirstCustomCapac : 0;
|
|
1395
1396
|
var nextBookings = (payload.bookings || []).map(function (booking, idx) {
|
|
1396
1397
|
return _objectSpread(_objectSpread(_objectSpread({}, booking), {}, {
|
|
@@ -19,7 +19,7 @@ export declare class QuotationModule extends BaseModule implements Module {
|
|
|
19
19
|
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
20
20
|
* Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
|
|
21
21
|
*
|
|
22
|
-
* Priority: iterates quotations already sorted by `sort`
|
|
22
|
+
* Priority: iterates quotations already sorted by `sort` descending (highest = highest priority).
|
|
23
23
|
* First matching quotation whose schedule covers `datetime` and whose product_data contains
|
|
24
24
|
* the requested productId wins.
|
|
25
25
|
*/
|
|
@@ -52,7 +52,7 @@ var QuotationModule = class extends import_BaseModule.BaseModule {
|
|
|
52
52
|
{ useCache: false }
|
|
53
53
|
);
|
|
54
54
|
const list = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || (res == null ? void 0 : res.list) || [];
|
|
55
|
-
list.sort((a, b) =>
|
|
55
|
+
list.sort((a, b) => b.sort - a.sort);
|
|
56
56
|
this.store.list = list;
|
|
57
57
|
}
|
|
58
58
|
getQuotationList() {
|
|
@@ -62,7 +62,7 @@ var QuotationModule = class extends import_BaseModule.BaseModule {
|
|
|
62
62
|
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
63
63
|
* Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
|
|
64
64
|
*
|
|
65
|
-
* Priority: iterates quotations already sorted by `sort`
|
|
65
|
+
* Priority: iterates quotations already sorted by `sort` descending (highest = highest priority).
|
|
66
66
|
* First matching quotation whose schedule covers `datetime` and whose product_data contains
|
|
67
67
|
* the requested productId wins.
|
|
68
68
|
*/
|
|
@@ -838,6 +838,9 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
838
838
|
return (payload, { bookingUuid, tempOrder }) => {
|
|
839
839
|
var _a, _b;
|
|
840
840
|
const resourceId = tempOrder.resource_id ?? (resourceState == null ? void 0 : resourceState.relationId);
|
|
841
|
+
const rawCollectPax = (_a = tempOrder.metadata) == null ? void 0 : _a.collect_pax;
|
|
842
|
+
const hasCollectPaxForCapacity = rawCollectPax !== null && rawCollectPax !== void 0 && rawCollectPax !== "";
|
|
843
|
+
const resourceCapacityValue = hasCollectPaxForCapacity ? (0, import_utils2.normalizeSubmitCollectPaxValue)(rawCollectPax) : resolveResourceCapacity();
|
|
841
844
|
const pickOriginal = (value) => {
|
|
842
845
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
843
846
|
const original = value.original;
|
|
@@ -845,7 +848,7 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
845
848
|
}
|
|
846
849
|
return void 0;
|
|
847
850
|
};
|
|
848
|
-
const mainField = pickOriginal(tempOrder.table_number) ?? pickOriginal((
|
|
851
|
+
const mainField = pickOriginal(tempOrder.table_number) ?? pickOriginal((_b = resourceState == null ? void 0 : resourceState.table_form_record) == null ? void 0 : _b.name) ?? "";
|
|
849
852
|
const resourceEntry = resourceState && resourceId ? {
|
|
850
853
|
relation_type: "form",
|
|
851
854
|
like_status: "common",
|
|
@@ -853,16 +856,14 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
853
856
|
main_field: mainField,
|
|
854
857
|
form_id: resourceState.tableFormId,
|
|
855
858
|
relation_id: resourceState.relationId ?? resourceId,
|
|
856
|
-
capacity:
|
|
859
|
+
capacity: resourceCapacityValue,
|
|
857
860
|
metadata: this.buildScanOrderResourceMetadata({
|
|
858
861
|
resourceState,
|
|
859
862
|
resourceName: mainField
|
|
860
863
|
})
|
|
861
864
|
} : void 0;
|
|
862
865
|
const ruleProductUid = ruleProduct ? (0, import_utils2.createUuidV4)() : void 0;
|
|
863
|
-
const
|
|
864
|
-
const hasCollectPaxForCapacity = rawCollectPax !== null && rawCollectPax !== void 0 && rawCollectPax !== "";
|
|
865
|
-
const bookingCapacityValue = hasCollectPaxForCapacity ? (0, import_utils2.normalizeSubmitCollectPaxValue)(rawCollectPax) : resolveResourceCapacity();
|
|
866
|
+
const bookingCapacityValue = resourceCapacityValue;
|
|
866
867
|
const bookingCapacityDimensionId = (0, import_utils.pickFirstCustomCapacityDimensionId)(this.enabledReservationRuleProducts) ?? 0;
|
|
867
868
|
const nextBookings = (payload.bookings || []).map((booking, idx) => ({
|
|
868
869
|
...booking,
|