@mamindom/contracts 1.0.127 → 1.0.130
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/gen/notification.d.ts +52 -0
- package/dist/gen/notification.js +17 -1
- package/dist/proto/notification.proto +42 -0
- package/events/orders/order-cancelled.interface.ts +0 -1
- package/events/orders/order-status-changed.interface.ts +0 -3
- package/events/stock/stock-confirm-requested.interface.ts +0 -2
- package/events/stock/stock-release-requested.interface.ts +0 -2
- package/events/stock/stock-reserve-failed.interface.ts +0 -2
- package/events/stock/stock-reserve-requested.interface.ts +0 -6
- package/events/stock/stock-reserved.interface.ts +0 -2
- package/gen/notification.ts +81 -1
- package/package.json +1 -1
- package/proto/notification.proto +42 -0
|
@@ -44,6 +44,41 @@ export declare enum TelegramTopic {
|
|
|
44
44
|
GENERAL = 9,
|
|
45
45
|
UNRECOGNIZED = -1
|
|
46
46
|
}
|
|
47
|
+
export interface BrandingEmpty {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Поля що поверталися з resolved-merge (DB ∪ env). Порожні рядки означають
|
|
51
|
+
* "взяти fallback з env" при наступному GET.
|
|
52
|
+
*/
|
|
53
|
+
export interface BrandingProfile {
|
|
54
|
+
logoUrl: string;
|
|
55
|
+
brandName: string;
|
|
56
|
+
brandUrl: string;
|
|
57
|
+
supportEmail: string;
|
|
58
|
+
footerHtml: string;
|
|
59
|
+
updatedAt: number;
|
|
60
|
+
updatedBy: string;
|
|
61
|
+
/**
|
|
62
|
+
* resolved: остаточні значення, що використовуються wrapper'ом
|
|
63
|
+
* (DB override → env fallback). Для UI щоб показати "поточне значення".
|
|
64
|
+
*/
|
|
65
|
+
resolvedLogoUrl: string;
|
|
66
|
+
resolvedBrandName: string;
|
|
67
|
+
resolvedBrandUrl: string;
|
|
68
|
+
resolvedSupportEmail: string;
|
|
69
|
+
/** Кастомний HTML-хедер (замість дефолтного логотип-блоку). Порожньо → default. */
|
|
70
|
+
headerHtml: string;
|
|
71
|
+
}
|
|
72
|
+
export interface UpdateBrandingRequest {
|
|
73
|
+
/** optional: відсутність → не оновлювати; порожній рядок → скинути до NULL у БД. */
|
|
74
|
+
logoUrl?: string | undefined;
|
|
75
|
+
brandName?: string | undefined;
|
|
76
|
+
brandUrl?: string | undefined;
|
|
77
|
+
supportEmail?: string | undefined;
|
|
78
|
+
footerHtml?: string | undefined;
|
|
79
|
+
actorId: string;
|
|
80
|
+
headerHtml?: string | undefined;
|
|
81
|
+
}
|
|
47
82
|
export interface NotificationTemplate {
|
|
48
83
|
id: string;
|
|
49
84
|
key: string;
|
|
@@ -140,6 +175,11 @@ export interface RenderPreviewRequest {
|
|
|
140
175
|
/** JSON-stringified variables { "order.number": "MD-2026-0001", ... } */
|
|
141
176
|
variablesJson: string;
|
|
142
177
|
subject?: string | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* JSON-stringified branding override (header/footer/logo/brand…) для live-
|
|
180
|
+
* превʼю незбережених змін на сторінці брендингу. Порожньо → беремо з БД.
|
|
181
|
+
*/
|
|
182
|
+
brandingJson?: string | undefined;
|
|
143
183
|
}
|
|
144
184
|
export interface RenderPreviewResponse {
|
|
145
185
|
html: string;
|
|
@@ -277,3 +317,15 @@ export interface TelegramChatsServiceController {
|
|
|
277
317
|
}
|
|
278
318
|
export declare function TelegramChatsServiceControllerMethods(): (constructor: Function) => void;
|
|
279
319
|
export declare const TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
|
320
|
+
/** Брендинг email-шаблонів — singleton редагується адміном. */
|
|
321
|
+
export interface BrandingServiceClient {
|
|
322
|
+
getBranding(request: BrandingEmpty): Observable<BrandingProfile>;
|
|
323
|
+
updateBranding(request: UpdateBrandingRequest): Observable<BrandingProfile>;
|
|
324
|
+
}
|
|
325
|
+
/** Брендинг email-шаблонів — singleton редагується адміном. */
|
|
326
|
+
export interface BrandingServiceController {
|
|
327
|
+
getBranding(request: BrandingEmpty): Promise<BrandingProfile> | Observable<BrandingProfile> | BrandingProfile;
|
|
328
|
+
updateBranding(request: UpdateBrandingRequest): Promise<BrandingProfile> | Observable<BrandingProfile> | BrandingProfile;
|
|
329
|
+
}
|
|
330
|
+
export declare function BrandingServiceControllerMethods(): (constructor: Function) => void;
|
|
331
|
+
export declare const BRANDING_SERVICE_NAME = "BrandingService";
|
package/dist/gen/notification.js
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
// protoc v3.21.12
|
|
6
6
|
// source: notification.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
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.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;
|
|
9
9
|
exports.NotificationTemplateServiceControllerMethods = NotificationTemplateServiceControllerMethods;
|
|
10
10
|
exports.NotificationLogsServiceControllerMethods = NotificationLogsServiceControllerMethods;
|
|
11
11
|
exports.TelegramChatsServiceControllerMethods = TelegramChatsServiceControllerMethods;
|
|
12
|
+
exports.BrandingServiceControllerMethods = BrandingServiceControllerMethods;
|
|
12
13
|
/* eslint-disable */
|
|
13
14
|
const microservices_1 = require("@nestjs/microservices");
|
|
14
15
|
exports.protobufPackage = "notification.v1";
|
|
@@ -117,3 +118,18 @@ function TelegramChatsServiceControllerMethods() {
|
|
|
117
118
|
};
|
|
118
119
|
}
|
|
119
120
|
exports.TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
|
121
|
+
function BrandingServiceControllerMethods() {
|
|
122
|
+
return function (constructor) {
|
|
123
|
+
const grpcMethods = ["getBranding", "updateBranding"];
|
|
124
|
+
for (const method of grpcMethods) {
|
|
125
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
126
|
+
(0, microservices_1.GrpcMethod)("BrandingService", method)(constructor.prototype[method], method, descriptor);
|
|
127
|
+
}
|
|
128
|
+
const grpcStreamMethods = [];
|
|
129
|
+
for (const method of grpcStreamMethods) {
|
|
130
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
131
|
+
(0, microservices_1.GrpcStreamMethod)("BrandingService", method)(constructor.prototype[method], method, descriptor);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
exports.BRANDING_SERVICE_NAME = "BrandingService";
|
|
@@ -29,6 +29,45 @@ service TelegramChatsService {
|
|
|
29
29
|
rpc TestSendTelegram (TestSendTelegramRequest) returns (TestSendTelegramResponse);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// Брендинг email-шаблонів — singleton редагується адміном.
|
|
33
|
+
service BrandingService {
|
|
34
|
+
rpc GetBranding (BrandingEmpty) returns (BrandingProfile);
|
|
35
|
+
rpc UpdateBranding (UpdateBrandingRequest) returns (BrandingProfile);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message BrandingEmpty {}
|
|
39
|
+
|
|
40
|
+
// Поля що поверталися з resolved-merge (DB ∪ env). Порожні рядки означають
|
|
41
|
+
// "взяти fallback з env" при наступному GET.
|
|
42
|
+
message BrandingProfile {
|
|
43
|
+
string logo_url = 1;
|
|
44
|
+
string brand_name = 2;
|
|
45
|
+
string brand_url = 3;
|
|
46
|
+
string support_email = 4;
|
|
47
|
+
string footer_html = 5;
|
|
48
|
+
int64 updated_at = 6;
|
|
49
|
+
string updated_by = 7;
|
|
50
|
+
// resolved: остаточні значення, що використовуються wrapper'ом
|
|
51
|
+
// (DB override → env fallback). Для UI щоб показати "поточне значення".
|
|
52
|
+
string resolved_logo_url = 8;
|
|
53
|
+
string resolved_brand_name = 9;
|
|
54
|
+
string resolved_brand_url = 10;
|
|
55
|
+
string resolved_support_email = 11;
|
|
56
|
+
// Кастомний HTML-хедер (замість дефолтного логотип-блоку). Порожньо → default.
|
|
57
|
+
string header_html = 12;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message UpdateBrandingRequest {
|
|
61
|
+
// optional: відсутність → не оновлювати; порожній рядок → скинути до NULL у БД.
|
|
62
|
+
optional string logo_url = 1;
|
|
63
|
+
optional string brand_name = 2;
|
|
64
|
+
optional string brand_url = 3;
|
|
65
|
+
optional string support_email = 4;
|
|
66
|
+
optional string footer_html = 5;
|
|
67
|
+
string actor_id = 6;
|
|
68
|
+
optional string header_html = 7;
|
|
69
|
+
}
|
|
70
|
+
|
|
32
71
|
|
|
33
72
|
enum NotificationChannel {
|
|
34
73
|
NOTIFICATION_CHANNEL_UNSPECIFIED = 0;
|
|
@@ -202,6 +241,9 @@ message RenderPreviewRequest {
|
|
|
202
241
|
// JSON-stringified variables { "order.number": "MD-2026-0001", ... }
|
|
203
242
|
string variables_json = 2;
|
|
204
243
|
optional string subject = 3;
|
|
244
|
+
// JSON-stringified branding override (header/footer/logo/brand…) для live-
|
|
245
|
+
// превʼю незбережених змін на сторінці брендингу. Порожньо → беремо з БД.
|
|
246
|
+
optional string branding_json = 4;
|
|
205
247
|
}
|
|
206
248
|
|
|
207
249
|
message RenderPreviewResponse {
|
|
@@ -8,8 +8,6 @@ export interface OrderStatusChangedEvent {
|
|
|
8
8
|
actorName?: string
|
|
9
9
|
changedAt: number
|
|
10
10
|
|
|
11
|
-
// Опціональний customer-snapshot для нотифікацій (щоб
|
|
12
|
-
// notification-service не робив додатковий lookup в order-service).
|
|
13
11
|
userId?: string
|
|
14
12
|
customer?: {
|
|
15
13
|
firstName: string
|
|
@@ -18,7 +16,6 @@ export interface OrderStatusChangedEvent {
|
|
|
18
16
|
phone: string
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
// На переходах у shipped — ТТН + tracking URL.
|
|
22
19
|
trackingNumber?: string
|
|
23
20
|
trackingUrl?: string
|
|
24
21
|
}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// Подія від order-service: catalog має зарезервувати stock для замовлення.
|
|
2
|
-
// Catalog сам обирає warehouse(и) (auto-pick first-available, greedy
|
|
3
|
-
// fill через product_warehouses ORDER BY created_at).
|
|
4
|
-
//
|
|
5
|
-
// TTL у мс — після його закінчення UnpaidOrdersCron у order-service
|
|
6
|
-
// автоматично скасує замовлення → catalog отримає stock.release_requested.
|
|
7
1
|
export interface StockReserveRequestedEvent {
|
|
8
2
|
orderId: string
|
|
9
3
|
orderNumber: string
|
package/gen/notification.ts
CHANGED
|
@@ -59,6 +59,44 @@ export enum TelegramTopic {
|
|
|
59
59
|
UNRECOGNIZED = -1,
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
export interface BrandingEmpty {
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Поля що поверталися з resolved-merge (DB ∪ env). Порожні рядки означають
|
|
67
|
+
* "взяти fallback з env" при наступному GET.
|
|
68
|
+
*/
|
|
69
|
+
export interface BrandingProfile {
|
|
70
|
+
logoUrl: string;
|
|
71
|
+
brandName: string;
|
|
72
|
+
brandUrl: string;
|
|
73
|
+
supportEmail: string;
|
|
74
|
+
footerHtml: string;
|
|
75
|
+
updatedAt: number;
|
|
76
|
+
updatedBy: string;
|
|
77
|
+
/**
|
|
78
|
+
* resolved: остаточні значення, що використовуються wrapper'ом
|
|
79
|
+
* (DB override → env fallback). Для UI щоб показати "поточне значення".
|
|
80
|
+
*/
|
|
81
|
+
resolvedLogoUrl: string;
|
|
82
|
+
resolvedBrandName: string;
|
|
83
|
+
resolvedBrandUrl: string;
|
|
84
|
+
resolvedSupportEmail: string;
|
|
85
|
+
/** Кастомний HTML-хедер (замість дефолтного логотип-блоку). Порожньо → default. */
|
|
86
|
+
headerHtml: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface UpdateBrandingRequest {
|
|
90
|
+
/** optional: відсутність → не оновлювати; порожній рядок → скинути до NULL у БД. */
|
|
91
|
+
logoUrl?: string | undefined;
|
|
92
|
+
brandName?: string | undefined;
|
|
93
|
+
brandUrl?: string | undefined;
|
|
94
|
+
supportEmail?: string | undefined;
|
|
95
|
+
footerHtml?: string | undefined;
|
|
96
|
+
actorId: string;
|
|
97
|
+
headerHtml?: string | undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
62
100
|
export interface NotificationTemplate {
|
|
63
101
|
id: string;
|
|
64
102
|
key: string;
|
|
@@ -168,7 +206,14 @@ export interface RenderPreviewRequest {
|
|
|
168
206
|
bodyHtml: string;
|
|
169
207
|
/** JSON-stringified variables { "order.number": "MD-2026-0001", ... } */
|
|
170
208
|
variablesJson: string;
|
|
171
|
-
subject?:
|
|
209
|
+
subject?:
|
|
210
|
+
| string
|
|
211
|
+
| undefined;
|
|
212
|
+
/**
|
|
213
|
+
* JSON-stringified branding override (header/footer/logo/brand…) для live-
|
|
214
|
+
* превʼю незбережених змін на сторінці брендингу. Порожньо → беремо з БД.
|
|
215
|
+
*/
|
|
216
|
+
brandingJson?: string | undefined;
|
|
172
217
|
}
|
|
173
218
|
|
|
174
219
|
export interface RenderPreviewResponse {
|
|
@@ -425,3 +470,38 @@ export function TelegramChatsServiceControllerMethods() {
|
|
|
425
470
|
}
|
|
426
471
|
|
|
427
472
|
export const TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
|
473
|
+
|
|
474
|
+
/** Брендинг email-шаблонів — singleton редагується адміном. */
|
|
475
|
+
|
|
476
|
+
export interface BrandingServiceClient {
|
|
477
|
+
getBranding(request: BrandingEmpty): Observable<BrandingProfile>;
|
|
478
|
+
|
|
479
|
+
updateBranding(request: UpdateBrandingRequest): Observable<BrandingProfile>;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/** Брендинг email-шаблонів — singleton редагується адміном. */
|
|
483
|
+
|
|
484
|
+
export interface BrandingServiceController {
|
|
485
|
+
getBranding(request: BrandingEmpty): Promise<BrandingProfile> | Observable<BrandingProfile> | BrandingProfile;
|
|
486
|
+
|
|
487
|
+
updateBranding(
|
|
488
|
+
request: UpdateBrandingRequest,
|
|
489
|
+
): Promise<BrandingProfile> | Observable<BrandingProfile> | BrandingProfile;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export function BrandingServiceControllerMethods() {
|
|
493
|
+
return function (constructor: Function) {
|
|
494
|
+
const grpcMethods: string[] = ["getBranding", "updateBranding"];
|
|
495
|
+
for (const method of grpcMethods) {
|
|
496
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
497
|
+
GrpcMethod("BrandingService", method)(constructor.prototype[method], method, descriptor);
|
|
498
|
+
}
|
|
499
|
+
const grpcStreamMethods: string[] = [];
|
|
500
|
+
for (const method of grpcStreamMethods) {
|
|
501
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
502
|
+
GrpcStreamMethod("BrandingService", method)(constructor.prototype[method], method, descriptor);
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
export const BRANDING_SERVICE_NAME = "BrandingService";
|
package/package.json
CHANGED
package/proto/notification.proto
CHANGED
|
@@ -29,6 +29,45 @@ service TelegramChatsService {
|
|
|
29
29
|
rpc TestSendTelegram (TestSendTelegramRequest) returns (TestSendTelegramResponse);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// Брендинг email-шаблонів — singleton редагується адміном.
|
|
33
|
+
service BrandingService {
|
|
34
|
+
rpc GetBranding (BrandingEmpty) returns (BrandingProfile);
|
|
35
|
+
rpc UpdateBranding (UpdateBrandingRequest) returns (BrandingProfile);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message BrandingEmpty {}
|
|
39
|
+
|
|
40
|
+
// Поля що поверталися з resolved-merge (DB ∪ env). Порожні рядки означають
|
|
41
|
+
// "взяти fallback з env" при наступному GET.
|
|
42
|
+
message BrandingProfile {
|
|
43
|
+
string logo_url = 1;
|
|
44
|
+
string brand_name = 2;
|
|
45
|
+
string brand_url = 3;
|
|
46
|
+
string support_email = 4;
|
|
47
|
+
string footer_html = 5;
|
|
48
|
+
int64 updated_at = 6;
|
|
49
|
+
string updated_by = 7;
|
|
50
|
+
// resolved: остаточні значення, що використовуються wrapper'ом
|
|
51
|
+
// (DB override → env fallback). Для UI щоб показати "поточне значення".
|
|
52
|
+
string resolved_logo_url = 8;
|
|
53
|
+
string resolved_brand_name = 9;
|
|
54
|
+
string resolved_brand_url = 10;
|
|
55
|
+
string resolved_support_email = 11;
|
|
56
|
+
// Кастомний HTML-хедер (замість дефолтного логотип-блоку). Порожньо → default.
|
|
57
|
+
string header_html = 12;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message UpdateBrandingRequest {
|
|
61
|
+
// optional: відсутність → не оновлювати; порожній рядок → скинути до NULL у БД.
|
|
62
|
+
optional string logo_url = 1;
|
|
63
|
+
optional string brand_name = 2;
|
|
64
|
+
optional string brand_url = 3;
|
|
65
|
+
optional string support_email = 4;
|
|
66
|
+
optional string footer_html = 5;
|
|
67
|
+
string actor_id = 6;
|
|
68
|
+
optional string header_html = 7;
|
|
69
|
+
}
|
|
70
|
+
|
|
32
71
|
|
|
33
72
|
enum NotificationChannel {
|
|
34
73
|
NOTIFICATION_CHANNEL_UNSPECIFIED = 0;
|
|
@@ -202,6 +241,9 @@ message RenderPreviewRequest {
|
|
|
202
241
|
// JSON-stringified variables { "order.number": "MD-2026-0001", ... }
|
|
203
242
|
string variables_json = 2;
|
|
204
243
|
optional string subject = 3;
|
|
244
|
+
// JSON-stringified branding override (header/footer/logo/brand…) для live-
|
|
245
|
+
// превʼю незбережених змін на сторінці брендингу. Порожньо → беремо з БД.
|
|
246
|
+
optional string branding_json = 4;
|
|
205
247
|
}
|
|
206
248
|
|
|
207
249
|
message RenderPreviewResponse {
|