@managesome/eposmatic-toolkit 0.2.528 → 0.2.530

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.
@@ -407,6 +407,7 @@ function syncOrderData(order) {
407
407
  }
408
408
  function getVoidItemsWithReason({ currentCategories, iterationsFromFrontend, previousCategories, platform, }) {
409
409
  const voidOrderItemReasonsMap = {};
410
+ const voidOrderItemIsReadyMap = {};
410
411
  const latestIterationCategories = iterationsFromFrontend?.[0]?.categories;
411
412
  if (latestIterationCategories != null && latestIterationCategories.length > 0) {
412
413
  for (let i = 0; i < latestIterationCategories.length; i++) {
@@ -416,6 +417,9 @@ function getVoidItemsWithReason({ currentCategories, iterationsFromFrontend, pre
416
417
  if (item.void_reason != null && item.void_reason.length > 0) {
417
418
  voidOrderItemReasonsMap[item._id] = item.void_reason;
418
419
  }
420
+ if (item.is_ready != null) {
421
+ voidOrderItemIsReadyMap[item._id] = item.is_ready;
422
+ }
419
423
  }
420
424
  }
421
425
  }
@@ -435,8 +439,10 @@ function getVoidItemsWithReason({ currentCategories, iterationsFromFrontend, pre
435
439
  for (let i = 0; i < removedItems.length; i++) {
436
440
  const { orderItem } = removedItems[i];
437
441
  const voidReason = voidOrderItemReasonsMap[orderItem._id];
442
+ const isReady = voidOrderItemIsReadyMap[orderItem._id];
438
443
  voidOrderItems.push({
439
444
  ...orderItem,
445
+ ...(isReady != null ? { is_ready: isReady } : {}),
440
446
  subtotal: Math.round(orderItem.subtotal),
441
447
  void_reason: voidReason ?? '-',
442
448
  });
@@ -451,6 +457,7 @@ function getVoidItemsWithReason({ currentCategories, iterationsFromFrontend, pre
451
457
  for (let j = 0; j < category.items.length; j++) {
452
458
  const prevItem = category.items[j];
453
459
  const voidReason = newVoidOrderItemReasonsMap[prevItem._id];
460
+ const isReady = voidOrderItemIsReadyMap[prevItem._id];
454
461
  const orderItem = {
455
462
  ...prevItem,
456
463
  subtotal: Math.round(prevItem.subtotal),
@@ -458,6 +465,9 @@ function getVoidItemsWithReason({ currentCategories, iterationsFromFrontend, pre
458
465
  if (voidReason != null) {
459
466
  orderItem.void_reason = voidReason;
460
467
  }
468
+ if (isReady != null) {
469
+ orderItem.is_ready = isReady;
470
+ }
461
471
  newCategoryItems.push(orderItem);
462
472
  }
463
473
  if (newCategoryItems.length === 0)
@@ -179,6 +179,7 @@ export interface ISettingsForPOS {
179
179
  apply_tax_on_complimentary_payment: ITenant['apply_tax_on_complimentary_payment'];
180
180
  pos_enable_internal_auth: ITenant['pos_enable_internal_auth'];
181
181
  subscription_expiry: ITenant['subscription_expiry'];
182
+ enable_inventory: ITenant['enable_inventory'];
182
183
  omit_offers_for_anonymous: ITenant['omit_offers_for_anonymous'];
183
184
  apply_service_fee_on_original_price: ITenant['apply_service_fee_on_original_price'];
184
185
  operational_start_time: ITenant['operational_start_time'];
@@ -296,6 +296,7 @@ function getSettingsForPOS(settings) {
296
296
  apply_tax_on_complimentary_payment: settings.apply_tax_on_complimentary_payment,
297
297
  pos_enable_internal_auth: settings.pos_enable_internal_auth,
298
298
  subscription_expiry: settings.subscription_expiry,
299
+ enable_inventory: settings.enable_inventory,
299
300
  omit_offers_for_anonymous: settings.omit_offers_for_anonymous,
300
301
  apply_service_fee_on_original_price: settings.apply_service_fee_on_original_price,
301
302
  operational_start_time: settings.operational_start_time,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.528",
3
+ "version": "0.2.530",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",