@mamindom/contracts 1.0.130 → 1.0.133
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/index.d.ts +1 -0
- package/dist/events/auth/index.js +1 -0
- package/dist/events/auth/user-authenticated.interface.d.ts +5 -0
- package/dist/events/auth/user-authenticated.interface.js +2 -0
- package/dist/gen/notification.d.ts +239 -0
- package/dist/gen/notification.js +50 -1
- package/dist/gen/order.d.ts +18 -0
- package/dist/gen/order.js +1 -0
- package/dist/gen/users.d.ts +15 -0
- package/dist/gen/users.js +1 -0
- package/dist/proto/notification.proto +232 -0
- package/dist/proto/order.proto +20 -0
- package/dist/proto/users.proto +16 -0
- package/events/auth/index.ts +1 -0
- package/events/auth/user-authenticated.interface.ts +5 -0
- package/gen/notification.ts +348 -0
- package/gen/order.ts +28 -0
- package/gen/users.ts +26 -0
- package/package.json +1 -1
- package/proto/notification.proto +232 -0
- package/proto/order.proto +20 -0
- package/proto/users.proto +16 -0
|
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./otp-requested.interface"), exports);
|
|
18
|
+
__exportStar(require("./user-authenticated.interface"), exports);
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
export declare const protobufPackage = "notification.v1";
|
|
3
|
+
export declare enum CampaignStatusEnum {
|
|
4
|
+
CAMPAIGN_STATUS_UNSPECIFIED = 0,
|
|
5
|
+
DRAFT = 1,
|
|
6
|
+
SCHEDULED = 2,
|
|
7
|
+
RUNNING = 3,
|
|
8
|
+
COMPLETED = 4,
|
|
9
|
+
CANCELLED = 5,
|
|
10
|
+
CAMPAIGN_FAILED = 6,
|
|
11
|
+
UNRECOGNIZED = -1
|
|
12
|
+
}
|
|
13
|
+
export declare enum CampaignRecipientStatusEnum {
|
|
14
|
+
CAMPAIGN_RECIPIENT_UNSPECIFIED = 0,
|
|
15
|
+
RECIPIENT_PENDING = 1,
|
|
16
|
+
RECIPIENT_SENT = 2,
|
|
17
|
+
RECIPIENT_FAILED = 3,
|
|
18
|
+
RECIPIENT_SKIPPED_OPT_OUT = 4,
|
|
19
|
+
RECIPIENT_SKIPPED_NO_CONTACT = 5,
|
|
20
|
+
UNRECOGNIZED = -1
|
|
21
|
+
}
|
|
3
22
|
export declare enum NotificationChannel {
|
|
4
23
|
NOTIFICATION_CHANNEL_UNSPECIFIED = 0,
|
|
5
24
|
EMAIL = 1,
|
|
@@ -44,6 +63,182 @@ export declare enum TelegramTopic {
|
|
|
44
63
|
GENERAL = 9,
|
|
45
64
|
UNRECOGNIZED = -1
|
|
46
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* SendToCustomer — викликається з gateway після того, як клієнтський контакт
|
|
68
|
+
* (email/phone) вже резолвнений і опційно згенерований персональний купон.
|
|
69
|
+
*/
|
|
70
|
+
export interface SendToCustomerRequest {
|
|
71
|
+
/** userId з auth-service — пишемо в NotificationLog.user_id для зведень. */
|
|
72
|
+
userId: string;
|
|
73
|
+
channel: NotificationChannel;
|
|
74
|
+
/** Recipient — email або phone, заздалегідь визначені gateway з акаунта. */
|
|
75
|
+
recipient: string;
|
|
76
|
+
/** Шлях 1: templateId — рендеримо існуючий шаблон з variables. */
|
|
77
|
+
templateId?: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Шлях 2: ad-hoc контент. Якщо template_id порожній — використовуємо ці поля.
|
|
80
|
+
* body_html — для EMAIL (буде обгорнутий брендингом).
|
|
81
|
+
* body_text — для SMS (plain text) або текстова версія email.
|
|
82
|
+
*/
|
|
83
|
+
customSubject?: string | undefined;
|
|
84
|
+
customBodyHtml?: string | undefined;
|
|
85
|
+
customBodyText?: string | undefined;
|
|
86
|
+
/** JSON з placeholders для Handlebars: { "coupon_code": "...", ... } */
|
|
87
|
+
variablesJson: string;
|
|
88
|
+
/** Locale для пошуку версії шаблону + надсилання branding-обгортки. */
|
|
89
|
+
locale?: NotificationLocale | undefined;
|
|
90
|
+
}
|
|
91
|
+
export interface SendToCustomerResponse {
|
|
92
|
+
ok: boolean;
|
|
93
|
+
errorMessage: string;
|
|
94
|
+
/** id запису в NotificationLog (для трекінгу в /notifications/logs). */
|
|
95
|
+
logId: string;
|
|
96
|
+
}
|
|
97
|
+
export interface EnqueueRecipientsRequest {
|
|
98
|
+
campaignId: string;
|
|
99
|
+
recipients: CampaignResolvedRecipient[];
|
|
100
|
+
}
|
|
101
|
+
export interface CampaignResolvedRecipient {
|
|
102
|
+
userId: string;
|
|
103
|
+
/** email або phone */
|
|
104
|
+
recipient: string;
|
|
105
|
+
/**
|
|
106
|
+
* true → у клієнта promotions=false. dispatcher позначить SKIPPED_OPT_OUT
|
|
107
|
+
* якщо respect_opt_out=true для кампанії.
|
|
108
|
+
*/
|
|
109
|
+
optOut: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Унікальний код, згенерований gateway через CouponsService.CreateCoupon.
|
|
112
|
+
* Підставляється у шаблон як {{coupon_code}}.
|
|
113
|
+
*/
|
|
114
|
+
couponCode?: string | undefined;
|
|
115
|
+
}
|
|
116
|
+
export interface EnqueueRecipientsResponse {
|
|
117
|
+
enqueued: number;
|
|
118
|
+
}
|
|
119
|
+
export interface ListCampaignsRequest {
|
|
120
|
+
status?: CampaignStatusEnum | undefined;
|
|
121
|
+
page?: number | undefined;
|
|
122
|
+
limit?: number | undefined;
|
|
123
|
+
}
|
|
124
|
+
export interface ListCampaignsResponse {
|
|
125
|
+
items: Campaign[];
|
|
126
|
+
total: number;
|
|
127
|
+
}
|
|
128
|
+
export interface GetCampaignRequest {
|
|
129
|
+
id: string;
|
|
130
|
+
}
|
|
131
|
+
export interface DeleteCampaignRequest {
|
|
132
|
+
id: string;
|
|
133
|
+
}
|
|
134
|
+
export interface DeleteCampaignResponse {
|
|
135
|
+
ok: boolean;
|
|
136
|
+
}
|
|
137
|
+
export interface StartCampaignRequest {
|
|
138
|
+
id: string;
|
|
139
|
+
/** ISO date; якщо порожньо → запустити одразу. */
|
|
140
|
+
scheduledAt?: string | undefined;
|
|
141
|
+
}
|
|
142
|
+
export interface CancelCampaignRequest {
|
|
143
|
+
id: string;
|
|
144
|
+
}
|
|
145
|
+
export interface CreateCampaignRequest {
|
|
146
|
+
name: string;
|
|
147
|
+
channel: NotificationChannel;
|
|
148
|
+
templateId?: string | undefined;
|
|
149
|
+
customSubject?: string | undefined;
|
|
150
|
+
customBodyHtml?: string | undefined;
|
|
151
|
+
customBodyText?: string | undefined;
|
|
152
|
+
/** JSON segment spec. */
|
|
153
|
+
segmentJson: string;
|
|
154
|
+
/** JSON coupon spec — null/empty для кампаній без купонів. */
|
|
155
|
+
couponSpecJson?: string | undefined;
|
|
156
|
+
respectOptOut: boolean;
|
|
157
|
+
locale?: NotificationLocale | undefined;
|
|
158
|
+
createdById: string;
|
|
159
|
+
}
|
|
160
|
+
export interface UpdateCampaignRequest {
|
|
161
|
+
id: string;
|
|
162
|
+
/** Можна оновлювати тільки DRAFT — гілки нижче опційні. */
|
|
163
|
+
name?: string | undefined;
|
|
164
|
+
channel?: NotificationChannel | undefined;
|
|
165
|
+
templateId?: string | undefined;
|
|
166
|
+
customSubject?: string | undefined;
|
|
167
|
+
customBodyHtml?: string | undefined;
|
|
168
|
+
customBodyText?: string | undefined;
|
|
169
|
+
segmentJson?: string | undefined;
|
|
170
|
+
couponSpecJson?: string | undefined;
|
|
171
|
+
respectOptOut?: boolean | undefined;
|
|
172
|
+
locale?: NotificationLocale | undefined;
|
|
173
|
+
}
|
|
174
|
+
export interface CampaignResponse {
|
|
175
|
+
ok: boolean;
|
|
176
|
+
errorMessage: string;
|
|
177
|
+
campaign: Campaign | undefined;
|
|
178
|
+
}
|
|
179
|
+
export interface Campaign {
|
|
180
|
+
id: string;
|
|
181
|
+
name: string;
|
|
182
|
+
channel: NotificationChannel;
|
|
183
|
+
templateId?: string | undefined;
|
|
184
|
+
customSubject?: string | undefined;
|
|
185
|
+
customBodyHtml?: string | undefined;
|
|
186
|
+
customBodyText?: string | undefined;
|
|
187
|
+
locale: NotificationLocale;
|
|
188
|
+
segmentJson: string;
|
|
189
|
+
couponSpecJson?: string | undefined;
|
|
190
|
+
respectOptOut: boolean;
|
|
191
|
+
status: CampaignStatusEnum;
|
|
192
|
+
scheduledAt?: string | undefined;
|
|
193
|
+
startedAt?: string | undefined;
|
|
194
|
+
completedAt?: string | undefined;
|
|
195
|
+
totalRecipients: number;
|
|
196
|
+
sentCount: number;
|
|
197
|
+
failedCount: number;
|
|
198
|
+
skippedOptOutCount: number;
|
|
199
|
+
createdById: string;
|
|
200
|
+
createdAt: string;
|
|
201
|
+
updatedAt: string;
|
|
202
|
+
}
|
|
203
|
+
export interface PreviewSegmentRequest {
|
|
204
|
+
segmentJson: string;
|
|
205
|
+
/** потрібно для перевірки наявності email/phone */
|
|
206
|
+
channel: NotificationChannel;
|
|
207
|
+
}
|
|
208
|
+
export interface PreviewSegmentResponse {
|
|
209
|
+
totalCount: number;
|
|
210
|
+
/** Перші 10 для UI; решта — за необхідності окремим запитом. */
|
|
211
|
+
sample: PreviewSegmentSample[];
|
|
212
|
+
}
|
|
213
|
+
export interface PreviewSegmentSample {
|
|
214
|
+
userId: string;
|
|
215
|
+
firstName: string;
|
|
216
|
+
lastName: string;
|
|
217
|
+
email: string;
|
|
218
|
+
phone: string;
|
|
219
|
+
}
|
|
220
|
+
export interface ListRecipientsRequest {
|
|
221
|
+
campaignId: string;
|
|
222
|
+
status?: CampaignRecipientStatusEnum | undefined;
|
|
223
|
+
page?: number | undefined;
|
|
224
|
+
limit?: number | undefined;
|
|
225
|
+
}
|
|
226
|
+
export interface ListRecipientsResponse {
|
|
227
|
+
items: CampaignRecipient[];
|
|
228
|
+
total: number;
|
|
229
|
+
}
|
|
230
|
+
export interface CampaignRecipient {
|
|
231
|
+
id: string;
|
|
232
|
+
campaignId: string;
|
|
233
|
+
userId: string;
|
|
234
|
+
recipient: string;
|
|
235
|
+
status: CampaignRecipientStatusEnum;
|
|
236
|
+
couponCode?: string | undefined;
|
|
237
|
+
notificationLogId?: string | undefined;
|
|
238
|
+
errorMessage?: string | undefined;
|
|
239
|
+
sentAt?: string | undefined;
|
|
240
|
+
createdAt: string;
|
|
241
|
+
}
|
|
47
242
|
export interface BrandingEmpty {
|
|
48
243
|
}
|
|
49
244
|
/**
|
|
@@ -281,6 +476,8 @@ export interface NotificationTemplateServiceClient {
|
|
|
281
476
|
restoreVersion(request: RestoreVersionRequest): Observable<TemplateResponse>;
|
|
282
477
|
renderPreview(request: RenderPreviewRequest): Observable<RenderPreviewResponse>;
|
|
283
478
|
sendTest(request: SendTestRequest): Observable<SendTestResponse>;
|
|
479
|
+
/** Реальна відправка клієнту з адмінки — або по шаблону, або ad-hoc body. */
|
|
480
|
+
sendToCustomer(request: SendToCustomerRequest): Observable<SendToCustomerResponse>;
|
|
284
481
|
}
|
|
285
482
|
export interface NotificationTemplateServiceController {
|
|
286
483
|
listTemplates(request: ListTemplatesRequest): Promise<ListTemplatesResponse> | Observable<ListTemplatesResponse> | ListTemplatesResponse;
|
|
@@ -292,6 +489,8 @@ export interface NotificationTemplateServiceController {
|
|
|
292
489
|
restoreVersion(request: RestoreVersionRequest): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
293
490
|
renderPreview(request: RenderPreviewRequest): Promise<RenderPreviewResponse> | Observable<RenderPreviewResponse> | RenderPreviewResponse;
|
|
294
491
|
sendTest(request: SendTestRequest): Promise<SendTestResponse> | Observable<SendTestResponse> | SendTestResponse;
|
|
492
|
+
/** Реальна відправка клієнту з адмінки — або по шаблону, або ad-hoc body. */
|
|
493
|
+
sendToCustomer(request: SendToCustomerRequest): Promise<SendToCustomerResponse> | Observable<SendToCustomerResponse> | SendToCustomerResponse;
|
|
295
494
|
}
|
|
296
495
|
export declare function NotificationTemplateServiceControllerMethods(): (constructor: Function) => void;
|
|
297
496
|
export declare const NOTIFICATION_TEMPLATE_SERVICE_NAME = "NotificationTemplateService";
|
|
@@ -317,6 +516,46 @@ export interface TelegramChatsServiceController {
|
|
|
317
516
|
}
|
|
318
517
|
export declare function TelegramChatsServiceControllerMethods(): (constructor: Function) => void;
|
|
319
518
|
export declare const TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
|
519
|
+
/** Маркетингові кампанії: створення, запуск, статистика. */
|
|
520
|
+
export interface CampaignsServiceClient {
|
|
521
|
+
listCampaigns(request: ListCampaignsRequest): Observable<ListCampaignsResponse>;
|
|
522
|
+
getCampaign(request: GetCampaignRequest): Observable<CampaignResponse>;
|
|
523
|
+
createCampaign(request: CreateCampaignRequest): Observable<CampaignResponse>;
|
|
524
|
+
updateCampaign(request: UpdateCampaignRequest): Observable<CampaignResponse>;
|
|
525
|
+
deleteCampaign(request: DeleteCampaignRequest): Observable<DeleteCampaignResponse>;
|
|
526
|
+
startCampaign(request: StartCampaignRequest): Observable<CampaignResponse>;
|
|
527
|
+
cancelCampaign(request: CancelCampaignRequest): Observable<CampaignResponse>;
|
|
528
|
+
/** Превью сегменту — повертає кількість + перші N клієнтів, БЕЗ створення кампанії. */
|
|
529
|
+
previewSegment(request: PreviewSegmentRequest): Observable<PreviewSegmentResponse>;
|
|
530
|
+
/** Список отримувачів конкретної кампанії з їхніми статусами. */
|
|
531
|
+
listRecipients(request: ListRecipientsRequest): Observable<ListRecipientsResponse>;
|
|
532
|
+
/**
|
|
533
|
+
* Викликається з gateway після того, як сегмент резолвнено клієнтами —
|
|
534
|
+
* передається список {userId, recipient}, нотифікація розкладає у чергу.
|
|
535
|
+
*/
|
|
536
|
+
enqueueRecipients(request: EnqueueRecipientsRequest): Observable<EnqueueRecipientsResponse>;
|
|
537
|
+
}
|
|
538
|
+
/** Маркетингові кампанії: створення, запуск, статистика. */
|
|
539
|
+
export interface CampaignsServiceController {
|
|
540
|
+
listCampaigns(request: ListCampaignsRequest): Promise<ListCampaignsResponse> | Observable<ListCampaignsResponse> | ListCampaignsResponse;
|
|
541
|
+
getCampaign(request: GetCampaignRequest): Promise<CampaignResponse> | Observable<CampaignResponse> | CampaignResponse;
|
|
542
|
+
createCampaign(request: CreateCampaignRequest): Promise<CampaignResponse> | Observable<CampaignResponse> | CampaignResponse;
|
|
543
|
+
updateCampaign(request: UpdateCampaignRequest): Promise<CampaignResponse> | Observable<CampaignResponse> | CampaignResponse;
|
|
544
|
+
deleteCampaign(request: DeleteCampaignRequest): Promise<DeleteCampaignResponse> | Observable<DeleteCampaignResponse> | DeleteCampaignResponse;
|
|
545
|
+
startCampaign(request: StartCampaignRequest): Promise<CampaignResponse> | Observable<CampaignResponse> | CampaignResponse;
|
|
546
|
+
cancelCampaign(request: CancelCampaignRequest): Promise<CampaignResponse> | Observable<CampaignResponse> | CampaignResponse;
|
|
547
|
+
/** Превью сегменту — повертає кількість + перші N клієнтів, БЕЗ створення кампанії. */
|
|
548
|
+
previewSegment(request: PreviewSegmentRequest): Promise<PreviewSegmentResponse> | Observable<PreviewSegmentResponse> | PreviewSegmentResponse;
|
|
549
|
+
/** Список отримувачів конкретної кампанії з їхніми статусами. */
|
|
550
|
+
listRecipients(request: ListRecipientsRequest): Promise<ListRecipientsResponse> | Observable<ListRecipientsResponse> | ListRecipientsResponse;
|
|
551
|
+
/**
|
|
552
|
+
* Викликається з gateway після того, як сегмент резолвнено клієнтами —
|
|
553
|
+
* передається список {userId, recipient}, нотифікація розкладає у чергу.
|
|
554
|
+
*/
|
|
555
|
+
enqueueRecipients(request: EnqueueRecipientsRequest): Promise<EnqueueRecipientsResponse> | Observable<EnqueueRecipientsResponse> | EnqueueRecipientsResponse;
|
|
556
|
+
}
|
|
557
|
+
export declare function CampaignsServiceControllerMethods(): (constructor: Function) => void;
|
|
558
|
+
export declare const CAMPAIGNS_SERVICE_NAME = "CampaignsService";
|
|
320
559
|
/** Брендинг email-шаблонів — singleton редагується адміном. */
|
|
321
560
|
export interface BrandingServiceClient {
|
|
322
561
|
getBranding(request: BrandingEmpty): Observable<BrandingProfile>;
|
package/dist/gen/notification.js
CHANGED
|
@@ -5,14 +5,36 @@
|
|
|
5
5
|
// protoc v3.21.12
|
|
6
6
|
// source: notification.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.BRANDING_SERVICE_NAME = exports.TELEGRAM_CHATS_SERVICE_NAME = exports.NOTIFICATION_LOGS_SERVICE_NAME = exports.NOTIFICATION_TEMPLATE_SERVICE_NAME = exports.NOTIFICATION_V1_PACKAGE_NAME = exports.TelegramTopic = exports.NotificationStatus = exports.NotificationCategory = exports.NotificationLocale = exports.NotificationChannel = exports.protobufPackage = void 0;
|
|
8
|
+
exports.BRANDING_SERVICE_NAME = exports.CAMPAIGNS_SERVICE_NAME = exports.TELEGRAM_CHATS_SERVICE_NAME = exports.NOTIFICATION_LOGS_SERVICE_NAME = exports.NOTIFICATION_TEMPLATE_SERVICE_NAME = exports.NOTIFICATION_V1_PACKAGE_NAME = exports.TelegramTopic = exports.NotificationStatus = exports.NotificationCategory = exports.NotificationLocale = exports.NotificationChannel = exports.CampaignRecipientStatusEnum = exports.CampaignStatusEnum = exports.protobufPackage = void 0;
|
|
9
9
|
exports.NotificationTemplateServiceControllerMethods = NotificationTemplateServiceControllerMethods;
|
|
10
10
|
exports.NotificationLogsServiceControllerMethods = NotificationLogsServiceControllerMethods;
|
|
11
11
|
exports.TelegramChatsServiceControllerMethods = TelegramChatsServiceControllerMethods;
|
|
12
|
+
exports.CampaignsServiceControllerMethods = CampaignsServiceControllerMethods;
|
|
12
13
|
exports.BrandingServiceControllerMethods = BrandingServiceControllerMethods;
|
|
13
14
|
/* eslint-disable */
|
|
14
15
|
const microservices_1 = require("@nestjs/microservices");
|
|
15
16
|
exports.protobufPackage = "notification.v1";
|
|
17
|
+
var CampaignStatusEnum;
|
|
18
|
+
(function (CampaignStatusEnum) {
|
|
19
|
+
CampaignStatusEnum[CampaignStatusEnum["CAMPAIGN_STATUS_UNSPECIFIED"] = 0] = "CAMPAIGN_STATUS_UNSPECIFIED";
|
|
20
|
+
CampaignStatusEnum[CampaignStatusEnum["DRAFT"] = 1] = "DRAFT";
|
|
21
|
+
CampaignStatusEnum[CampaignStatusEnum["SCHEDULED"] = 2] = "SCHEDULED";
|
|
22
|
+
CampaignStatusEnum[CampaignStatusEnum["RUNNING"] = 3] = "RUNNING";
|
|
23
|
+
CampaignStatusEnum[CampaignStatusEnum["COMPLETED"] = 4] = "COMPLETED";
|
|
24
|
+
CampaignStatusEnum[CampaignStatusEnum["CANCELLED"] = 5] = "CANCELLED";
|
|
25
|
+
CampaignStatusEnum[CampaignStatusEnum["CAMPAIGN_FAILED"] = 6] = "CAMPAIGN_FAILED";
|
|
26
|
+
CampaignStatusEnum[CampaignStatusEnum["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
27
|
+
})(CampaignStatusEnum || (exports.CampaignStatusEnum = CampaignStatusEnum = {}));
|
|
28
|
+
var CampaignRecipientStatusEnum;
|
|
29
|
+
(function (CampaignRecipientStatusEnum) {
|
|
30
|
+
CampaignRecipientStatusEnum[CampaignRecipientStatusEnum["CAMPAIGN_RECIPIENT_UNSPECIFIED"] = 0] = "CAMPAIGN_RECIPIENT_UNSPECIFIED";
|
|
31
|
+
CampaignRecipientStatusEnum[CampaignRecipientStatusEnum["RECIPIENT_PENDING"] = 1] = "RECIPIENT_PENDING";
|
|
32
|
+
CampaignRecipientStatusEnum[CampaignRecipientStatusEnum["RECIPIENT_SENT"] = 2] = "RECIPIENT_SENT";
|
|
33
|
+
CampaignRecipientStatusEnum[CampaignRecipientStatusEnum["RECIPIENT_FAILED"] = 3] = "RECIPIENT_FAILED";
|
|
34
|
+
CampaignRecipientStatusEnum[CampaignRecipientStatusEnum["RECIPIENT_SKIPPED_OPT_OUT"] = 4] = "RECIPIENT_SKIPPED_OPT_OUT";
|
|
35
|
+
CampaignRecipientStatusEnum[CampaignRecipientStatusEnum["RECIPIENT_SKIPPED_NO_CONTACT"] = 5] = "RECIPIENT_SKIPPED_NO_CONTACT";
|
|
36
|
+
CampaignRecipientStatusEnum[CampaignRecipientStatusEnum["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
37
|
+
})(CampaignRecipientStatusEnum || (exports.CampaignRecipientStatusEnum = CampaignRecipientStatusEnum = {}));
|
|
16
38
|
var NotificationChannel;
|
|
17
39
|
(function (NotificationChannel) {
|
|
18
40
|
NotificationChannel[NotificationChannel["NOTIFICATION_CHANNEL_UNSPECIFIED"] = 0] = "NOTIFICATION_CHANNEL_UNSPECIFIED";
|
|
@@ -75,6 +97,7 @@ function NotificationTemplateServiceControllerMethods() {
|
|
|
75
97
|
"restoreVersion",
|
|
76
98
|
"renderPreview",
|
|
77
99
|
"sendTest",
|
|
100
|
+
"sendToCustomer",
|
|
78
101
|
];
|
|
79
102
|
for (const method of grpcMethods) {
|
|
80
103
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
@@ -118,6 +141,32 @@ function TelegramChatsServiceControllerMethods() {
|
|
|
118
141
|
};
|
|
119
142
|
}
|
|
120
143
|
exports.TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
|
144
|
+
function CampaignsServiceControllerMethods() {
|
|
145
|
+
return function (constructor) {
|
|
146
|
+
const grpcMethods = [
|
|
147
|
+
"listCampaigns",
|
|
148
|
+
"getCampaign",
|
|
149
|
+
"createCampaign",
|
|
150
|
+
"updateCampaign",
|
|
151
|
+
"deleteCampaign",
|
|
152
|
+
"startCampaign",
|
|
153
|
+
"cancelCampaign",
|
|
154
|
+
"previewSegment",
|
|
155
|
+
"listRecipients",
|
|
156
|
+
"enqueueRecipients",
|
|
157
|
+
];
|
|
158
|
+
for (const method of grpcMethods) {
|
|
159
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
160
|
+
(0, microservices_1.GrpcMethod)("CampaignsService", method)(constructor.prototype[method], method, descriptor);
|
|
161
|
+
}
|
|
162
|
+
const grpcStreamMethods = [];
|
|
163
|
+
for (const method of grpcStreamMethods) {
|
|
164
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
165
|
+
(0, microservices_1.GrpcStreamMethod)("CampaignsService", method)(constructor.prototype[method], method, descriptor);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
exports.CAMPAIGNS_SERVICE_NAME = "CampaignsService";
|
|
121
170
|
function BrandingServiceControllerMethods() {
|
|
122
171
|
return function (constructor) {
|
|
123
172
|
const grpcMethods = ["getBranding", "updateBranding"];
|
package/dist/gen/order.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
export declare const protobufPackage = "order.v1";
|
|
3
|
+
export interface AggregateByCustomersRequest {
|
|
4
|
+
userIds: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface CustomerOrderAggregate {
|
|
7
|
+
userId: string;
|
|
8
|
+
ordersCount: number;
|
|
9
|
+
/** Decimal у вигляді рядка ('1234.56') — щоб не втратити точність на gRPC border. */
|
|
10
|
+
totalSum: string;
|
|
11
|
+
/** ISO-рядок, відсутній якщо клієнт ще не робив замовлень. */
|
|
12
|
+
lastOrderAt?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface AggregateByCustomersResponse {
|
|
15
|
+
items: CustomerOrderAggregate[];
|
|
16
|
+
}
|
|
3
17
|
export interface OrderItem {
|
|
4
18
|
id: string;
|
|
5
19
|
productId: string;
|
|
@@ -268,6 +282,8 @@ export interface OrderServiceClient {
|
|
|
268
282
|
setTrackingNumber(request: SetTrackingNumberRequest): Observable<OrderResponse>;
|
|
269
283
|
reorderOrder(request: ReorderOrderRequest): Observable<ReorderResponse>;
|
|
270
284
|
listHistory(request: ListHistoryRequest): Observable<ListHistoryResponse>;
|
|
285
|
+
/** CRM-агрегація для експорту клієнтів — повертає count/sum/last для кожного userId. */
|
|
286
|
+
aggregateByCustomers(request: AggregateByCustomersRequest): Observable<AggregateByCustomersResponse>;
|
|
271
287
|
}
|
|
272
288
|
export interface OrderServiceController {
|
|
273
289
|
createOrder(request: CreateOrderRequest): Promise<OrderResponse> | Observable<OrderResponse> | OrderResponse;
|
|
@@ -286,6 +302,8 @@ export interface OrderServiceController {
|
|
|
286
302
|
setTrackingNumber(request: SetTrackingNumberRequest): Promise<OrderResponse> | Observable<OrderResponse> | OrderResponse;
|
|
287
303
|
reorderOrder(request: ReorderOrderRequest): Promise<ReorderResponse> | Observable<ReorderResponse> | ReorderResponse;
|
|
288
304
|
listHistory(request: ListHistoryRequest): Promise<ListHistoryResponse> | Observable<ListHistoryResponse> | ListHistoryResponse;
|
|
305
|
+
/** CRM-агрегація для експорту клієнтів — повертає count/sum/last для кожного userId. */
|
|
306
|
+
aggregateByCustomers(request: AggregateByCustomersRequest): Promise<AggregateByCustomersResponse> | Observable<AggregateByCustomersResponse> | AggregateByCustomersResponse;
|
|
289
307
|
}
|
|
290
308
|
export declare function OrderServiceControllerMethods(): (constructor: Function) => void;
|
|
291
309
|
export declare const ORDER_SERVICE_NAME = "OrderService";
|
package/dist/gen/order.js
CHANGED
|
@@ -30,6 +30,7 @@ function OrderServiceControllerMethods() {
|
|
|
30
30
|
"setTrackingNumber",
|
|
31
31
|
"reorderOrder",
|
|
32
32
|
"listHistory",
|
|
33
|
+
"aggregateByCustomers",
|
|
33
34
|
];
|
|
34
35
|
for (const method of grpcMethods) {
|
|
35
36
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/dist/gen/users.d.ts
CHANGED
|
@@ -44,6 +44,17 @@ export interface User {
|
|
|
44
44
|
bonuses: number;
|
|
45
45
|
email?: string | undefined;
|
|
46
46
|
phone?: string | undefined;
|
|
47
|
+
internalNote?: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
export interface AdminUpdateCustomerRequest {
|
|
50
|
+
id: string;
|
|
51
|
+
firstName?: string | undefined;
|
|
52
|
+
lastName?: string | undefined;
|
|
53
|
+
/** internal_note редагується тут окремо, бо це CRM-поле — не видиме клієнту. */
|
|
54
|
+
internalNote?: string | undefined;
|
|
55
|
+
}
|
|
56
|
+
export interface AdminUpdateCustomerResponse {
|
|
57
|
+
user: User | undefined;
|
|
47
58
|
}
|
|
48
59
|
export interface NotificationSettings {
|
|
49
60
|
orderStatuses: boolean;
|
|
@@ -280,6 +291,8 @@ export interface UsersServiceClient {
|
|
|
280
291
|
removeCartItem(request: RemoveCartItemRequest): Observable<GetCartResponse>;
|
|
281
292
|
clearCart(request: ClearCartRequest): Observable<ClearCartResponse>;
|
|
282
293
|
syncCart(request: SyncCartRequest): Observable<GetCartResponse>;
|
|
294
|
+
/** Admin CRM — редагування клієнта менеджером (customers.edit на gateway). */
|
|
295
|
+
adminUpdateCustomer(request: AdminUpdateCustomerRequest): Observable<AdminUpdateCustomerResponse>;
|
|
283
296
|
}
|
|
284
297
|
export interface UsersServiceController {
|
|
285
298
|
getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
|
@@ -312,6 +325,8 @@ export interface UsersServiceController {
|
|
|
312
325
|
removeCartItem(request: RemoveCartItemRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
313
326
|
clearCart(request: ClearCartRequest): Promise<ClearCartResponse> | Observable<ClearCartResponse> | ClearCartResponse;
|
|
314
327
|
syncCart(request: SyncCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
328
|
+
/** Admin CRM — редагування клієнта менеджером (customers.edit на gateway). */
|
|
329
|
+
adminUpdateCustomer(request: AdminUpdateCustomerRequest): Promise<AdminUpdateCustomerResponse> | Observable<AdminUpdateCustomerResponse> | AdminUpdateCustomerResponse;
|
|
315
330
|
}
|
|
316
331
|
export declare function UsersServiceControllerMethods(): (constructor: Function) => void;
|
|
317
332
|
export declare const USERS_SERVICE_NAME = "UsersService";
|
package/dist/gen/users.js
CHANGED