@managesome/eposmatic-toolkit 0.2.657 → 0.2.659

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.
@@ -25,6 +25,8 @@ export type IWorkableSpecialMenu<T extends IItem | ISimplifiedCatalogItem> = {
25
25
  price: ISpecial['price'];
26
26
  discount_amount: ISpecial['discount_amount'];
27
27
  is_discount_percentage: ISpecial['is_discount_percentage'];
28
+ display_price: ISpecial['display_price'];
29
+ show_starting_from: ISpecial['show_starting_from'];
28
30
  modifier_specials: IWorkableModifierSpecial<T>[];
29
31
  };
30
32
  export declare function convertSpecialsToWorkableSpecials<T extends IItem | ISimplifiedCatalogItem>(specials: ISpecial[], itemsMap: Record<string, T>, platform: PLATFORMS_ENUM | undefined, tenant_id: string | undefined): IWorkableSpecialMenu<T>[];
@@ -18,6 +18,7 @@ const store_1 = require("../store");
18
18
  const order_engine_1 = require("./order-engine");
19
19
  const platform_catalog_1 = require("./platform-catalog");
20
20
  const platform_num_1 = require("./platform-num");
21
+ const price_conversion_1 = require("./price-conversion");
21
22
  function getSpecialsPostedData(data, payload) {
22
23
  return data.some((special) => special._id === payload._id)
23
24
  ? data
@@ -50,10 +51,12 @@ function getSpecialsDeletedData(data, payload) {
50
51
  function getSpecialWithPrice(special, writeable) {
51
52
  const convertToPrice = writeable ? platform_num_1.convertPriceObjToCents : platform_num_1.convertPriceObjFromCents;
52
53
  const convertItemSpecialHours = writeable ? platform_num_1.convertSpecialHoursToCents : platform_num_1.convertSpecialHoursFromCents;
54
+ const convertNumPrice = writeable ? price_conversion_1.convertPriceToCents : price_conversion_1.convertPriceFromCents;
53
55
  return {
54
56
  ...special,
55
57
  ...(special.price != null ? { price: convertToPrice(special.price) } : {}),
56
58
  ...(special.discount_amount != null ? { discount_amount: convertToPrice(special.discount_amount) } : {}),
59
+ ...(special.display_price != null ? { display_price: convertNumPrice(special.display_price) } : {}),
57
60
  ...(special.item_special_hours != null
58
61
  ? {
59
62
  item_special_hours: convertItemSpecialHours(special.item_special_hours),
@@ -146,6 +149,8 @@ function convertSpecialsToWorkableSpecials(specials, itemsMap, platform, tenant_
146
149
  price,
147
150
  discount_amount,
148
151
  is_discount_percentage: special.is_discount_percentage,
152
+ display_price: special.display_price,
153
+ show_starting_from: special.show_starting_from,
149
154
  modifier_specials: modifierSpecials,
150
155
  };
151
156
  specialsMenu.push(specialMenu);
@@ -395,8 +400,8 @@ function convertSpecialToItem(special, itemsMap, platform, tenant_id) {
395
400
  modifiers: modifiers.length > 0 ? modifiers : null,
396
401
  is_featured: false,
397
402
  featured_sort_id: 0,
398
- display_price: null,
399
- show_starting_from: false,
403
+ display_price: special.display_price,
404
+ show_starting_from: special.show_starting_from,
400
405
  use_source_ingredients: false,
401
406
  createdAt: special.createdAt,
402
407
  updatedAt: special.updatedAt,
@@ -539,6 +539,7 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
539
539
  BASE_PRICE: number;
540
540
  } | null | undefined;
541
541
  }>;
542
+ display_price: number;
542
543
  modifier_specials: import("mongoose").Types.DocumentArray<{
543
544
  _id: import("mongoose").Types.ObjectId;
544
545
  name: string;
@@ -984,6 +985,7 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
984
985
  num_free_items: number;
985
986
  omit_items_schedule: boolean;
986
987
  }>;
988
+ show_starting_from?: boolean | null | undefined;
987
989
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
988
990
  createdAt: NativeDate;
989
991
  updatedAt: NativeDate;
@@ -1374,6 +1376,7 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
1374
1376
  BASE_PRICE: number;
1375
1377
  } | null | undefined;
1376
1378
  }>;
1379
+ display_price: number;
1377
1380
  modifier_specials: import("mongoose").Types.DocumentArray<{
1378
1381
  _id: import("mongoose").Types.ObjectId;
1379
1382
  name: string;
@@ -1819,6 +1822,7 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
1819
1822
  num_free_items: number;
1820
1823
  omit_items_schedule: boolean;
1821
1824
  }>;
1825
+ show_starting_from?: boolean | null | undefined;
1822
1826
  }>> & import("mongoose").FlatRecord<{
1823
1827
  createdAt: NativeDate;
1824
1828
  updatedAt: NativeDate;
@@ -2209,6 +2213,7 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
2209
2213
  BASE_PRICE: number;
2210
2214
  } | null | undefined;
2211
2215
  }>;
2216
+ display_price: number;
2212
2217
  modifier_specials: import("mongoose").Types.DocumentArray<{
2213
2218
  _id: import("mongoose").Types.ObjectId;
2214
2219
  name: string;
@@ -2654,6 +2659,7 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
2654
2659
  num_free_items: number;
2655
2660
  omit_items_schedule: boolean;
2656
2661
  }>;
2662
+ show_starting_from?: boolean | null | undefined;
2657
2663
  }> & Required<{
2658
2664
  _id: import("mongoose").Types.ObjectId;
2659
2665
  }> & {
@@ -124,6 +124,14 @@ exports.SpecialsSchema = new mongoose_1.Schema({
124
124
  type: Boolean,
125
125
  default: false,
126
126
  },
127
+ display_price: {
128
+ type: Number,
129
+ default: null,
130
+ },
131
+ show_starting_from: {
132
+ type: Boolean,
133
+ required: false,
134
+ },
127
135
  item_special_hours: {
128
136
  type: [items_1.SpecialHoursSchema],
129
137
  default: null,
@@ -32,6 +32,8 @@ export interface ISpecial {
32
32
  price: IPrice | null;
33
33
  discount_amount: IPrice | null;
34
34
  is_discount_percentage: boolean;
35
+ display_price?: number | null;
36
+ show_starting_from?: boolean;
35
37
  item_special_hours: IItemSpecialHour[] | null;
36
38
  modifier_specials: IModifierSpecial[];
37
39
  createdAt: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.657",
3
+ "version": "0.2.659",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",