@foodtolls/common 2.1.0 → 2.2.1
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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/inventory.interface.d.ts +3 -74
- package/dist/interfaces/inventory.interface.js +1 -6
- package/dist/interfaces/inventory.interface.js.map +1 -1
- package/dist/interfaces/menu.interface.d.ts +180 -0
- package/dist/interfaces/menu.interface.js +23 -0
- package/dist/interfaces/menu.interface.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/menu.util.d.ts +2 -2
- package/dist/utils/menu.util.js +8 -8
- package/dist/utils/menu.util.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/interfaces/inventory.interface.ts +3 -82
- package/src/interfaces/menu.interface.ts +240 -0
- package/src/utils/menu.util.ts +6 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./interfaces/orderTrack.interface";
|
|
|
9
9
|
export * from "./interfaces/inventory.interface";
|
|
10
10
|
export * from "./interfaces/gmap.interface";
|
|
11
11
|
export * from "./interfaces/notification.interface";
|
|
12
|
+
export * from "./interfaces/menu.interface";
|
|
12
13
|
export * from "./utils/menu.util";
|
|
13
14
|
export * from "./utils/reachTimeSelection";
|
|
14
15
|
export * from "./saga";
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __exportStar(require("./interfaces/orderTrack.interface"), exports);
|
|
|
25
25
|
__exportStar(require("./interfaces/inventory.interface"), exports);
|
|
26
26
|
__exportStar(require("./interfaces/gmap.interface"), exports);
|
|
27
27
|
__exportStar(require("./interfaces/notification.interface"), exports);
|
|
28
|
+
__exportStar(require("./interfaces/menu.interface"), exports);
|
|
28
29
|
__exportStar(require("./utils/menu.util"), exports);
|
|
29
30
|
__exportStar(require("./utils/reachTimeSelection"), exports);
|
|
30
31
|
__exportStar(require("./saga"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,sDAAoC;AACpC,uDAAqC;AACrC,oDAAkC;AAClC,4DAA0C;AAC1C,8DAA4C;AAC5C,+DAA6C;AAC7C,oEAAkD;AAClD,mEAAiD;AACjD,8DAA4C;AAC5C,sEAAoD;AACpD,oDAAkC;AAClC,6DAA2C;AAC3C,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,sDAAoC;AACpC,uDAAqC;AACrC,oDAAkC;AAClC,4DAA0C;AAC1C,8DAA4C;AAC5C,+DAA6C;AAC7C,oEAAkD;AAClD,mEAAiD;AACjD,8DAA4C;AAC5C,sEAAoD;AACpD,8DAA4C;AAC5C,oDAAkC;AAClC,6DAA2C;AAC3C,yCAAuB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { MenuCategory, TimeSlotsRange } from "./menu.interface";
|
|
1
2
|
import { IOrderEntity } from "./order.interface";
|
|
2
3
|
export interface InventoryRedis {
|
|
3
4
|
restaurantWorkingHours: WorkingHours[];
|
|
4
5
|
menu: [] | MenuCategory[];
|
|
5
|
-
timeSlots: [] |
|
|
6
|
+
timeSlots: [] | TimeSlotsRange[];
|
|
6
7
|
}
|
|
7
8
|
export interface WorkingHours {
|
|
8
9
|
id: number;
|
|
@@ -18,82 +19,10 @@ export declare enum RestaurantOpen {
|
|
|
18
19
|
OPEN = "Open",
|
|
19
20
|
CLOSED = "Closed"
|
|
20
21
|
}
|
|
21
|
-
export interface Image {
|
|
22
|
-
uid: number;
|
|
23
|
-
name: string;
|
|
24
|
-
status: string;
|
|
25
|
-
url: string;
|
|
26
|
-
}
|
|
27
|
-
export declare enum TimeSlotType {
|
|
28
|
-
DEFAULT = "DEFAULT",
|
|
29
|
-
CUSTOM = "CUSTOM"
|
|
30
|
-
}
|
|
31
|
-
export interface AvailableHours {
|
|
32
|
-
from: string;
|
|
33
|
-
to: string;
|
|
34
|
-
}
|
|
35
|
-
export interface AvailableHoursMap {
|
|
36
|
-
Monday: string[];
|
|
37
|
-
Tuesday: string[];
|
|
38
|
-
Wednesday: string[];
|
|
39
|
-
Thursday: string[];
|
|
40
|
-
Friday: string[];
|
|
41
|
-
Saturday: string[];
|
|
42
|
-
Sunday: string[];
|
|
43
|
-
}
|
|
44
|
-
export interface FoodItem {
|
|
45
|
-
key: string;
|
|
46
|
-
subcategory_id: string;
|
|
47
|
-
food_id: string;
|
|
48
|
-
label: string;
|
|
49
|
-
price: number;
|
|
50
|
-
totalPrice: number;
|
|
51
|
-
description: string;
|
|
52
|
-
gstPercentage: number;
|
|
53
|
-
gst: number;
|
|
54
|
-
packaging: boolean;
|
|
55
|
-
packaging_charges: number | null;
|
|
56
|
-
servings: number;
|
|
57
|
-
category: string;
|
|
58
|
-
status: string;
|
|
59
|
-
images: Image[];
|
|
60
|
-
availableDays: string[];
|
|
61
|
-
availableHours: AvailableHoursMap;
|
|
62
|
-
ratings: {
|
|
63
|
-
averageRatings: number;
|
|
64
|
-
ratingCount: number;
|
|
65
|
-
};
|
|
66
|
-
type: string;
|
|
67
|
-
addOns: any[];
|
|
68
|
-
healthy: boolean;
|
|
69
|
-
vegan: boolean;
|
|
70
|
-
recommend: boolean;
|
|
71
|
-
cuisine: string[];
|
|
72
|
-
}
|
|
73
|
-
export interface SubCategory {
|
|
74
|
-
key: string;
|
|
75
|
-
category_id: string;
|
|
76
|
-
label: string;
|
|
77
|
-
subcategory_id: string;
|
|
78
|
-
foodItems: FoodItem[];
|
|
79
|
-
}
|
|
80
|
-
export interface MenuCategory {
|
|
81
|
-
key: string;
|
|
82
|
-
category_id: string;
|
|
83
|
-
label: string;
|
|
84
|
-
hasSubCategory: boolean;
|
|
85
|
-
children: Array<SubCategory | FoodItem>;
|
|
86
|
-
}
|
|
87
|
-
export interface TimeSlot {
|
|
88
|
-
slotName: string;
|
|
89
|
-
availableHours: AvailableHours;
|
|
90
|
-
type: TimeSlotType;
|
|
91
|
-
crossingOver: boolean;
|
|
92
|
-
}
|
|
93
22
|
export interface SetMenuDetailsDetails {
|
|
94
23
|
restaurantId: string;
|
|
95
24
|
menuCard: MenuCategory[];
|
|
96
|
-
timeSlots:
|
|
25
|
+
timeSlots: TimeSlotsRange[];
|
|
97
26
|
}
|
|
98
27
|
export interface InventoryFoodAvailability {
|
|
99
28
|
allFoodAvailable: boolean;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.RestaurantOpen = void 0;
|
|
4
4
|
var RestaurantOpen;
|
|
5
5
|
(function (RestaurantOpen) {
|
|
6
6
|
RestaurantOpen["OPEN"] = "Open";
|
|
7
7
|
RestaurantOpen["CLOSED"] = "Closed";
|
|
8
8
|
})(RestaurantOpen || (exports.RestaurantOpen = RestaurantOpen = {}));
|
|
9
|
-
var TimeSlotType;
|
|
10
|
-
(function (TimeSlotType) {
|
|
11
|
-
TimeSlotType["DEFAULT"] = "DEFAULT";
|
|
12
|
-
TimeSlotType["CUSTOM"] = "CUSTOM";
|
|
13
|
-
})(TimeSlotType || (exports.TimeSlotType = TimeSlotType = {}));
|
|
14
9
|
//# sourceMappingURL=inventory.interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inventory.interface.js","sourceRoot":"","sources":["../../src/interfaces/inventory.interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"inventory.interface.js","sourceRoot":"","sources":["../../src/interfaces/inventory.interface.ts"],"names":[],"mappings":";;;AA2BA,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACnB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export interface Image {
|
|
2
|
+
uid: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: string;
|
|
5
|
+
url: string;
|
|
6
|
+
}
|
|
7
|
+
export declare enum TimeSlotType {
|
|
8
|
+
DEFAULT = "DEFAULT",
|
|
9
|
+
CUSTOM = "CUSTOM"
|
|
10
|
+
}
|
|
11
|
+
export interface AvailableHours {
|
|
12
|
+
from: string;
|
|
13
|
+
to: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TimeSlotsRange {
|
|
16
|
+
slotName: string;
|
|
17
|
+
availableHours: AvailableHours;
|
|
18
|
+
type: TimeSlotType;
|
|
19
|
+
crossingOver: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface AvailableHours {
|
|
22
|
+
Monday: string[];
|
|
23
|
+
Tuesday: string[];
|
|
24
|
+
Wednesday: string[];
|
|
25
|
+
Thursday: string[];
|
|
26
|
+
Friday: string[];
|
|
27
|
+
Saturday: string[];
|
|
28
|
+
Sunday: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface AddonItem {
|
|
31
|
+
addon_id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
price: number;
|
|
34
|
+
gstPercentage: number;
|
|
35
|
+
isDefault: boolean;
|
|
36
|
+
sortOrder: number;
|
|
37
|
+
}
|
|
38
|
+
export interface AddonGroup {
|
|
39
|
+
group_id: string;
|
|
40
|
+
label: string;
|
|
41
|
+
selectionType: "SINGLE_SELECT" | "MULTI_SELECT";
|
|
42
|
+
minSelect: number;
|
|
43
|
+
maxSelect: number;
|
|
44
|
+
addons: AddonItem[];
|
|
45
|
+
}
|
|
46
|
+
export interface Stock {
|
|
47
|
+
initialStockPerDay: number;
|
|
48
|
+
currentStock: number;
|
|
49
|
+
autoRefresh: boolean;
|
|
50
|
+
nextRefreshAt: string;
|
|
51
|
+
}
|
|
52
|
+
export declare enum OfferScope {
|
|
53
|
+
ITEM = "ITEM",
|
|
54
|
+
CATEGORY = "CATEGORY",
|
|
55
|
+
RESTAURANT = "RESTAURANT"
|
|
56
|
+
}
|
|
57
|
+
export declare enum OfferType {
|
|
58
|
+
FLAT = "FLAT",
|
|
59
|
+
PERCENT = "PERCENT",
|
|
60
|
+
BOGO = "BOGO",
|
|
61
|
+
BUY_X_GET_Y = "BUY_X_GET_Y",
|
|
62
|
+
COMBO_DISCOUNT = "COMBO_DISCOUNT"
|
|
63
|
+
}
|
|
64
|
+
export interface OfferReward {
|
|
65
|
+
rewardType: "FLAT" | "PERCENT" | "FREE_ITEM" | "DISCOUNTED_ITEM";
|
|
66
|
+
flatAmount?: number;
|
|
67
|
+
percent?: number;
|
|
68
|
+
freeItemId?: string;
|
|
69
|
+
discountedPrice?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface Offer {
|
|
72
|
+
offer_id: string;
|
|
73
|
+
scope: OfferScope;
|
|
74
|
+
type: OfferType;
|
|
75
|
+
title: string;
|
|
76
|
+
startAt: string;
|
|
77
|
+
endAt: string;
|
|
78
|
+
priority: number;
|
|
79
|
+
stackable: boolean;
|
|
80
|
+
rewards: OfferReward[];
|
|
81
|
+
}
|
|
82
|
+
export interface ComboFixedItem {
|
|
83
|
+
item_id: string;
|
|
84
|
+
quantity: number;
|
|
85
|
+
}
|
|
86
|
+
export interface ComboGroupItem {
|
|
87
|
+
item_id: string;
|
|
88
|
+
defaultQuantity: number;
|
|
89
|
+
extraPrice: number;
|
|
90
|
+
}
|
|
91
|
+
export interface ComboGroup {
|
|
92
|
+
group_id: string;
|
|
93
|
+
label: string;
|
|
94
|
+
selectionType: "SINGLE_SELECT" | "MULTI_SELECT";
|
|
95
|
+
minSelect: number;
|
|
96
|
+
maxSelect: number;
|
|
97
|
+
items: ComboGroupItem[];
|
|
98
|
+
}
|
|
99
|
+
export interface Combo {
|
|
100
|
+
combo_id: string;
|
|
101
|
+
label: string;
|
|
102
|
+
description: string;
|
|
103
|
+
basePrice: number;
|
|
104
|
+
discountPrice?: number;
|
|
105
|
+
fixedItems: ComboFixedItem[];
|
|
106
|
+
groups: ComboGroup[];
|
|
107
|
+
}
|
|
108
|
+
export interface FoodItem {
|
|
109
|
+
key: string;
|
|
110
|
+
food_id: string;
|
|
111
|
+
subcategory_id: string;
|
|
112
|
+
label: string;
|
|
113
|
+
price: number;
|
|
114
|
+
totalPrice: number;
|
|
115
|
+
description: string;
|
|
116
|
+
gstPercentage: number;
|
|
117
|
+
gst: number;
|
|
118
|
+
packaging: boolean;
|
|
119
|
+
packaging_charges: number | null;
|
|
120
|
+
servings: number;
|
|
121
|
+
category: string;
|
|
122
|
+
status: string;
|
|
123
|
+
images: [];
|
|
124
|
+
availableDays: string[];
|
|
125
|
+
availableHours: AvailableHours;
|
|
126
|
+
ratings: {
|
|
127
|
+
averageRatings: number;
|
|
128
|
+
ratingCount: number;
|
|
129
|
+
};
|
|
130
|
+
type: string;
|
|
131
|
+
healthy: boolean;
|
|
132
|
+
vegan: boolean;
|
|
133
|
+
recommend: boolean;
|
|
134
|
+
cuisine: string;
|
|
135
|
+
addOns: AddonGroup[];
|
|
136
|
+
stock: Stock;
|
|
137
|
+
offers: Offer[];
|
|
138
|
+
combos: Combo[];
|
|
139
|
+
}
|
|
140
|
+
export interface SubCategory {
|
|
141
|
+
key: string;
|
|
142
|
+
category_id: string;
|
|
143
|
+
label: string;
|
|
144
|
+
subcategory_id: string;
|
|
145
|
+
foodItems: FoodItem[];
|
|
146
|
+
}
|
|
147
|
+
export interface MenuCategory {
|
|
148
|
+
key: string;
|
|
149
|
+
category_id: string;
|
|
150
|
+
label: string;
|
|
151
|
+
hasSubCategory: boolean;
|
|
152
|
+
children: Array<SubCategory | FoodItem>;
|
|
153
|
+
}
|
|
154
|
+
export interface SetMenuDetails {
|
|
155
|
+
restaurantId: string;
|
|
156
|
+
menuCard: MenuCategory[];
|
|
157
|
+
timeSlots: TimeSlotsRange[];
|
|
158
|
+
restaurantOffers?: Offer[];
|
|
159
|
+
}
|
|
160
|
+
export interface UpdatedField<T> {
|
|
161
|
+
old: T;
|
|
162
|
+
new: T;
|
|
163
|
+
}
|
|
164
|
+
export interface UpdatedEntity<T> {
|
|
165
|
+
id: string;
|
|
166
|
+
changes: Partial<Record<keyof T, UpdatedField<any>>>;
|
|
167
|
+
}
|
|
168
|
+
export interface SimpleEntityDiff<T> {
|
|
169
|
+
added: T[];
|
|
170
|
+
removed: T[];
|
|
171
|
+
updated: UpdatedEntity<T>[];
|
|
172
|
+
}
|
|
173
|
+
export interface MenuDiff {
|
|
174
|
+
categories: SimpleEntityDiff<MenuCategory>;
|
|
175
|
+
subcategories: SimpleEntityDiff<SubCategory>;
|
|
176
|
+
items: SimpleEntityDiff<FoodItem>;
|
|
177
|
+
addons: SimpleEntityDiff<AddonGroup>;
|
|
178
|
+
combos: SimpleEntityDiff<Combo>;
|
|
179
|
+
offers: SimpleEntityDiff<Offer>;
|
|
180
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OfferType = exports.OfferScope = exports.TimeSlotType = void 0;
|
|
4
|
+
var TimeSlotType;
|
|
5
|
+
(function (TimeSlotType) {
|
|
6
|
+
TimeSlotType["DEFAULT"] = "DEFAULT";
|
|
7
|
+
TimeSlotType["CUSTOM"] = "CUSTOM";
|
|
8
|
+
})(TimeSlotType || (exports.TimeSlotType = TimeSlotType = {}));
|
|
9
|
+
var OfferScope;
|
|
10
|
+
(function (OfferScope) {
|
|
11
|
+
OfferScope["ITEM"] = "ITEM";
|
|
12
|
+
OfferScope["CATEGORY"] = "CATEGORY";
|
|
13
|
+
OfferScope["RESTAURANT"] = "RESTAURANT";
|
|
14
|
+
})(OfferScope || (exports.OfferScope = OfferScope = {}));
|
|
15
|
+
var OfferType;
|
|
16
|
+
(function (OfferType) {
|
|
17
|
+
OfferType["FLAT"] = "FLAT";
|
|
18
|
+
OfferType["PERCENT"] = "PERCENT";
|
|
19
|
+
OfferType["BOGO"] = "BOGO";
|
|
20
|
+
OfferType["BUY_X_GET_Y"] = "BUY_X_GET_Y";
|
|
21
|
+
OfferType["COMBO_DISCOUNT"] = "COMBO_DISCOUNT";
|
|
22
|
+
})(OfferType || (exports.OfferType = OfferType = {}));
|
|
23
|
+
//# sourceMappingURL=menu.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.interface.js","sourceRoot":"","sources":["../../src/interfaces/menu.interface.ts"],"names":[],"mappings":";;;AASA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAoDD,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,uCAAyB,CAAA;AAC3B,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAED,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,gCAAmB,CAAA;IACnB,0BAAa,CAAA;IACb,wCAA2B,CAAA;IAC3B,8CAAiC,CAAA;AACnC,CAAC,EANW,SAAS,yBAAT,SAAS,QAMpB"}
|