@mamindom/contracts 1.0.124 → 1.0.126
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/bonus_settings.d.ts +35 -0
- package/dist/gen/bonus_settings.js +28 -0
- package/dist/gen/delivery_settings.d.ts +33 -0
- package/dist/gen/delivery_settings.js +28 -0
- package/dist/gen/manager.d.ts +102 -0
- package/dist/gen/manager.js +39 -0
- package/dist/gen/notification.d.ts +279 -0
- package/dist/gen/notification.js +119 -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/bonus_settings.proto +35 -0
- package/dist/proto/delivery_settings.proto +35 -0
- package/dist/proto/manager.proto +88 -0
- package/dist/proto/notification.proto +317 -0
- package/dist/proto/product.proto +26 -9
- package/dist/proto/rbac.proto +109 -0
- package/dist/src/proto/paths.d.ts +6 -0
- package/dist/src/proto/paths.js +7 -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/bonus_settings.ts +71 -0
- package/gen/delivery_settings.ts +69 -0
- package/gen/manager.ts +192 -0
- package/gen/notification.ts +427 -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/bonus_settings.proto +35 -0
- package/proto/delivery_settings.proto +35 -0
- package/proto/manager.proto +88 -0
- package/proto/notification.proto +317 -0
- package/proto/product.proto +26 -9
- package/proto/rbac.proto +109 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package promo.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
service BonusSettingsService {
|
|
7
|
+
rpc GetBonusSettings (GetBonusSettingsRequest) returns (BonusSettingsResponse);
|
|
8
|
+
rpc UpdateBonusSettings (UpdateBonusSettingsRequest) returns (BonusSettingsResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
message BonusSettingsResponse {
|
|
13
|
+
// Курс нарахування бонусів від суми замовлення (0.02 = 2%).
|
|
14
|
+
double earn_rate = 1;
|
|
15
|
+
// Курс списання бонусів (1 бонус = N грн, default 1.0).
|
|
16
|
+
double redeem_rate = 2;
|
|
17
|
+
// Мінімальна сума замовлення для нарахування бонусів (0 = без обмеження).
|
|
18
|
+
double min_order_for_earn = 3;
|
|
19
|
+
// Максимальний відсоток від суми замовлення, який можна оплатити бонусами
|
|
20
|
+
// (1.0 = до 100%, 0.5 = до 50%; 0 — без обмеження).
|
|
21
|
+
double max_redeem_share = 4;
|
|
22
|
+
|
|
23
|
+
string updated_at = 5;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
message GetBonusSettingsRequest {}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
message UpdateBonusSettingsRequest {
|
|
31
|
+
optional double earn_rate = 1;
|
|
32
|
+
optional double redeem_rate = 2;
|
|
33
|
+
optional double min_order_for_earn = 3;
|
|
34
|
+
optional double max_redeem_share = 4;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package delivery.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
service DeliverySettingsService {
|
|
7
|
+
rpc GetDeliverySettings (GetDeliverySettingsRequest) returns (DeliverySettingsResponse);
|
|
8
|
+
rpc UpdateDeliverySettings (UpdateDeliverySettingsRequest) returns (DeliverySettingsResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
message DeliverySettingsResponse {
|
|
13
|
+
// Дефолтна вага позиції у кг — fallback коли catalog не повертає weight.
|
|
14
|
+
double default_item_weight_kg = 1;
|
|
15
|
+
// Поріг безкоштовної доставки в грн (0 = вимкнено).
|
|
16
|
+
double free_shipping_threshold = 2;
|
|
17
|
+
// Дефолтна оголошена вартість на одиницю товару у грн (для страхування НП).
|
|
18
|
+
double default_declared_value = 3;
|
|
19
|
+
// Reference відправника у НП (вибране warehouse адміністратором у settings).
|
|
20
|
+
optional string np_sender_warehouse_ref = 4;
|
|
21
|
+
|
|
22
|
+
string updated_at = 5;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
message GetDeliverySettingsRequest {}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
message UpdateDeliverySettingsRequest {
|
|
30
|
+
optional double default_item_weight_kg = 1;
|
|
31
|
+
optional double free_shipping_threshold = 2;
|
|
32
|
+
optional double default_declared_value = 3;
|
|
33
|
+
optional string np_sender_warehouse_ref = 4;
|
|
34
|
+
bool clear_np_sender_warehouse_ref = 5;
|
|
35
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package manager.v1;
|
|
4
|
+
|
|
5
|
+
service ManagerService {
|
|
6
|
+
rpc ListManagers(ListManagersRequest) returns (ListManagersResponse);
|
|
7
|
+
rpc GetManager(GetManagerRequest) returns (ManagerProfileDto);
|
|
8
|
+
rpc CreateManager(CreateManagerRequest) returns (ManagerProfileDto);
|
|
9
|
+
rpc UpdateManager(UpdateManagerRequest) returns (ManagerProfileDto);
|
|
10
|
+
rpc SetManagerActive(SetManagerActiveRequest) returns (ManagerProfileDto);
|
|
11
|
+
rpc TerminateManager(TerminateManagerRequest) returns (ManagerProfileDto);
|
|
12
|
+
rpc ReorderManagers(ReorderManagersRequest) returns (BoolResult);
|
|
13
|
+
rpc AddVacation(AddVacationRequest) returns (AddVacationResponse);
|
|
14
|
+
rpc DeleteVacation(DeleteVacationRequest) returns (BoolResult);
|
|
15
|
+
rpc ReassignUnassigned(ReassignUnassignedRequest) returns (ReassignUnassignedResponse);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message Vacation {
|
|
19
|
+
string id = 1;
|
|
20
|
+
string starts_at = 2;
|
|
21
|
+
string ends_at = 3;
|
|
22
|
+
string reason = 4;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message ManagerProfileDto {
|
|
26
|
+
string id = 1;
|
|
27
|
+
string account_id = 2;
|
|
28
|
+
string display_name = 3;
|
|
29
|
+
string email = 4;
|
|
30
|
+
bool is_active = 5;
|
|
31
|
+
int32 queue_order = 6;
|
|
32
|
+
int32 assigned_count = 7;
|
|
33
|
+
string terminated_at = 8;
|
|
34
|
+
string reassignment_strategy = 9;
|
|
35
|
+
repeated Vacation vacations = 10;
|
|
36
|
+
string created_at = 11;
|
|
37
|
+
string updated_at = 12;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message ListManagersRequest {}
|
|
41
|
+
message ListManagersResponse {
|
|
42
|
+
repeated ManagerProfileDto items = 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message GetManagerRequest { string id = 1; }
|
|
46
|
+
|
|
47
|
+
message CreateManagerRequest {
|
|
48
|
+
string account_id = 1;
|
|
49
|
+
optional string display_name = 2;
|
|
50
|
+
optional string email = 3;
|
|
51
|
+
optional string reassignment_strategy = 4; // URGENT_ONLY | ALL
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message UpdateManagerRequest {
|
|
55
|
+
string id = 1;
|
|
56
|
+
optional string display_name = 2;
|
|
57
|
+
optional string email = 3;
|
|
58
|
+
optional string reassignment_strategy = 4;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message SetManagerActiveRequest {
|
|
62
|
+
string id = 1;
|
|
63
|
+
bool is_active = 2;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message TerminateManagerRequest { string id = 1; }
|
|
67
|
+
|
|
68
|
+
message ReorderManagersRequest {
|
|
69
|
+
repeated string ordered_ids = 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message AddVacationRequest {
|
|
73
|
+
string manager_id = 1;
|
|
74
|
+
string starts_at = 2; // ISO date
|
|
75
|
+
string ends_at = 3;
|
|
76
|
+
optional string reason = 4;
|
|
77
|
+
}
|
|
78
|
+
message AddVacationResponse { string id = 1; }
|
|
79
|
+
|
|
80
|
+
message DeleteVacationRequest { string id = 1; }
|
|
81
|
+
|
|
82
|
+
message ReassignUnassignedRequest {}
|
|
83
|
+
message ReassignUnassignedResponse {
|
|
84
|
+
bool ok = 1;
|
|
85
|
+
int32 reassigned_count = 2;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
message BoolResult { bool ok = 1; }
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package notification.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// Admin API для керування шаблонами нотифікацій, Telegram-чатами,
|
|
7
|
+
// надсилання test-пакета, перегляду логів.
|
|
8
|
+
|
|
9
|
+
service NotificationTemplateService {
|
|
10
|
+
rpc ListTemplates (ListTemplatesRequest) returns (ListTemplatesResponse);
|
|
11
|
+
rpc GetTemplate (GetTemplateRequest) returns (TemplateResponse);
|
|
12
|
+
rpc UpsertTemplate (UpsertTemplateRequest) returns (TemplateResponse);
|
|
13
|
+
rpc UpdateTemplate (UpdateTemplateRequest) returns (TemplateResponse);
|
|
14
|
+
rpc ToggleTemplate (ToggleTemplateRequest) returns (TemplateResponse);
|
|
15
|
+
rpc ListVersions (ListVersionsRequest) returns (ListVersionsResponse);
|
|
16
|
+
rpc RestoreVersion (RestoreVersionRequest) returns (TemplateResponse);
|
|
17
|
+
rpc RenderPreview (RenderPreviewRequest) returns (RenderPreviewResponse);
|
|
18
|
+
rpc SendTest (SendTestRequest) returns (SendTestResponse);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
service NotificationLogsService {
|
|
22
|
+
rpc ListLogs (ListLogsRequest) returns (ListLogsResponse);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
service TelegramChatsService {
|
|
26
|
+
rpc ListChats (ListChatsRequest) returns (ListChatsResponse);
|
|
27
|
+
rpc UpsertChat (UpsertChatRequest) returns (TelegramChatResponse);
|
|
28
|
+
rpc DeleteChat (DeleteChatRequest) returns (DeleteChatResponse);
|
|
29
|
+
rpc TestSendTelegram (TestSendTelegramRequest) returns (TestSendTelegramResponse);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
enum NotificationChannel {
|
|
34
|
+
NOTIFICATION_CHANNEL_UNSPECIFIED = 0;
|
|
35
|
+
EMAIL = 1;
|
|
36
|
+
SMS = 2;
|
|
37
|
+
TELEGRAM = 3;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
enum NotificationLocale {
|
|
41
|
+
NOTIFICATION_LOCALE_UNSPECIFIED = 0;
|
|
42
|
+
UK = 1;
|
|
43
|
+
RU = 2;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
enum NotificationCategory {
|
|
47
|
+
NOTIFICATION_CATEGORY_UNSPECIFIED = 0;
|
|
48
|
+
TRANSACTIONAL = 1;
|
|
49
|
+
ACCOUNT = 2;
|
|
50
|
+
MARKETING = 3;
|
|
51
|
+
ADMIN = 4;
|
|
52
|
+
OTP = 5;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
enum NotificationStatus {
|
|
56
|
+
NOTIFICATION_STATUS_UNSPECIFIED = 0;
|
|
57
|
+
PENDING = 1;
|
|
58
|
+
SENT = 2;
|
|
59
|
+
FAILED = 3;
|
|
60
|
+
SIMULATED = 4;
|
|
61
|
+
SUPPRESSED = 5;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
enum TelegramTopic {
|
|
65
|
+
TELEGRAM_TOPIC_UNSPECIFIED = 0;
|
|
66
|
+
ORDERS = 1;
|
|
67
|
+
ORDERS_ALERTS = 2;
|
|
68
|
+
PAYMENTS = 3;
|
|
69
|
+
WAREHOUSE = 4;
|
|
70
|
+
REVIEWS = 5;
|
|
71
|
+
CALLBACK = 6;
|
|
72
|
+
REPORTS = 7;
|
|
73
|
+
ALERTS = 8;
|
|
74
|
+
GENERAL = 9;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
message NotificationTemplate {
|
|
79
|
+
string id = 1;
|
|
80
|
+
string key = 2;
|
|
81
|
+
NotificationChannel channel = 3;
|
|
82
|
+
NotificationLocale locale = 4;
|
|
83
|
+
NotificationCategory category = 5;
|
|
84
|
+
string title = 6;
|
|
85
|
+
string subject = 7;
|
|
86
|
+
// JSON-stringified Tiptap content (передаємо як string щоб не
|
|
87
|
+
// використовувати proto google.protobuf.Struct).
|
|
88
|
+
string content_json = 8;
|
|
89
|
+
string body_html = 9;
|
|
90
|
+
string body_text = 10;
|
|
91
|
+
// JSON array of variable names (для autocomplete).
|
|
92
|
+
string variables_json = 11;
|
|
93
|
+
bool is_active = 12;
|
|
94
|
+
int32 version = 13;
|
|
95
|
+
int64 created_at = 14;
|
|
96
|
+
int64 updated_at = 15;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message TemplateResponse {
|
|
100
|
+
bool ok = 1;
|
|
101
|
+
NotificationTemplate template = 2;
|
|
102
|
+
string error_message = 3;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
// ─── List ────────────────────────────────────────────────────────────
|
|
107
|
+
|
|
108
|
+
message ListTemplatesRequest {
|
|
109
|
+
optional NotificationChannel channel = 1;
|
|
110
|
+
optional NotificationLocale locale = 2;
|
|
111
|
+
optional NotificationCategory category = 3;
|
|
112
|
+
optional string search = 4;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message ListTemplatesResponse {
|
|
116
|
+
repeated NotificationTemplate items = 1;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
// ─── Get ─────────────────────────────────────────────────────────────
|
|
121
|
+
|
|
122
|
+
message GetTemplateRequest {
|
|
123
|
+
string id = 1;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
// ─── Upsert (create new) ─────────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
message UpsertTemplateRequest {
|
|
130
|
+
string key = 1;
|
|
131
|
+
NotificationChannel channel = 2;
|
|
132
|
+
NotificationLocale locale = 3;
|
|
133
|
+
NotificationCategory category = 4;
|
|
134
|
+
string title = 5;
|
|
135
|
+
string subject = 6;
|
|
136
|
+
string content_json = 7;
|
|
137
|
+
string body_html = 8;
|
|
138
|
+
string body_text = 9;
|
|
139
|
+
string variables_json = 10;
|
|
140
|
+
bool is_active = 11;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
// ─── Update by id (з versioning) ─────────────────────────────────────
|
|
145
|
+
|
|
146
|
+
message UpdateTemplateRequest {
|
|
147
|
+
string id = 1;
|
|
148
|
+
optional string title = 2;
|
|
149
|
+
optional string subject = 3;
|
|
150
|
+
optional string content_json = 4;
|
|
151
|
+
string body_html = 5;
|
|
152
|
+
string body_text = 6;
|
|
153
|
+
optional string variables_json = 7;
|
|
154
|
+
optional bool is_active = 8;
|
|
155
|
+
// Admin id для audit (хто змінив).
|
|
156
|
+
optional string actor_id = 9;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
// ─── Toggle (вмикання/вимикання) ────────────────────────────────────
|
|
161
|
+
|
|
162
|
+
message ToggleTemplateRequest {
|
|
163
|
+
string id = 1;
|
|
164
|
+
bool is_active = 2;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
// ─── Versions ────────────────────────────────────────────────────────
|
|
169
|
+
|
|
170
|
+
message NotificationTemplateVersion {
|
|
171
|
+
string id = 1;
|
|
172
|
+
int32 version = 2;
|
|
173
|
+
string title = 3;
|
|
174
|
+
string subject = 4;
|
|
175
|
+
string content_json = 5;
|
|
176
|
+
string body_html = 6;
|
|
177
|
+
string body_text = 7;
|
|
178
|
+
string variables_json = 8;
|
|
179
|
+
optional string created_by_id = 9;
|
|
180
|
+
int64 created_at = 10;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
message ListVersionsRequest {
|
|
184
|
+
string template_id = 1;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
message ListVersionsResponse {
|
|
188
|
+
repeated NotificationTemplateVersion items = 1;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
message RestoreVersionRequest {
|
|
192
|
+
string template_id = 1;
|
|
193
|
+
int32 version = 2;
|
|
194
|
+
optional string actor_id = 3;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
// ─── Preview ────────────────────────────────────────────────────────
|
|
199
|
+
|
|
200
|
+
message RenderPreviewRequest {
|
|
201
|
+
string body_html = 1;
|
|
202
|
+
// JSON-stringified variables { "order.number": "MD-2026-0001", ... }
|
|
203
|
+
string variables_json = 2;
|
|
204
|
+
optional string subject = 3;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
message RenderPreviewResponse {
|
|
208
|
+
string html = 1;
|
|
209
|
+
string subject = 2;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
// ─── Test send ───────────────────────────────────────────────────────
|
|
214
|
+
|
|
215
|
+
message SendTestRequest {
|
|
216
|
+
string template_id = 1;
|
|
217
|
+
// email або phone (залежно від channel).
|
|
218
|
+
string recipient = 2;
|
|
219
|
+
// JSON-stringified test variables.
|
|
220
|
+
string variables_json = 3;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
message SendTestResponse {
|
|
224
|
+
bool ok = 1;
|
|
225
|
+
string error_message = 2;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
// ─── Logs ────────────────────────────────────────────────────────────
|
|
230
|
+
|
|
231
|
+
message NotificationLog {
|
|
232
|
+
string id = 1;
|
|
233
|
+
string template_key = 2;
|
|
234
|
+
NotificationChannel channel = 3;
|
|
235
|
+
NotificationLocale locale = 4;
|
|
236
|
+
string recipient = 5;
|
|
237
|
+
optional string order_id = 6;
|
|
238
|
+
optional string user_id = 7;
|
|
239
|
+
NotificationStatus status = 8;
|
|
240
|
+
optional string provider_message_id = 9;
|
|
241
|
+
optional string provider_name = 10;
|
|
242
|
+
optional string error = 11;
|
|
243
|
+
optional int64 sent_at = 12;
|
|
244
|
+
int64 created_at = 13;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
message ListLogsRequest {
|
|
248
|
+
optional NotificationChannel channel = 1;
|
|
249
|
+
optional NotificationStatus status = 2;
|
|
250
|
+
optional string template_key = 3;
|
|
251
|
+
optional string order_id = 4;
|
|
252
|
+
optional string user_id = 5;
|
|
253
|
+
optional string recipient = 6;
|
|
254
|
+
optional int64 date_from = 7;
|
|
255
|
+
optional int64 date_to = 8;
|
|
256
|
+
int32 page = 9;
|
|
257
|
+
int32 limit = 10;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
message ListLogsResponse {
|
|
261
|
+
repeated NotificationLog items = 1;
|
|
262
|
+
int32 total = 2;
|
|
263
|
+
int32 page = 3;
|
|
264
|
+
int32 limit = 4;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
// ─── Telegram chats ──────────────────────────────────────────────────
|
|
269
|
+
|
|
270
|
+
message TelegramChat {
|
|
271
|
+
string id = 1;
|
|
272
|
+
string chat_id = 2;
|
|
273
|
+
TelegramTopic topic = 3;
|
|
274
|
+
string label = 4;
|
|
275
|
+
optional string tag = 5;
|
|
276
|
+
bool is_active = 6;
|
|
277
|
+
int64 created_at = 7;
|
|
278
|
+
int64 updated_at = 8;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
message TelegramChatResponse {
|
|
282
|
+
bool ok = 1;
|
|
283
|
+
TelegramChat chat = 2;
|
|
284
|
+
string error_message = 3;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
message ListChatsRequest {}
|
|
288
|
+
|
|
289
|
+
message ListChatsResponse {
|
|
290
|
+
repeated TelegramChat items = 1;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
message UpsertChatRequest {
|
|
294
|
+
string chat_id = 1;
|
|
295
|
+
TelegramTopic topic = 2;
|
|
296
|
+
string label = 3;
|
|
297
|
+
optional string tag = 4;
|
|
298
|
+
bool is_active = 5;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
message DeleteChatRequest {
|
|
302
|
+
string id = 1;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
message DeleteChatResponse {
|
|
306
|
+
bool ok = 1;
|
|
307
|
+
string error_message = 2;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
message TestSendTelegramRequest {
|
|
311
|
+
string chat_id = 1;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
message TestSendTelegramResponse {
|
|
315
|
+
bool ok = 1;
|
|
316
|
+
string error_message = 2;
|
|
317
|
+
}
|
package/dist/proto/product.proto
CHANGED
|
@@ -144,20 +144,20 @@ message ProductListItemResponse {
|
|
|
144
144
|
string id = 1;
|
|
145
145
|
string sku = 2;
|
|
146
146
|
string slug = 3;
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
ProductStatus status = 4;
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
map<string, string> name = 5;
|
|
151
151
|
string main_image = 6;
|
|
152
|
-
|
|
152
|
+
|
|
153
153
|
double price = 7;
|
|
154
154
|
optional double old_price = 8;
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
int32 total_stock = 9;
|
|
157
|
-
|
|
157
|
+
|
|
158
158
|
optional string brand_id = 10;
|
|
159
159
|
repeated string category_ids = 11;
|
|
160
|
-
|
|
160
|
+
|
|
161
161
|
int32 sort_order = 12;
|
|
162
162
|
int32 category_sort_order = 13;
|
|
163
163
|
optional string barcode = 14;
|
|
@@ -170,6 +170,8 @@ message ProductListItemResponse {
|
|
|
170
170
|
int32 review_count = 21;
|
|
171
171
|
repeated ProductStickerResponse stickers = 22;
|
|
172
172
|
optional ProductPromoInfo active_promo = 23;
|
|
173
|
+
// Вага у кг для розрахунку доставки (0 → fallback на defaultItemWeightKg).
|
|
174
|
+
double weight_kg = 24;
|
|
173
175
|
}
|
|
174
176
|
|
|
175
177
|
|
|
@@ -219,6 +221,8 @@ message ProductDetailResponse {
|
|
|
219
221
|
optional float manual_rating = 37;
|
|
220
222
|
optional ProductPromoInfo active_promo = 38;
|
|
221
223
|
repeated ProductColorResponse colors = 39;
|
|
224
|
+
// Вага товару у кг для розрахунку доставки (variant може override'ити).
|
|
225
|
+
double weight_kg = 40;
|
|
222
226
|
}
|
|
223
227
|
|
|
224
228
|
|
|
@@ -362,6 +366,7 @@ message CreateProductRequest {
|
|
|
362
366
|
optional string group_id = 24;
|
|
363
367
|
map<string, string> color_label = 25;
|
|
364
368
|
optional string color_hex = 26;
|
|
369
|
+
optional double weight_kg = 27;
|
|
365
370
|
}
|
|
366
371
|
|
|
367
372
|
message UpdateProductRequest {
|
|
@@ -396,6 +401,7 @@ message UpdateProductRequest {
|
|
|
396
401
|
map<string, string> color_label = 23;
|
|
397
402
|
optional string color_hex = 24;
|
|
398
403
|
optional float manual_rating = 25;
|
|
404
|
+
optional double weight_kg = 26;
|
|
399
405
|
}
|
|
400
406
|
|
|
401
407
|
message SetManualRatingRequest {
|
|
@@ -597,12 +603,12 @@ message ProductVariantDetailResponse {
|
|
|
597
603
|
optional string barcode = 4;
|
|
598
604
|
int32 sort_order = 5;
|
|
599
605
|
|
|
600
|
-
|
|
606
|
+
|
|
601
607
|
double price = 6;
|
|
602
608
|
optional double old_price = 7;
|
|
603
609
|
int32 stock = 8;
|
|
604
610
|
|
|
605
|
-
|
|
611
|
+
|
|
606
612
|
map<string, string> options = 9;
|
|
607
613
|
|
|
608
614
|
|
|
@@ -623,6 +629,9 @@ message ProductVariantDetailResponse {
|
|
|
623
629
|
VariantOverrides overrides = 20;
|
|
624
630
|
|
|
625
631
|
optional string color_id = 21;
|
|
632
|
+
|
|
633
|
+
// Override-вага варіанту у кг; 0 означає "успадкувати від продукту".
|
|
634
|
+
double weight_kg = 22;
|
|
626
635
|
}
|
|
627
636
|
|
|
628
637
|
message VariantOverrides {
|
|
@@ -637,6 +646,7 @@ message VariantOverrides {
|
|
|
637
646
|
bool has_own_attributes = 9;
|
|
638
647
|
bool has_own_video = 10;
|
|
639
648
|
bool has_own_old_price = 11;
|
|
649
|
+
bool has_own_weight = 12;
|
|
640
650
|
}
|
|
641
651
|
|
|
642
652
|
|
|
@@ -650,7 +660,7 @@ message CreateProductVariantRequest {
|
|
|
650
660
|
optional double old_price = 6;
|
|
651
661
|
int32 stock = 7;
|
|
652
662
|
|
|
653
|
-
map<string, string> options = 8;
|
|
663
|
+
map<string, string> options = 8;
|
|
654
664
|
map<string, string> name = 9;
|
|
655
665
|
map<string, string> short_description = 10;
|
|
656
666
|
map<string, string> description = 11;
|
|
@@ -663,6 +673,8 @@ message CreateProductVariantRequest {
|
|
|
663
673
|
repeated ProductImagePayload images = 17;
|
|
664
674
|
repeated string attribute_value_ids = 18;
|
|
665
675
|
optional string color_id = 19;
|
|
676
|
+
// Override-вага варіанту у кг (null/unset → успадкувати від продукту).
|
|
677
|
+
optional double weight_kg = 20;
|
|
666
678
|
}
|
|
667
679
|
|
|
668
680
|
|
|
@@ -690,6 +702,8 @@ message UpdateProductVariantRequest {
|
|
|
690
702
|
repeated ProductImagePayload images = 17;
|
|
691
703
|
repeated string attribute_value_ids = 18;
|
|
692
704
|
optional string color_id = 19;
|
|
705
|
+
// Override-вага варіанту у кг (null/unset → успадкувати від продукту).
|
|
706
|
+
optional double weight_kg = 20;
|
|
693
707
|
|
|
694
708
|
|
|
695
709
|
bool clear_price = 30;
|
|
@@ -704,6 +718,7 @@ message UpdateProductVariantRequest {
|
|
|
704
718
|
bool clear_attributes = 39;
|
|
705
719
|
bool clear_video = 40;
|
|
706
720
|
bool clear_color = 41;
|
|
721
|
+
bool clear_weight = 42;
|
|
707
722
|
}
|
|
708
723
|
|
|
709
724
|
message GetProductVariantRequest {
|
|
@@ -773,6 +788,8 @@ message VariantLookupResult {
|
|
|
773
788
|
string name_uk = 9;
|
|
774
789
|
string main_image = 10;
|
|
775
790
|
optional string color_id = 11;
|
|
791
|
+
// Вага у кг (variant.weight_kg ?? product.weight_kg ?? 0).
|
|
792
|
+
double weight_kg = 12;
|
|
776
793
|
}
|
|
777
794
|
|
|
778
795
|
message BulkLookupVariantsRequest {
|