@managesome/eposmatic-toolkit 0.2.653 → 0.2.654
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/lib/helpers/utils/simplified-tenant.d.ts +1 -0
- package/lib/helpers/utils/simplified-tenant.js +1 -0
- package/lib/helpers/utils/specials-helpers.d.ts +1 -0
- package/lib/helpers/utils/specials-helpers.js +2 -1
- package/lib/schemas/models/halfhalf_setup.d.ts +14 -0
- package/lib/schemas/models/halfhalf_setup.js +16 -4
- package/lib/schemas/models/specials.d.ts +18 -0
- package/lib/schemas/models/specials.js +18 -1
- package/lib/schemas/models/tenants.d.ts +3 -0
- package/lib/schemas/models/tenants.js +4 -0
- package/lib/schemas/types/specials.d.ts +1 -0
- package/lib/schemas/types/tenants.d.ts +1 -0
- package/package.json +1 -1
|
@@ -175,6 +175,7 @@ export interface ISettingsForPOS {
|
|
|
175
175
|
card_processing_account_id: ITenant['card_processing_account_id'];
|
|
176
176
|
custom_payment_types: ITenant['custom_payment_types'];
|
|
177
177
|
pos_enable_card_payments: ITenant['pos_enable_card_payments'];
|
|
178
|
+
pos_enable_classic_specials_preview: ITenant['pos_enable_classic_specials_preview'];
|
|
178
179
|
pos_accedental_touch_protection_enabled: ITenant['pos_accedental_touch_protection_enabled'];
|
|
179
180
|
apply_tax_on_complimentary_payment: ITenant['apply_tax_on_complimentary_payment'];
|
|
180
181
|
pos_enable_internal_auth: ITenant['pos_enable_internal_auth'];
|
|
@@ -292,6 +292,7 @@ function getSettingsForPOS(settings) {
|
|
|
292
292
|
card_processing_account_id: settings.card_processing_account_id,
|
|
293
293
|
custom_payment_types: settings.custom_payment_types,
|
|
294
294
|
pos_enable_card_payments: settings.pos_enable_card_payments,
|
|
295
|
+
pos_enable_classic_specials_preview: settings.pos_enable_classic_specials_preview,
|
|
295
296
|
pos_accedental_touch_protection_enabled: settings.pos_accedental_touch_protection_enabled,
|
|
296
297
|
apply_tax_on_complimentary_payment: settings.apply_tax_on_complimentary_payment,
|
|
297
298
|
pos_enable_internal_auth: settings.pos_enable_internal_auth,
|
|
@@ -21,6 +21,7 @@ export type IWorkableSpecialMenu<T extends IItem | ISimplifiedCatalogItem> = {
|
|
|
21
21
|
description: ISpecial['description'];
|
|
22
22
|
sold_out: T['sold_out'];
|
|
23
23
|
image_url: ISpecial['image_url'];
|
|
24
|
+
category_id: ISpecial['category_id'];
|
|
24
25
|
price: ISpecial['price'];
|
|
25
26
|
discount_amount: ISpecial['discount_amount'];
|
|
26
27
|
is_discount_percentage: ISpecial['is_discount_percentage'];
|
|
@@ -141,6 +141,7 @@ function convertSpecialsToWorkableSpecials(specials, itemsMap, platform, tenant_
|
|
|
141
141
|
description: special.description,
|
|
142
142
|
sold_out: isSimple ? special.sold_out.includes(tenant_id) : special.sold_out,
|
|
143
143
|
image_url: special.image_url,
|
|
144
|
+
category_id: special.category_id,
|
|
144
145
|
price,
|
|
145
146
|
discount_amount,
|
|
146
147
|
is_discount_percentage: special.is_discount_percentage,
|
|
@@ -321,7 +322,7 @@ function convertSpecialToItem(special, itemsMap, platform, tenant_id) {
|
|
|
321
322
|
_id: special._id,
|
|
322
323
|
brand_id: special.brand_id,
|
|
323
324
|
tenants: special.tenants,
|
|
324
|
-
category_id: constants_1.SPECIALS_CATEGORY_ID,
|
|
325
|
+
category_id: special.category_id ?? constants_1.SPECIALS_CATEGORY_ID,
|
|
325
326
|
included_platforms: special.included_platforms,
|
|
326
327
|
name: special.name,
|
|
327
328
|
hide_name: false,
|
|
@@ -1605,3 +1605,17 @@ export declare const HalfHalfSetupSchema: Schema<any, import("mongoose").Model<a
|
|
|
1605
1605
|
__v: number;
|
|
1606
1606
|
}>;
|
|
1607
1607
|
export declare const HALFHALF_COLLECTION_NAME = "halfhalf_setup";
|
|
1608
|
+
/**
|
|
1609
|
+
* Describes the indexes for `halfhalf_setup`. Values are Mongo key patterns
|
|
1610
|
+
* that can be passed straight to `.hint()`.
|
|
1611
|
+
* - `_id`: unique primary key.
|
|
1612
|
+
* - `tenants`: multikey index on the tenants array for per-tenant lookups.
|
|
1613
|
+
*/
|
|
1614
|
+
export declare const HALFHALF_COLLECTION_INDEXES: {
|
|
1615
|
+
_id: {
|
|
1616
|
+
_id: number;
|
|
1617
|
+
};
|
|
1618
|
+
tenants: {
|
|
1619
|
+
tenants: number;
|
|
1620
|
+
};
|
|
1621
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HALFHALF_COLLECTION_NAME = exports.HalfHalfSetupSchema = void 0;
|
|
3
|
+
exports.HALFHALF_COLLECTION_INDEXES = exports.HALFHALF_COLLECTION_NAME = exports.HalfHalfSetupSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
|
+
const categories_1 = require("./categories");
|
|
5
6
|
const common_models_1 = require("./common-models");
|
|
6
7
|
const items_1 = require("./items");
|
|
7
8
|
const specials_1 = require("./specials");
|
|
9
|
+
const tenants_1 = require("./tenants");
|
|
8
10
|
exports.HalfHalfSetupSchema = new mongoose_1.Schema({
|
|
9
11
|
_id: {
|
|
10
12
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
@@ -18,14 +20,14 @@ exports.HalfHalfSetupSchema = new mongoose_1.Schema({
|
|
|
18
20
|
ref: 'brands',
|
|
19
21
|
},
|
|
20
22
|
tenants: {
|
|
21
|
-
type: [{ type: String, ref:
|
|
23
|
+
type: [{ type: String, ref: tenants_1.TENANTS_COLLECTION_NAME }],
|
|
22
24
|
required: true,
|
|
23
25
|
},
|
|
24
26
|
category_id: {
|
|
25
27
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
26
28
|
required: true,
|
|
27
29
|
immutable: true,
|
|
28
|
-
ref:
|
|
30
|
+
ref: categories_1.CATEGORIES_COLLECTION_NAME,
|
|
29
31
|
},
|
|
30
32
|
included_platforms: {
|
|
31
33
|
type: [items_1.PlatformsSchema],
|
|
@@ -55,7 +57,7 @@ exports.HalfHalfSetupSchema = new mongoose_1.Schema({
|
|
|
55
57
|
default: true,
|
|
56
58
|
},
|
|
57
59
|
sold_out: {
|
|
58
|
-
type: [{ type: String, ref:
|
|
60
|
+
type: [{ type: String, ref: tenants_1.TENANTS_COLLECTION_NAME }],
|
|
59
61
|
default: [],
|
|
60
62
|
},
|
|
61
63
|
upsell_price: {
|
|
@@ -107,3 +109,13 @@ exports.HalfHalfSetupSchema = new mongoose_1.Schema({
|
|
|
107
109
|
minimize: false,
|
|
108
110
|
});
|
|
109
111
|
exports.HALFHALF_COLLECTION_NAME = 'halfhalf_setup';
|
|
112
|
+
/**
|
|
113
|
+
* Describes the indexes for `halfhalf_setup`. Values are Mongo key patterns
|
|
114
|
+
* that can be passed straight to `.hint()`.
|
|
115
|
+
* - `_id`: unique primary key.
|
|
116
|
+
* - `tenants`: multikey index on the tenants array for per-tenant lookups.
|
|
117
|
+
*/
|
|
118
|
+
exports.HALFHALF_COLLECTION_INDEXES = {
|
|
119
|
+
_id: { _id: 1 }, // Unique Index
|
|
120
|
+
tenants: { tenants: 1 }, // multikey index — per-tenant lookups
|
|
121
|
+
};
|
|
@@ -205,6 +205,7 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
205
205
|
brand_id: string;
|
|
206
206
|
active: boolean;
|
|
207
207
|
sort_id: number;
|
|
208
|
+
category_id: import("mongoose").Types.ObjectId;
|
|
208
209
|
description: string;
|
|
209
210
|
price: {
|
|
210
211
|
"POS_WALK-IN": number;
|
|
@@ -1039,6 +1040,7 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
1039
1040
|
brand_id: string;
|
|
1040
1041
|
active: boolean;
|
|
1041
1042
|
sort_id: number;
|
|
1043
|
+
category_id: import("mongoose").Types.ObjectId;
|
|
1042
1044
|
description: string;
|
|
1043
1045
|
price: {
|
|
1044
1046
|
"POS_WALK-IN": number;
|
|
@@ -1873,6 +1875,7 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
1873
1875
|
brand_id: string;
|
|
1874
1876
|
active: boolean;
|
|
1875
1877
|
sort_id: number;
|
|
1878
|
+
category_id: import("mongoose").Types.ObjectId;
|
|
1876
1879
|
description: string;
|
|
1877
1880
|
price: {
|
|
1878
1881
|
"POS_WALK-IN": number;
|
|
@@ -2657,3 +2660,18 @@ export declare const SpecialsSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
2657
2660
|
__v: number;
|
|
2658
2661
|
}>;
|
|
2659
2662
|
export declare const SPECIAL_COLLECTION_NAME = "specials";
|
|
2663
|
+
/**
|
|
2664
|
+
* Describes the indexes for `specials`. Values are Mongo key patterns that can
|
|
2665
|
+
* be passed straight to `.hint()`.
|
|
2666
|
+
* - `_id`: unique primary key.
|
|
2667
|
+
* - `tenants`: multikey index on the tenants array for per-tenant special
|
|
2668
|
+
* lookups.
|
|
2669
|
+
*/
|
|
2670
|
+
export declare const SPECIAL_COLLECTION_INDEXES: {
|
|
2671
|
+
_id: {
|
|
2672
|
+
_id: number;
|
|
2673
|
+
};
|
|
2674
|
+
tenants: {
|
|
2675
|
+
tenants: number;
|
|
2676
|
+
};
|
|
2677
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SPECIAL_COLLECTION_NAME = exports.SpecialsSchema = exports.SpecialItemSchema = void 0;
|
|
3
|
+
exports.SPECIAL_COLLECTION_INDEXES = exports.SPECIAL_COLLECTION_NAME = exports.SpecialsSchema = exports.SpecialItemSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
|
+
const categories_1 = require("./categories");
|
|
5
6
|
const common_models_1 = require("./common-models");
|
|
6
7
|
const items_1 = require("./items");
|
|
7
8
|
exports.SpecialItemSchema = new mongoose_1.Schema({
|
|
@@ -77,6 +78,11 @@ exports.SpecialsSchema = new mongoose_1.Schema({
|
|
|
77
78
|
type: [{ type: String, ref: 'tenants' }],
|
|
78
79
|
required: true,
|
|
79
80
|
},
|
|
81
|
+
category_id: {
|
|
82
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
83
|
+
required: true,
|
|
84
|
+
ref: categories_1.CATEGORIES_COLLECTION_NAME,
|
|
85
|
+
},
|
|
80
86
|
included_platforms: {
|
|
81
87
|
type: [items_1.PlatformsSchema],
|
|
82
88
|
required: true,
|
|
@@ -143,3 +149,14 @@ exports.SpecialsSchema = new mongoose_1.Schema({
|
|
|
143
149
|
minimize: false,
|
|
144
150
|
});
|
|
145
151
|
exports.SPECIAL_COLLECTION_NAME = 'specials';
|
|
152
|
+
/**
|
|
153
|
+
* Describes the indexes for `specials`. Values are Mongo key patterns that can
|
|
154
|
+
* be passed straight to `.hint()`.
|
|
155
|
+
* - `_id`: unique primary key.
|
|
156
|
+
* - `tenants`: multikey index on the tenants array for per-tenant special
|
|
157
|
+
* lookups.
|
|
158
|
+
*/
|
|
159
|
+
exports.SPECIAL_COLLECTION_INDEXES = {
|
|
160
|
+
_id: { _id: 1 }, // Unique Index
|
|
161
|
+
tenants: { tenants: 1 }, // multikey index — per-tenant special lookups
|
|
162
|
+
};
|
|
@@ -141,6 +141,7 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
141
141
|
twitter_link?: string | null | undefined;
|
|
142
142
|
tiktok_link?: string | null | undefined;
|
|
143
143
|
pos_pre_ordering_days?: number | null | undefined;
|
|
144
|
+
pos_enable_classic_specials_preview?: boolean | null | undefined;
|
|
144
145
|
pos_accedental_touch_protection_enabled?: boolean | null | undefined;
|
|
145
146
|
web_enable_pre_ordering?: boolean | null | undefined;
|
|
146
147
|
web_pre_ordering_visibility_minutes?: number | null | undefined;
|
|
@@ -322,6 +323,7 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
322
323
|
twitter_link?: string | null | undefined;
|
|
323
324
|
tiktok_link?: string | null | undefined;
|
|
324
325
|
pos_pre_ordering_days?: number | null | undefined;
|
|
326
|
+
pos_enable_classic_specials_preview?: boolean | null | undefined;
|
|
325
327
|
pos_accedental_touch_protection_enabled?: boolean | null | undefined;
|
|
326
328
|
web_enable_pre_ordering?: boolean | null | undefined;
|
|
327
329
|
web_pre_ordering_visibility_minutes?: number | null | undefined;
|
|
@@ -503,6 +505,7 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
503
505
|
twitter_link?: string | null | undefined;
|
|
504
506
|
tiktok_link?: string | null | undefined;
|
|
505
507
|
pos_pre_ordering_days?: number | null | undefined;
|
|
508
|
+
pos_enable_classic_specials_preview?: boolean | null | undefined;
|
|
506
509
|
pos_accedental_touch_protection_enabled?: boolean | null | undefined;
|
|
507
510
|
web_enable_pre_ordering?: boolean | null | undefined;
|
|
508
511
|
web_pre_ordering_visibility_minutes?: number | null | undefined;
|
|
@@ -180,6 +180,10 @@ exports.TenantSchema = new mongoose_1.Schema({
|
|
|
180
180
|
type: Boolean,
|
|
181
181
|
default: true,
|
|
182
182
|
},
|
|
183
|
+
pos_enable_classic_specials_preview: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
required: false,
|
|
186
|
+
},
|
|
183
187
|
pos_min_takeaway_order_value: {
|
|
184
188
|
type: Number,
|
|
185
189
|
default: 0,
|
|
@@ -43,6 +43,7 @@ export interface ITenant {
|
|
|
43
43
|
pos_opt_in_for_holiday_surcharge: boolean;
|
|
44
44
|
pos_holiday_surcharge: number;
|
|
45
45
|
pos_enable_card_payments: boolean;
|
|
46
|
+
pos_enable_classic_specials_preview?: boolean;
|
|
46
47
|
pos_min_takeaway_order_value: number;
|
|
47
48
|
pos_end_seating_when_order_paid_off: boolean;
|
|
48
49
|
pos_accedental_touch_protection_enabled?: boolean;
|