@managesome/eposmatic-toolkit 0.2.708 → 0.2.710

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.
Files changed (33) hide show
  1. package/lib/constants/ENUMS.d.ts +1 -0
  2. package/lib/constants/ENUMS.js +1 -0
  3. package/lib/helpers/types/catalog.d.ts +2 -1
  4. package/lib/helpers/utils/halfhalf-setup-helpers.js +2 -0
  5. package/lib/helpers/utils/minified-catalog.js +2 -0
  6. package/lib/helpers/utils/order-engine.js +3 -0
  7. package/lib/helpers/utils/receipt-engine.js +62 -11
  8. package/lib/helpers/utils/selection-model.d.ts +3 -0
  9. package/lib/helpers/utils/selection-model.js +1 -0
  10. package/lib/helpers/utils/simplified-halfhalf.d.ts +4 -3
  11. package/lib/helpers/utils/simplified-halfhalf.js +8 -6
  12. package/lib/helpers/utils/simplified-specials.d.ts +4 -4
  13. package/lib/helpers/utils/simplified-specials.js +10 -9
  14. package/lib/helpers/utils/specials-helpers.d.ts +3 -3
  15. package/lib/helpers/utils/specials-helpers.js +39 -7
  16. package/lib/schemas/models/items.d.ts +27 -0
  17. package/lib/schemas/models/items.js +7 -0
  18. package/lib/schemas/models/modifier_extras.d.ts +9 -9
  19. package/lib/schemas/models/orders.d.ts +981 -0
  20. package/lib/schemas/models/orders.js +5 -0
  21. package/lib/schemas/models/rewards_usage.d.ts +3 -3
  22. package/lib/schemas/models/tenant_cash_in_out.d.ts +3 -3
  23. package/lib/schemas/models/warehouse_internal_movements.d.ts +3 -3
  24. package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.d.ts +3 -3
  25. package/lib/schemas/types/items.d.ts +2 -1
  26. package/lib/schemas/types/orders.d.ts +2 -1
  27. package/lib/tests/receipt-engine.test.d.ts +1 -0
  28. package/lib/tests/receipt-engine.test.js +204 -0
  29. package/lib/tests/simplified-halfhalf.test.js +4 -4
  30. package/lib/tests/simplified-specials.test.js +6 -6
  31. package/lib/tests/specials-halfhalf-options.test.d.ts +1 -0
  32. package/lib/tests/specials-halfhalf-options.test.js +327 -0
  33. package/package.json +1 -1
@@ -123,6 +123,13 @@ const OptionSchema = new mongoose_1.Schema({
123
123
  type: [exports.SpecialHoursSchema],
124
124
  required: false,
125
125
  },
126
+ // Only set when the option IS a menu item / half-half (e.g. options of a
127
+ // special's modifier group or half-half segment choices).
128
+ ref_type: {
129
+ type: String,
130
+ enum: constants_1.ALL_MODIFIER_OPTION_REF_TYPES,
131
+ required: false,
132
+ },
126
133
  });
127
134
  const ModifiersSchema = new mongoose_1.Schema({
128
135
  _id: {
@@ -70,8 +70,8 @@ export declare const ModifierExtraSchema: Schema<any, import("mongoose").Model<a
70
70
  BASE_PRICE: number;
71
71
  };
72
72
  sold_out: string[];
73
- ref_id: string;
74
73
  ref_type: import("../../constants").MODIFIER_OPTION_REF_TYPE_ENUM;
74
+ ref_id: string;
75
75
  multiplier?: number | null | undefined;
76
76
  }, import("mongoose").Types.Subdocument<string, any, {
77
77
  _id: string;
@@ -121,8 +121,8 @@ export declare const ModifierExtraSchema: Schema<any, import("mongoose").Model<a
121
121
  BASE_PRICE: number;
122
122
  };
123
123
  sold_out: string[];
124
- ref_id: string;
125
124
  ref_type: import("../../constants").MODIFIER_OPTION_REF_TYPE_ENUM;
125
+ ref_id: string;
126
126
  multiplier?: number | null | undefined;
127
127
  }> & {
128
128
  _id: string;
@@ -172,8 +172,8 @@ export declare const ModifierExtraSchema: Schema<any, import("mongoose").Model<a
172
172
  BASE_PRICE: number;
173
173
  };
174
174
  sold_out: string[];
175
- ref_id: string;
176
175
  ref_type: import("../../constants").MODIFIER_OPTION_REF_TYPE_ENUM;
176
+ ref_id: string;
177
177
  multiplier?: number | null | undefined;
178
178
  }>;
179
179
  min_num_options?: number | null | undefined;
@@ -244,8 +244,8 @@ export declare const ModifierExtraSchema: Schema<any, import("mongoose").Model<a
244
244
  BASE_PRICE: number;
245
245
  };
246
246
  sold_out: string[];
247
- ref_id: string;
248
247
  ref_type: import("../../constants").MODIFIER_OPTION_REF_TYPE_ENUM;
248
+ ref_id: string;
249
249
  multiplier?: number | null | undefined;
250
250
  }, import("mongoose").Types.Subdocument<string, any, {
251
251
  _id: string;
@@ -295,8 +295,8 @@ export declare const ModifierExtraSchema: Schema<any, import("mongoose").Model<a
295
295
  BASE_PRICE: number;
296
296
  };
297
297
  sold_out: string[];
298
- ref_id: string;
299
298
  ref_type: import("../../constants").MODIFIER_OPTION_REF_TYPE_ENUM;
299
+ ref_id: string;
300
300
  multiplier?: number | null | undefined;
301
301
  }> & {
302
302
  _id: string;
@@ -346,8 +346,8 @@ export declare const ModifierExtraSchema: Schema<any, import("mongoose").Model<a
346
346
  BASE_PRICE: number;
347
347
  };
348
348
  sold_out: string[];
349
- ref_id: string;
350
349
  ref_type: import("../../constants").MODIFIER_OPTION_REF_TYPE_ENUM;
350
+ ref_id: string;
351
351
  multiplier?: number | null | undefined;
352
352
  }>;
353
353
  min_num_options?: number | null | undefined;
@@ -418,8 +418,8 @@ export declare const ModifierExtraSchema: Schema<any, import("mongoose").Model<a
418
418
  BASE_PRICE: number;
419
419
  };
420
420
  sold_out: string[];
421
- ref_id: string;
422
421
  ref_type: import("../../constants").MODIFIER_OPTION_REF_TYPE_ENUM;
422
+ ref_id: string;
423
423
  multiplier?: number | null | undefined;
424
424
  }, import("mongoose").Types.Subdocument<string, any, {
425
425
  _id: string;
@@ -469,8 +469,8 @@ export declare const ModifierExtraSchema: Schema<any, import("mongoose").Model<a
469
469
  BASE_PRICE: number;
470
470
  };
471
471
  sold_out: string[];
472
- ref_id: string;
473
472
  ref_type: import("../../constants").MODIFIER_OPTION_REF_TYPE_ENUM;
473
+ ref_id: string;
474
474
  multiplier?: number | null | undefined;
475
475
  }> & {
476
476
  _id: string;
@@ -520,8 +520,8 @@ export declare const ModifierExtraSchema: Schema<any, import("mongoose").Model<a
520
520
  BASE_PRICE: number;
521
521
  };
522
522
  sold_out: string[];
523
- ref_id: string;
524
523
  ref_type: import("../../constants").MODIFIER_OPTION_REF_TYPE_ENUM;
524
+ ref_id: string;
525
525
  multiplier?: number | null | undefined;
526
526
  }>;
527
527
  min_num_options?: number | null | undefined;