@managesome/eposmatic-toolkit 0.2.301 → 0.2.303

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.
@@ -33,6 +33,7 @@ export interface ICatalogItemOptionsDrawerProps<I extends ISimplifiedCatalogItem
33
33
  maxQuantity?: number;
34
34
  applyLoyalty?: IApplyLoyalty;
35
35
  applyVoucher?: IApplyVoucher;
36
+ isRewardItem?: boolean;
36
37
  onSelect?: (item: IOrderItem) => void;
37
38
  }
38
39
  interface IGetEditItemProps<I extends ISimplifiedCatalogItem | IItem> {
@@ -146,6 +146,7 @@ function getEditItemProps({ item, orderItemCategoryId, orderItem, offers, isLoya
146
146
  excludeRefs,
147
147
  excludedDiscountRefs,
148
148
  zeroPriceRefs,
149
+ isRewardItem,
149
150
  ...(isRewardItem && { maxQuantity: orderItem.quantity }),
150
151
  };
151
152
  return props;
@@ -1,4 +1,5 @@
1
1
  import { IItem, IModifier, IModifierExtra } from '../../schemas';
2
+ import { ISimplifiedCatalogItem, ISimplifiedItem } from '../types';
2
3
  export declare function getModifierOptionMultiplier(multiplier: number | null | undefined, toCents?: boolean): number | undefined;
3
4
  export declare function convertModifiersPriceFromCentsAndSort(modifiers: IModifier[] | null | undefined, removeNonActive?: boolean): IModifier[] | null;
4
5
  export declare function convertModifierExtrasPriceToCents(modifierExtra: Partial<IModifierExtra>): Partial<IModifierExtra>;
@@ -7,3 +8,4 @@ export declare function getPartialItemWithCents<T extends Partial<IItem>>(item:
7
8
  export declare function getItemWithCents<T extends IItem>(item: T): T;
8
9
  export declare function getSortedPartialItemWithPrice<T extends Partial<IItem>>(item: T): T;
9
10
  export declare function getSortedItemWithPrice<T extends IItem>(item: T): T;
11
+ export declare function getOfferRewardItem<T extends Partial<IItem> | Partial<ISimplifiedItem> | Partial<ISimplifiedCatalogItem>>(item: T): T;
@@ -8,6 +8,7 @@ exports.getPartialItemWithCents = getPartialItemWithCents;
8
8
  exports.getItemWithCents = getItemWithCents;
9
9
  exports.getSortedPartialItemWithPrice = getSortedPartialItemWithPrice;
10
10
  exports.getSortedItemWithPrice = getSortedItemWithPrice;
11
+ exports.getOfferRewardItem = getOfferRewardItem;
11
12
  const ingredients_1 = require("./ingredients");
12
13
  const platform_num_1 = require("./platform-num");
13
14
  const price_conversion_1 = require("./price-conversion");
@@ -121,3 +122,17 @@ function getSortedItemWithPrice(item) {
121
122
  ingredients: (0, ingredients_1.getIngredientsWithDecimal)(item.ingredients),
122
123
  };
123
124
  }
125
+ function getOfferRewardItem(item) {
126
+ return {
127
+ ...item,
128
+ ...(item.item_special_hours != null
129
+ ? {
130
+ item_special_hours: {
131
+ ...item.item_special_hours,
132
+ discount_amount: null,
133
+ },
134
+ }
135
+ : {}),
136
+ discount_amount: null,
137
+ };
138
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.301",
3
+ "version": "0.2.303",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",