@foodtolls/common 2.5.1 → 2.6.0
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/kafka-topics/all-topics.d.ts +243 -0
- package/dist/kafka-topics/all-topics.js +3 -0
- package/dist/kafka-topics/all-topics.js.map +1 -0
- package/dist/kafka-topics/index.d.ts +1 -0
- package/dist/kafka-topics/index.js +18 -0
- package/dist/kafka-topics/index.js.map +1 -0
- package/dist/kafka-topics/order.topics.d.ts +1 -0
- package/dist/kafka-topics/order.topics.js +18 -0
- package/dist/kafka-topics/order.topics.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/kafka-topics/all-topics.ts +485 -0
package/dist/index.d.ts
CHANGED
|
@@ -13,5 +13,6 @@ export * from "./interfaces/menu.interface";
|
|
|
13
13
|
export * from "./utils/menu.util";
|
|
14
14
|
export * from "./utils/reachTimeSelection";
|
|
15
15
|
export * from "./saga";
|
|
16
|
+
export * from "./kafka-topics/all-topics";
|
|
16
17
|
export { AccessTokenPayload, RefreshTokenPayload, DeviceInfo, TokenExpiredError, InvalidTokenError, InvalidUserTypeError, } from "./auth/jwt.types";
|
|
17
18
|
export * from "./auth/jwt.handler";
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ __exportStar(require("./interfaces/menu.interface"), exports);
|
|
|
30
30
|
__exportStar(require("./utils/menu.util"), exports);
|
|
31
31
|
__exportStar(require("./utils/reachTimeSelection"), exports);
|
|
32
32
|
__exportStar(require("./saga"), exports);
|
|
33
|
+
__exportStar(require("./kafka-topics/all-topics"), exports);
|
|
33
34
|
var jwt_types_1 = require("./auth/jwt.types");
|
|
34
35
|
Object.defineProperty(exports, "TokenExpiredError", { enumerable: true, get: function () { return jwt_types_1.TokenExpiredError; } });
|
|
35
36
|
Object.defineProperty(exports, "InvalidTokenError", { enumerable: true, get: function () { return jwt_types_1.InvalidTokenError; } });
|
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,8DAA4C;AAC5C,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;AACvB,4DAA0C;AAG1C,8CAO0B;AAHxB,8GAAA,iBAAiB,OAAA;AACjB,8GAAA,iBAAiB,OAAA;AACjB,iHAAA,oBAAoB,OAAA;AAEtB,qDAAmC"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { CancelledType, OrderStatus, OrderType } from "src/enums/order.enum";
|
|
2
|
+
import { PAYMENTSTATUS, REFUNDSTATUS } from "src/enums/payment.enum";
|
|
3
|
+
import { DistanceTimeToReach } from "src/interfaces/gmap.interface";
|
|
4
|
+
export interface CreateOrderPaymentEvent {
|
|
5
|
+
orderId: string;
|
|
6
|
+
orderDetails: {
|
|
7
|
+
foodItem: Array<{
|
|
8
|
+
count: number;
|
|
9
|
+
name: string;
|
|
10
|
+
}>;
|
|
11
|
+
orderType: string;
|
|
12
|
+
serviceType: string;
|
|
13
|
+
gstCharges: number;
|
|
14
|
+
packagingCharges: number;
|
|
15
|
+
platformFee: number;
|
|
16
|
+
orderFinalPrice: number;
|
|
17
|
+
};
|
|
18
|
+
restaurantId: string;
|
|
19
|
+
userId: string;
|
|
20
|
+
amount: number;
|
|
21
|
+
currency: string;
|
|
22
|
+
}
|
|
23
|
+
export interface NewOrderEvent {
|
|
24
|
+
orderId: string;
|
|
25
|
+
userId: string;
|
|
26
|
+
restaurantId: string;
|
|
27
|
+
totalAmount: number;
|
|
28
|
+
gst: number;
|
|
29
|
+
paymentStatus: PAYMENTSTATUS;
|
|
30
|
+
orderStatus: OrderStatus;
|
|
31
|
+
orderType: OrderType;
|
|
32
|
+
orderDateTime: Date;
|
|
33
|
+
orderReachTime: Date;
|
|
34
|
+
serviceType: string;
|
|
35
|
+
orderItems: Array<{
|
|
36
|
+
foodId: string;
|
|
37
|
+
quantity: number;
|
|
38
|
+
categoryId: string;
|
|
39
|
+
subCategoryId?: string;
|
|
40
|
+
price: number;
|
|
41
|
+
gstAmount: number;
|
|
42
|
+
packagingCharges: number;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
export interface OrderPaymentStatusEvent {
|
|
46
|
+
orderId: string;
|
|
47
|
+
razorOrderId?: string;
|
|
48
|
+
orderStatus: OrderStatus;
|
|
49
|
+
paymentStatus: PAYMENTSTATUS;
|
|
50
|
+
}
|
|
51
|
+
export interface VendorCreateEvent {
|
|
52
|
+
mobileNumber: number;
|
|
53
|
+
vendorId: string;
|
|
54
|
+
}
|
|
55
|
+
export interface CheckFoodAvailabilityEvent {
|
|
56
|
+
redisId: string;
|
|
57
|
+
restaurantId: string;
|
|
58
|
+
src: {
|
|
59
|
+
latitude: number;
|
|
60
|
+
longitude: number;
|
|
61
|
+
};
|
|
62
|
+
foodItems: Array<{
|
|
63
|
+
foodId: string;
|
|
64
|
+
categoryId: string;
|
|
65
|
+
subCategoryId?: string;
|
|
66
|
+
status: string;
|
|
67
|
+
}>;
|
|
68
|
+
orderCreateDate: Date;
|
|
69
|
+
}
|
|
70
|
+
export interface OrderInventoryLoadEvent {
|
|
71
|
+
Restaurant: string;
|
|
72
|
+
Order: string;
|
|
73
|
+
orderStatus: OrderStatus;
|
|
74
|
+
userId: string;
|
|
75
|
+
}
|
|
76
|
+
export interface OrderStatusAckUpdateEvent {
|
|
77
|
+
orderId: string;
|
|
78
|
+
orderStatus: OrderStatus;
|
|
79
|
+
}
|
|
80
|
+
export interface UpdateOrderCancelledStatusEvent {
|
|
81
|
+
orderId: string;
|
|
82
|
+
cancelledType: CancelledType;
|
|
83
|
+
cancelledReason: string;
|
|
84
|
+
}
|
|
85
|
+
export interface OrderItemPartialUpdateEvent {
|
|
86
|
+
orderId: string;
|
|
87
|
+
refundId: string;
|
|
88
|
+
paymentId: string;
|
|
89
|
+
orderDetails: {
|
|
90
|
+
orderId: string;
|
|
91
|
+
orderStatus: OrderStatus;
|
|
92
|
+
foodItems: Array<{
|
|
93
|
+
foodId: string;
|
|
94
|
+
categoryId: string;
|
|
95
|
+
subCategoryId?: string;
|
|
96
|
+
status: string;
|
|
97
|
+
}>;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export interface InitiateOrderRefundEvent {
|
|
101
|
+
orderId: string;
|
|
102
|
+
refundedBy?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface InitiatePartialOrderRefundEvent {
|
|
105
|
+
orderId: string;
|
|
106
|
+
orderDetails: {
|
|
107
|
+
orderId: string;
|
|
108
|
+
orderStatus: OrderStatus;
|
|
109
|
+
foodItems: Array<{
|
|
110
|
+
foodId: string;
|
|
111
|
+
categoryId: string;
|
|
112
|
+
subCategoryId?: string;
|
|
113
|
+
status: string;
|
|
114
|
+
}>;
|
|
115
|
+
};
|
|
116
|
+
reason: string;
|
|
117
|
+
}
|
|
118
|
+
export interface CheckRefundStatusEvent {
|
|
119
|
+
orderId: string;
|
|
120
|
+
paymentId: string;
|
|
121
|
+
refundId: string;
|
|
122
|
+
}
|
|
123
|
+
export interface OrderRefundStatusEvent {
|
|
124
|
+
orderId: string;
|
|
125
|
+
refundId: string;
|
|
126
|
+
paymentId: string;
|
|
127
|
+
orderStatus: OrderStatus;
|
|
128
|
+
paymentStatus: PAYMENTSTATUS;
|
|
129
|
+
refundStatus: REFUNDSTATUS;
|
|
130
|
+
}
|
|
131
|
+
export interface OrderPartialRefundStatusEvent {
|
|
132
|
+
orderId: string;
|
|
133
|
+
refundId: string;
|
|
134
|
+
paymentId: string;
|
|
135
|
+
orderStatus: OrderStatus;
|
|
136
|
+
paymentStatus: PAYMENTSTATUS;
|
|
137
|
+
refundStatus: REFUNDSTATUS;
|
|
138
|
+
refundAmount: number;
|
|
139
|
+
}
|
|
140
|
+
export interface OrderStatusEvent {
|
|
141
|
+
orderId: string;
|
|
142
|
+
status: string;
|
|
143
|
+
}
|
|
144
|
+
export interface OrderRejectStatusEvent {
|
|
145
|
+
orderId: string;
|
|
146
|
+
cancelledType: string;
|
|
147
|
+
cancelledReason: string;
|
|
148
|
+
}
|
|
149
|
+
export interface RequestOrderTrackOrderEvent {
|
|
150
|
+
userId: string;
|
|
151
|
+
orderId: string;
|
|
152
|
+
trackPayload: {
|
|
153
|
+
src: {
|
|
154
|
+
lat: number | undefined;
|
|
155
|
+
lng: number | undefined;
|
|
156
|
+
};
|
|
157
|
+
dest: {
|
|
158
|
+
lat: number | undefined;
|
|
159
|
+
lng: number | undefined;
|
|
160
|
+
};
|
|
161
|
+
firstUpdate: Date;
|
|
162
|
+
currentUpdates: Date | undefined;
|
|
163
|
+
distanceTimeToReach: DistanceTimeToReach | undefined;
|
|
164
|
+
orderStatus: OrderStatus;
|
|
165
|
+
orderCreateDate: Date;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export interface OrderPaymentFailedEvent {
|
|
169
|
+
orderId: string;
|
|
170
|
+
userId: string;
|
|
171
|
+
restaurantId: string;
|
|
172
|
+
amount: number;
|
|
173
|
+
status: string;
|
|
174
|
+
reason?: string;
|
|
175
|
+
timestamp: number;
|
|
176
|
+
}
|
|
177
|
+
export interface NotificationEvent {
|
|
178
|
+
userId: string;
|
|
179
|
+
orderId: string;
|
|
180
|
+
type: "payment_timeout" | "payment_late_success" | "payment_failed" | string;
|
|
181
|
+
message: string;
|
|
182
|
+
amount?: number;
|
|
183
|
+
timestamp: number;
|
|
184
|
+
}
|
|
185
|
+
export interface RefundUpdateStatusEvent {
|
|
186
|
+
orderId: string;
|
|
187
|
+
refundStatus: REFUNDSTATUS.REFUNDCOMPLETED;
|
|
188
|
+
}
|
|
189
|
+
export interface UserCreateEvent {
|
|
190
|
+
mobileNumber: number;
|
|
191
|
+
userId: string;
|
|
192
|
+
}
|
|
193
|
+
export interface VendorRegStatusEvent {
|
|
194
|
+
vendorId: string;
|
|
195
|
+
status: string;
|
|
196
|
+
}
|
|
197
|
+
export interface OrderLongTrackCancelEvent {
|
|
198
|
+
orderId: string;
|
|
199
|
+
orderStatus: OrderStatus;
|
|
200
|
+
reason: string;
|
|
201
|
+
}
|
|
202
|
+
export interface TrackUpdateOrderOnLazyTrackEvent {
|
|
203
|
+
orderId: string;
|
|
204
|
+
trackingData: {
|
|
205
|
+
currentLocation: {
|
|
206
|
+
lat: number;
|
|
207
|
+
lng: number;
|
|
208
|
+
};
|
|
209
|
+
expectedReachTime: number;
|
|
210
|
+
distance: string;
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
export interface TrackUpdateOrderPreparingEvent {
|
|
214
|
+
orderId: string;
|
|
215
|
+
orderStatus: OrderStatus;
|
|
216
|
+
preparingStartTime: Date;
|
|
217
|
+
}
|
|
218
|
+
export interface CheckCartFoodAvailabilityEvent {
|
|
219
|
+
restaurantId: string;
|
|
220
|
+
foodItems: Array<{
|
|
221
|
+
foodId: string;
|
|
222
|
+
categoryId: string;
|
|
223
|
+
subCategoryId?: string;
|
|
224
|
+
}>;
|
|
225
|
+
userId: string;
|
|
226
|
+
}
|
|
227
|
+
export interface HotelInventoryLoadEvent {
|
|
228
|
+
restaurantIds: string[];
|
|
229
|
+
}
|
|
230
|
+
export interface RequestOrderTrackVendorEvent {
|
|
231
|
+
orderId: string;
|
|
232
|
+
restaurantId: string;
|
|
233
|
+
trackType: string;
|
|
234
|
+
}
|
|
235
|
+
export interface OrderQueueAddMonitorEvent {
|
|
236
|
+
orderId: string;
|
|
237
|
+
queueType: "ready" | "serving";
|
|
238
|
+
statusChangeDate: Date;
|
|
239
|
+
}
|
|
240
|
+
export interface VendorCreateRollbackEvent {
|
|
241
|
+
vendorId: string;
|
|
242
|
+
reason: string;
|
|
243
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all-topics.js","sourceRoot":"","sources":["../../src/kafka-topics/all-topics.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./all-topics";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./all-topics"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/kafka-topics/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAMA,+CAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./all-topics";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./all-topics"), exports);
|
|
18
|
+
//# sourceMappingURL=order.topics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order.topics.js","sourceRoot":"","sources":["../../src/kafka-topics/order.topics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAOA,+CAA6B"}
|