@mamindom/contracts 1.0.125 → 1.0.127
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/events/auth/otp-requested.interface.d.ts +6 -2
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.js +1 -0
- package/dist/events/orders/order-cancelled.interface.d.ts +7 -0
- package/dist/events/orders/order-status-changed.interface.d.ts +9 -0
- package/dist/events/stock/index.d.ts +5 -0
- package/dist/events/stock/index.js +21 -0
- package/dist/events/stock/stock-confirm-requested.interface.d.ts +4 -0
- package/dist/events/stock/stock-confirm-requested.interface.js +2 -0
- package/dist/events/stock/stock-release-requested.interface.d.ts +9 -0
- package/dist/events/stock/stock-release-requested.interface.js +2 -0
- package/dist/events/stock/stock-reserve-failed.interface.d.ts +9 -0
- package/dist/events/stock/stock-reserve-failed.interface.js +2 -0
- package/dist/events/stock/stock-reserve-requested.interface.d.ts +10 -0
- package/dist/events/stock/stock-reserve-requested.interface.js +2 -0
- package/dist/events/stock/stock-reserved.interface.d.ts +11 -0
- package/dist/events/stock/stock-reserved.interface.js +2 -0
- package/dist/gen/audit.d.ts +65 -0
- package/dist/gen/audit.js +28 -0
- package/dist/gen/cart.d.ts +5 -0
- package/dist/gen/manager.d.ts +117 -0
- package/dist/gen/manager.js +40 -0
- package/dist/gen/notification.d.ts +279 -0
- package/dist/gen/notification.js +119 -0
- package/dist/gen/order.d.ts +16 -0
- package/dist/gen/payment.d.ts +16 -0
- package/dist/gen/payment.js +1 -0
- package/dist/gen/product.d.ts +16 -0
- package/dist/gen/rbac.d.ts +111 -0
- package/dist/gen/rbac.js +37 -0
- package/dist/proto/audit.proto +59 -0
- package/dist/proto/cart.proto +3 -0
- package/dist/proto/manager.proto +94 -0
- package/dist/proto/notification.proto +317 -0
- package/dist/proto/order.proto +11 -0
- package/dist/proto/payment.proto +10 -0
- package/dist/proto/product.proto +26 -9
- package/dist/proto/rbac.proto +109 -0
- package/dist/src/proto/paths.d.ts +4 -0
- package/dist/src/proto/paths.js +5 -1
- package/events/auth/otp-requested.interface.ts +10 -2
- package/events/index.ts +1 -0
- package/events/orders/order-cancelled.interface.ts +9 -0
- package/events/orders/order-status-changed.interface.ts +14 -0
- package/events/stock/index.ts +5 -0
- package/events/stock/stock-confirm-requested.interface.ts +6 -0
- package/events/stock/stock-release-requested.interface.ts +11 -0
- package/events/stock/stock-reserve-failed.interface.ts +8 -0
- package/events/stock/stock-reserve-requested.interface.ts +16 -0
- package/events/stock/stock-reserved.interface.ts +13 -0
- package/gen/audit.ts +109 -0
- package/gen/cart.ts +5 -0
- package/gen/manager.ts +215 -0
- package/gen/notification.ts +427 -0
- package/gen/order.ts +16 -0
- package/gen/payment.ts +24 -0
- package/gen/product.ts +31 -5
- package/gen/rbac.ts +192 -0
- package/package.json +1 -1
- package/proto/audit.proto +59 -0
- package/proto/cart.proto +3 -0
- package/proto/manager.proto +94 -0
- package/proto/notification.proto +317 -0
- package/proto/order.proto +11 -0
- package/proto/payment.proto +10 -0
- package/proto/product.proto +26 -9
- package/proto/rbac.proto +109 -0
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.4
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: notification.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "notification.v1";
|
|
12
|
+
|
|
13
|
+
export enum NotificationChannel {
|
|
14
|
+
NOTIFICATION_CHANNEL_UNSPECIFIED = 0,
|
|
15
|
+
EMAIL = 1,
|
|
16
|
+
SMS = 2,
|
|
17
|
+
TELEGRAM = 3,
|
|
18
|
+
UNRECOGNIZED = -1,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum NotificationLocale {
|
|
22
|
+
NOTIFICATION_LOCALE_UNSPECIFIED = 0,
|
|
23
|
+
UK = 1,
|
|
24
|
+
RU = 2,
|
|
25
|
+
UNRECOGNIZED = -1,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export enum NotificationCategory {
|
|
29
|
+
NOTIFICATION_CATEGORY_UNSPECIFIED = 0,
|
|
30
|
+
TRANSACTIONAL = 1,
|
|
31
|
+
ACCOUNT = 2,
|
|
32
|
+
MARKETING = 3,
|
|
33
|
+
ADMIN = 4,
|
|
34
|
+
OTP = 5,
|
|
35
|
+
UNRECOGNIZED = -1,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export enum NotificationStatus {
|
|
39
|
+
NOTIFICATION_STATUS_UNSPECIFIED = 0,
|
|
40
|
+
PENDING = 1,
|
|
41
|
+
SENT = 2,
|
|
42
|
+
FAILED = 3,
|
|
43
|
+
SIMULATED = 4,
|
|
44
|
+
SUPPRESSED = 5,
|
|
45
|
+
UNRECOGNIZED = -1,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export enum TelegramTopic {
|
|
49
|
+
TELEGRAM_TOPIC_UNSPECIFIED = 0,
|
|
50
|
+
ORDERS = 1,
|
|
51
|
+
ORDERS_ALERTS = 2,
|
|
52
|
+
PAYMENTS = 3,
|
|
53
|
+
WAREHOUSE = 4,
|
|
54
|
+
REVIEWS = 5,
|
|
55
|
+
CALLBACK = 6,
|
|
56
|
+
REPORTS = 7,
|
|
57
|
+
ALERTS = 8,
|
|
58
|
+
GENERAL = 9,
|
|
59
|
+
UNRECOGNIZED = -1,
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface NotificationTemplate {
|
|
63
|
+
id: string;
|
|
64
|
+
key: string;
|
|
65
|
+
channel: NotificationChannel;
|
|
66
|
+
locale: NotificationLocale;
|
|
67
|
+
category: NotificationCategory;
|
|
68
|
+
title: string;
|
|
69
|
+
subject: string;
|
|
70
|
+
/**
|
|
71
|
+
* JSON-stringified Tiptap content (передаємо як string щоб не
|
|
72
|
+
* використовувати proto google.protobuf.Struct).
|
|
73
|
+
*/
|
|
74
|
+
contentJson: string;
|
|
75
|
+
bodyHtml: string;
|
|
76
|
+
bodyText: string;
|
|
77
|
+
/** JSON array of variable names (для autocomplete). */
|
|
78
|
+
variablesJson: string;
|
|
79
|
+
isActive: boolean;
|
|
80
|
+
version: number;
|
|
81
|
+
createdAt: number;
|
|
82
|
+
updatedAt: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface TemplateResponse {
|
|
86
|
+
ok: boolean;
|
|
87
|
+
template: NotificationTemplate | undefined;
|
|
88
|
+
errorMessage: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ListTemplatesRequest {
|
|
92
|
+
channel?: NotificationChannel | undefined;
|
|
93
|
+
locale?: NotificationLocale | undefined;
|
|
94
|
+
category?: NotificationCategory | undefined;
|
|
95
|
+
search?: string | undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface ListTemplatesResponse {
|
|
99
|
+
items: NotificationTemplate[];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface GetTemplateRequest {
|
|
103
|
+
id: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface UpsertTemplateRequest {
|
|
107
|
+
key: string;
|
|
108
|
+
channel: NotificationChannel;
|
|
109
|
+
locale: NotificationLocale;
|
|
110
|
+
category: NotificationCategory;
|
|
111
|
+
title: string;
|
|
112
|
+
subject: string;
|
|
113
|
+
contentJson: string;
|
|
114
|
+
bodyHtml: string;
|
|
115
|
+
bodyText: string;
|
|
116
|
+
variablesJson: string;
|
|
117
|
+
isActive: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface UpdateTemplateRequest {
|
|
121
|
+
id: string;
|
|
122
|
+
title?: string | undefined;
|
|
123
|
+
subject?: string | undefined;
|
|
124
|
+
contentJson?: string | undefined;
|
|
125
|
+
bodyHtml: string;
|
|
126
|
+
bodyText: string;
|
|
127
|
+
variablesJson?: string | undefined;
|
|
128
|
+
isActive?:
|
|
129
|
+
| boolean
|
|
130
|
+
| undefined;
|
|
131
|
+
/** Admin id для audit (хто змінив). */
|
|
132
|
+
actorId?: string | undefined;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface ToggleTemplateRequest {
|
|
136
|
+
id: string;
|
|
137
|
+
isActive: boolean;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface NotificationTemplateVersion {
|
|
141
|
+
id: string;
|
|
142
|
+
version: number;
|
|
143
|
+
title: string;
|
|
144
|
+
subject: string;
|
|
145
|
+
contentJson: string;
|
|
146
|
+
bodyHtml: string;
|
|
147
|
+
bodyText: string;
|
|
148
|
+
variablesJson: string;
|
|
149
|
+
createdById?: string | undefined;
|
|
150
|
+
createdAt: number;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface ListVersionsRequest {
|
|
154
|
+
templateId: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface ListVersionsResponse {
|
|
158
|
+
items: NotificationTemplateVersion[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface RestoreVersionRequest {
|
|
162
|
+
templateId: string;
|
|
163
|
+
version: number;
|
|
164
|
+
actorId?: string | undefined;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface RenderPreviewRequest {
|
|
168
|
+
bodyHtml: string;
|
|
169
|
+
/** JSON-stringified variables { "order.number": "MD-2026-0001", ... } */
|
|
170
|
+
variablesJson: string;
|
|
171
|
+
subject?: string | undefined;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface RenderPreviewResponse {
|
|
175
|
+
html: string;
|
|
176
|
+
subject: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface SendTestRequest {
|
|
180
|
+
templateId: string;
|
|
181
|
+
/** email або phone (залежно від channel). */
|
|
182
|
+
recipient: string;
|
|
183
|
+
/** JSON-stringified test variables. */
|
|
184
|
+
variablesJson: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface SendTestResponse {
|
|
188
|
+
ok: boolean;
|
|
189
|
+
errorMessage: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface NotificationLog {
|
|
193
|
+
id: string;
|
|
194
|
+
templateKey: string;
|
|
195
|
+
channel: NotificationChannel;
|
|
196
|
+
locale: NotificationLocale;
|
|
197
|
+
recipient: string;
|
|
198
|
+
orderId?: string | undefined;
|
|
199
|
+
userId?: string | undefined;
|
|
200
|
+
status: NotificationStatus;
|
|
201
|
+
providerMessageId?: string | undefined;
|
|
202
|
+
providerName?: string | undefined;
|
|
203
|
+
error?: string | undefined;
|
|
204
|
+
sentAt?: number | undefined;
|
|
205
|
+
createdAt: number;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface ListLogsRequest {
|
|
209
|
+
channel?: NotificationChannel | undefined;
|
|
210
|
+
status?: NotificationStatus | undefined;
|
|
211
|
+
templateKey?: string | undefined;
|
|
212
|
+
orderId?: string | undefined;
|
|
213
|
+
userId?: string | undefined;
|
|
214
|
+
recipient?: string | undefined;
|
|
215
|
+
dateFrom?: number | undefined;
|
|
216
|
+
dateTo?: number | undefined;
|
|
217
|
+
page: number;
|
|
218
|
+
limit: number;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface ListLogsResponse {
|
|
222
|
+
items: NotificationLog[];
|
|
223
|
+
total: number;
|
|
224
|
+
page: number;
|
|
225
|
+
limit: number;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export interface TelegramChat {
|
|
229
|
+
id: string;
|
|
230
|
+
chatId: string;
|
|
231
|
+
topic: TelegramTopic;
|
|
232
|
+
label: string;
|
|
233
|
+
tag?: string | undefined;
|
|
234
|
+
isActive: boolean;
|
|
235
|
+
createdAt: number;
|
|
236
|
+
updatedAt: number;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface TelegramChatResponse {
|
|
240
|
+
ok: boolean;
|
|
241
|
+
chat: TelegramChat | undefined;
|
|
242
|
+
errorMessage: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export interface ListChatsRequest {
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface ListChatsResponse {
|
|
249
|
+
items: TelegramChat[];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface UpsertChatRequest {
|
|
253
|
+
chatId: string;
|
|
254
|
+
topic: TelegramTopic;
|
|
255
|
+
label: string;
|
|
256
|
+
tag?: string | undefined;
|
|
257
|
+
isActive: boolean;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface DeleteChatRequest {
|
|
261
|
+
id: string;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface DeleteChatResponse {
|
|
265
|
+
ok: boolean;
|
|
266
|
+
errorMessage: string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface TestSendTelegramRequest {
|
|
270
|
+
chatId: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface TestSendTelegramResponse {
|
|
274
|
+
ok: boolean;
|
|
275
|
+
errorMessage: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export const NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
|
|
279
|
+
|
|
280
|
+
export interface NotificationTemplateServiceClient {
|
|
281
|
+
listTemplates(request: ListTemplatesRequest): Observable<ListTemplatesResponse>;
|
|
282
|
+
|
|
283
|
+
getTemplate(request: GetTemplateRequest): Observable<TemplateResponse>;
|
|
284
|
+
|
|
285
|
+
upsertTemplate(request: UpsertTemplateRequest): Observable<TemplateResponse>;
|
|
286
|
+
|
|
287
|
+
updateTemplate(request: UpdateTemplateRequest): Observable<TemplateResponse>;
|
|
288
|
+
|
|
289
|
+
toggleTemplate(request: ToggleTemplateRequest): Observable<TemplateResponse>;
|
|
290
|
+
|
|
291
|
+
listVersions(request: ListVersionsRequest): Observable<ListVersionsResponse>;
|
|
292
|
+
|
|
293
|
+
restoreVersion(request: RestoreVersionRequest): Observable<TemplateResponse>;
|
|
294
|
+
|
|
295
|
+
renderPreview(request: RenderPreviewRequest): Observable<RenderPreviewResponse>;
|
|
296
|
+
|
|
297
|
+
sendTest(request: SendTestRequest): Observable<SendTestResponse>;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface NotificationTemplateServiceController {
|
|
301
|
+
listTemplates(
|
|
302
|
+
request: ListTemplatesRequest,
|
|
303
|
+
): Promise<ListTemplatesResponse> | Observable<ListTemplatesResponse> | ListTemplatesResponse;
|
|
304
|
+
|
|
305
|
+
getTemplate(request: GetTemplateRequest): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
306
|
+
|
|
307
|
+
upsertTemplate(
|
|
308
|
+
request: UpsertTemplateRequest,
|
|
309
|
+
): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
310
|
+
|
|
311
|
+
updateTemplate(
|
|
312
|
+
request: UpdateTemplateRequest,
|
|
313
|
+
): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
314
|
+
|
|
315
|
+
toggleTemplate(
|
|
316
|
+
request: ToggleTemplateRequest,
|
|
317
|
+
): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
318
|
+
|
|
319
|
+
listVersions(
|
|
320
|
+
request: ListVersionsRequest,
|
|
321
|
+
): Promise<ListVersionsResponse> | Observable<ListVersionsResponse> | ListVersionsResponse;
|
|
322
|
+
|
|
323
|
+
restoreVersion(
|
|
324
|
+
request: RestoreVersionRequest,
|
|
325
|
+
): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
326
|
+
|
|
327
|
+
renderPreview(
|
|
328
|
+
request: RenderPreviewRequest,
|
|
329
|
+
): Promise<RenderPreviewResponse> | Observable<RenderPreviewResponse> | RenderPreviewResponse;
|
|
330
|
+
|
|
331
|
+
sendTest(request: SendTestRequest): Promise<SendTestResponse> | Observable<SendTestResponse> | SendTestResponse;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export function NotificationTemplateServiceControllerMethods() {
|
|
335
|
+
return function (constructor: Function) {
|
|
336
|
+
const grpcMethods: string[] = [
|
|
337
|
+
"listTemplates",
|
|
338
|
+
"getTemplate",
|
|
339
|
+
"upsertTemplate",
|
|
340
|
+
"updateTemplate",
|
|
341
|
+
"toggleTemplate",
|
|
342
|
+
"listVersions",
|
|
343
|
+
"restoreVersion",
|
|
344
|
+
"renderPreview",
|
|
345
|
+
"sendTest",
|
|
346
|
+
];
|
|
347
|
+
for (const method of grpcMethods) {
|
|
348
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
349
|
+
GrpcMethod("NotificationTemplateService", method)(constructor.prototype[method], method, descriptor);
|
|
350
|
+
}
|
|
351
|
+
const grpcStreamMethods: string[] = [];
|
|
352
|
+
for (const method of grpcStreamMethods) {
|
|
353
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
354
|
+
GrpcStreamMethod("NotificationTemplateService", method)(constructor.prototype[method], method, descriptor);
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export const NOTIFICATION_TEMPLATE_SERVICE_NAME = "NotificationTemplateService";
|
|
360
|
+
|
|
361
|
+
export interface NotificationLogsServiceClient {
|
|
362
|
+
listLogs(request: ListLogsRequest): Observable<ListLogsResponse>;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export interface NotificationLogsServiceController {
|
|
366
|
+
listLogs(request: ListLogsRequest): Promise<ListLogsResponse> | Observable<ListLogsResponse> | ListLogsResponse;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export function NotificationLogsServiceControllerMethods() {
|
|
370
|
+
return function (constructor: Function) {
|
|
371
|
+
const grpcMethods: string[] = ["listLogs"];
|
|
372
|
+
for (const method of grpcMethods) {
|
|
373
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
374
|
+
GrpcMethod("NotificationLogsService", method)(constructor.prototype[method], method, descriptor);
|
|
375
|
+
}
|
|
376
|
+
const grpcStreamMethods: string[] = [];
|
|
377
|
+
for (const method of grpcStreamMethods) {
|
|
378
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
379
|
+
GrpcStreamMethod("NotificationLogsService", method)(constructor.prototype[method], method, descriptor);
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export const NOTIFICATION_LOGS_SERVICE_NAME = "NotificationLogsService";
|
|
385
|
+
|
|
386
|
+
export interface TelegramChatsServiceClient {
|
|
387
|
+
listChats(request: ListChatsRequest): Observable<ListChatsResponse>;
|
|
388
|
+
|
|
389
|
+
upsertChat(request: UpsertChatRequest): Observable<TelegramChatResponse>;
|
|
390
|
+
|
|
391
|
+
deleteChat(request: DeleteChatRequest): Observable<DeleteChatResponse>;
|
|
392
|
+
|
|
393
|
+
testSendTelegram(request: TestSendTelegramRequest): Observable<TestSendTelegramResponse>;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export interface TelegramChatsServiceController {
|
|
397
|
+
listChats(request: ListChatsRequest): Promise<ListChatsResponse> | Observable<ListChatsResponse> | ListChatsResponse;
|
|
398
|
+
|
|
399
|
+
upsertChat(
|
|
400
|
+
request: UpsertChatRequest,
|
|
401
|
+
): Promise<TelegramChatResponse> | Observable<TelegramChatResponse> | TelegramChatResponse;
|
|
402
|
+
|
|
403
|
+
deleteChat(
|
|
404
|
+
request: DeleteChatRequest,
|
|
405
|
+
): Promise<DeleteChatResponse> | Observable<DeleteChatResponse> | DeleteChatResponse;
|
|
406
|
+
|
|
407
|
+
testSendTelegram(
|
|
408
|
+
request: TestSendTelegramRequest,
|
|
409
|
+
): Promise<TestSendTelegramResponse> | Observable<TestSendTelegramResponse> | TestSendTelegramResponse;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export function TelegramChatsServiceControllerMethods() {
|
|
413
|
+
return function (constructor: Function) {
|
|
414
|
+
const grpcMethods: string[] = ["listChats", "upsertChat", "deleteChat", "testSendTelegram"];
|
|
415
|
+
for (const method of grpcMethods) {
|
|
416
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
417
|
+
GrpcMethod("TelegramChatsService", method)(constructor.prototype[method], method, descriptor);
|
|
418
|
+
}
|
|
419
|
+
const grpcStreamMethods: string[] = [];
|
|
420
|
+
for (const method of grpcStreamMethods) {
|
|
421
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
422
|
+
GrpcStreamMethod("TelegramChatsService", method)(constructor.prototype[method], method, descriptor);
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export const TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
package/gen/order.ts
CHANGED
|
@@ -45,6 +45,11 @@ export interface OrderDelivery {
|
|
|
45
45
|
trackingUrl: string;
|
|
46
46
|
estimatedDate: string;
|
|
47
47
|
shipmentStatus: string;
|
|
48
|
+
/**
|
|
49
|
+
* Адмін-облік: область/регіон з City.region від delivery-service.
|
|
50
|
+
* Старі замовлення можуть мати порожнє значення.
|
|
51
|
+
*/
|
|
52
|
+
region: string;
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
export interface OrderPayment {
|
|
@@ -58,6 +63,12 @@ export interface OrderPayment {
|
|
|
58
63
|
capturedAt: number;
|
|
59
64
|
cancelledAt: number;
|
|
60
65
|
refundedAt: number;
|
|
66
|
+
/**
|
|
67
|
+
* Денормалізовано з payment-service для відображення в адмінці
|
|
68
|
+
* без додаткового gRPC дзвінка. Оновлюється з payment-events listener.
|
|
69
|
+
*/
|
|
70
|
+
capturedAmount: number;
|
|
71
|
+
refundedAmount: number;
|
|
61
72
|
}
|
|
62
73
|
|
|
63
74
|
export interface OrderNote {
|
|
@@ -125,6 +136,11 @@ export interface Order {
|
|
|
125
136
|
tags: string[];
|
|
126
137
|
createdAt: number;
|
|
127
138
|
updatedAt: number;
|
|
139
|
+
/**
|
|
140
|
+
* Внутрішні нотатки менеджерів (видимі тільки в адмінці).
|
|
141
|
+
* Сортуються від новіших до старіших — server-side.
|
|
142
|
+
*/
|
|
143
|
+
notes: OrderNote[];
|
|
128
144
|
}
|
|
129
145
|
|
|
130
146
|
export interface CreateOrderRequest {
|
package/gen/payment.ts
CHANGED
|
@@ -109,6 +109,11 @@ export interface SyncStatusRequest {
|
|
|
109
109
|
id: string;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
export interface RegenerateInvoiceRequest {
|
|
113
|
+
id: string;
|
|
114
|
+
actorId: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
112
117
|
export interface ListProvidersRequest {
|
|
113
118
|
onlyEnabled: boolean;
|
|
114
119
|
}
|
|
@@ -163,6 +168,14 @@ export interface PaymentServiceClient {
|
|
|
163
168
|
|
|
164
169
|
syncStatus(request: SyncStatusRequest): Observable<PaymentResponse>;
|
|
165
170
|
|
|
171
|
+
/**
|
|
172
|
+
* RegenerateInvoice — створює новий invoice у провайдера для існуючого Payment.
|
|
173
|
+
* Використовується коли paymentUrl застарів (TTL у Mono ≈ 24г) або клієнт
|
|
174
|
+
* загубив SMS — менеджер ділиться новим лінком через адмін UI.
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
regenerateInvoice(request: RegenerateInvoiceRequest): Observable<PaymentResponse>;
|
|
178
|
+
|
|
166
179
|
listProviders(request: ListProvidersRequest): Observable<ListProvidersResponse>;
|
|
167
180
|
|
|
168
181
|
toggleProvider(request: ToggleProviderRequest): Observable<ToggleProviderResponse>;
|
|
@@ -201,6 +214,16 @@ export interface PaymentServiceController {
|
|
|
201
214
|
|
|
202
215
|
syncStatus(request: SyncStatusRequest): Promise<PaymentResponse> | Observable<PaymentResponse> | PaymentResponse;
|
|
203
216
|
|
|
217
|
+
/**
|
|
218
|
+
* RegenerateInvoice — створює новий invoice у провайдера для існуючого Payment.
|
|
219
|
+
* Використовується коли paymentUrl застарів (TTL у Mono ≈ 24г) або клієнт
|
|
220
|
+
* загубив SMS — менеджер ділиться новим лінком через адмін UI.
|
|
221
|
+
*/
|
|
222
|
+
|
|
223
|
+
regenerateInvoice(
|
|
224
|
+
request: RegenerateInvoiceRequest,
|
|
225
|
+
): Promise<PaymentResponse> | Observable<PaymentResponse> | PaymentResponse;
|
|
226
|
+
|
|
204
227
|
listProviders(
|
|
205
228
|
request: ListProvidersRequest,
|
|
206
229
|
): Promise<ListProvidersResponse> | Observable<ListProvidersResponse> | ListProvidersResponse;
|
|
@@ -221,6 +244,7 @@ export function PaymentServiceControllerMethods() {
|
|
|
221
244
|
"cancel",
|
|
222
245
|
"refund",
|
|
223
246
|
"syncStatus",
|
|
247
|
+
"regenerateInvoice",
|
|
224
248
|
"listProviders",
|
|
225
249
|
"toggleProvider",
|
|
226
250
|
];
|
package/gen/product.ts
CHANGED
|
@@ -121,7 +121,11 @@ export interface ProductListItemResponse {
|
|
|
121
121
|
rating: number;
|
|
122
122
|
reviewCount: number;
|
|
123
123
|
stickers: ProductStickerResponse[];
|
|
124
|
-
activePromo?:
|
|
124
|
+
activePromo?:
|
|
125
|
+
| ProductPromoInfo
|
|
126
|
+
| undefined;
|
|
127
|
+
/** Вага у кг для розрахунку доставки (0 → fallback на defaultItemWeightKg). */
|
|
128
|
+
weightKg: number;
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
export interface ProductListItemResponse_NameEntry {
|
|
@@ -169,6 +173,8 @@ export interface ProductDetailResponse {
|
|
|
169
173
|
manualRating?: number | undefined;
|
|
170
174
|
activePromo?: ProductPromoInfo | undefined;
|
|
171
175
|
colors: ProductColorResponse[];
|
|
176
|
+
/** Вага товару у кг для розрахунку доставки (variant може override'ити). */
|
|
177
|
+
weightKg: number;
|
|
172
178
|
}
|
|
173
179
|
|
|
174
180
|
export interface ProductDetailResponse_NameEntry {
|
|
@@ -379,6 +385,7 @@ export interface CreateProductRequest {
|
|
|
379
385
|
groupId?: string | undefined;
|
|
380
386
|
colorLabel: { [key: string]: string };
|
|
381
387
|
colorHex?: string | undefined;
|
|
388
|
+
weightKg?: number | undefined;
|
|
382
389
|
}
|
|
383
390
|
|
|
384
391
|
export interface CreateProductRequest_NameEntry {
|
|
@@ -437,6 +444,7 @@ export interface UpdateProductRequest {
|
|
|
437
444
|
colorLabel: { [key: string]: string };
|
|
438
445
|
colorHex?: string | undefined;
|
|
439
446
|
manualRating?: number | undefined;
|
|
447
|
+
weightKg?: number | undefined;
|
|
440
448
|
}
|
|
441
449
|
|
|
442
450
|
export interface UpdateProductRequest_NameEntry {
|
|
@@ -688,7 +696,11 @@ export interface ProductVariantDetailResponse {
|
|
|
688
696
|
images: ProductImageResponse[];
|
|
689
697
|
attributes: ProductAttributeResponse[];
|
|
690
698
|
overrides: VariantOverrides | undefined;
|
|
691
|
-
colorId?:
|
|
699
|
+
colorId?:
|
|
700
|
+
| string
|
|
701
|
+
| undefined;
|
|
702
|
+
/** Override-вага варіанту у кг; 0 означає "успадкувати від продукту". */
|
|
703
|
+
weightKg: number;
|
|
692
704
|
}
|
|
693
705
|
|
|
694
706
|
export interface ProductVariantDetailResponse_OptionsEntry {
|
|
@@ -733,6 +745,7 @@ export interface VariantOverrides {
|
|
|
733
745
|
hasOwnAttributes: boolean;
|
|
734
746
|
hasOwnVideo: boolean;
|
|
735
747
|
hasOwnOldPrice: boolean;
|
|
748
|
+
hasOwnWeight: boolean;
|
|
736
749
|
}
|
|
737
750
|
|
|
738
751
|
export interface CreateProductVariantRequest {
|
|
@@ -754,7 +767,11 @@ export interface CreateProductVariantRequest {
|
|
|
754
767
|
videoUrl?: string | undefined;
|
|
755
768
|
images: ProductImagePayload[];
|
|
756
769
|
attributeValueIds: string[];
|
|
757
|
-
colorId?:
|
|
770
|
+
colorId?:
|
|
771
|
+
| string
|
|
772
|
+
| undefined;
|
|
773
|
+
/** Override-вага варіанту у кг (null/unset → успадкувати від продукту). */
|
|
774
|
+
weightKg?: number | undefined;
|
|
758
775
|
}
|
|
759
776
|
|
|
760
777
|
export interface CreateProductVariantRequest_OptionsEntry {
|
|
@@ -806,7 +823,11 @@ export interface UpdateProductVariantRequest {
|
|
|
806
823
|
videoUrl?: string | undefined;
|
|
807
824
|
images: ProductImagePayload[];
|
|
808
825
|
attributeValueIds: string[];
|
|
809
|
-
colorId?:
|
|
826
|
+
colorId?:
|
|
827
|
+
| string
|
|
828
|
+
| undefined;
|
|
829
|
+
/** Override-вага варіанту у кг (null/unset → успадкувати від продукту). */
|
|
830
|
+
weightKg?: number | undefined;
|
|
810
831
|
clearPrice: boolean;
|
|
811
832
|
clearOldPrice: boolean;
|
|
812
833
|
clearName: boolean;
|
|
@@ -819,6 +840,7 @@ export interface UpdateProductVariantRequest {
|
|
|
819
840
|
clearAttributes: boolean;
|
|
820
841
|
clearVideo: boolean;
|
|
821
842
|
clearColor: boolean;
|
|
843
|
+
clearWeight: boolean;
|
|
822
844
|
}
|
|
823
845
|
|
|
824
846
|
export interface UpdateProductVariantRequest_OptionsEntry {
|
|
@@ -902,7 +924,11 @@ export interface VariantLookupResult {
|
|
|
902
924
|
/** Локалізована назва (uk → ru → перше) для зручності клієнта. */
|
|
903
925
|
nameUk: string;
|
|
904
926
|
mainImage: string;
|
|
905
|
-
colorId?:
|
|
927
|
+
colorId?:
|
|
928
|
+
| string
|
|
929
|
+
| undefined;
|
|
930
|
+
/** Вага у кг (variant.weight_kg ?? product.weight_kg ?? 0). */
|
|
931
|
+
weightKg: number;
|
|
906
932
|
}
|
|
907
933
|
|
|
908
934
|
export interface BulkLookupVariantsRequest {
|