@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
package/proto/payment.proto
CHANGED
|
@@ -20,6 +20,11 @@ service PaymentService {
|
|
|
20
20
|
// SyncStatus — підтягує актуальний статус від провайдера (manual reconciliation).
|
|
21
21
|
rpc SyncStatus(SyncStatusRequest) returns (PaymentResponse);
|
|
22
22
|
|
|
23
|
+
// RegenerateInvoice — створює новий invoice у провайдера для існуючого Payment.
|
|
24
|
+
// Використовується коли paymentUrl застарів (TTL у Mono ≈ 24г) або клієнт
|
|
25
|
+
// загубив SMS — менеджер ділиться новим лінком через адмін UI.
|
|
26
|
+
rpc RegenerateInvoice(RegenerateInvoiceRequest) returns (PaymentResponse);
|
|
27
|
+
|
|
23
28
|
rpc ListProviders(ListProvidersRequest) returns (ListProvidersResponse);
|
|
24
29
|
rpc ToggleProvider(ToggleProviderRequest) returns (ToggleProviderResponse);
|
|
25
30
|
}
|
|
@@ -127,6 +132,11 @@ message SyncStatusRequest {
|
|
|
127
132
|
string id = 1;
|
|
128
133
|
}
|
|
129
134
|
|
|
135
|
+
message RegenerateInvoiceRequest {
|
|
136
|
+
string id = 1;
|
|
137
|
+
string actor_id = 2;
|
|
138
|
+
}
|
|
139
|
+
|
|
130
140
|
message ListProvidersRequest {
|
|
131
141
|
bool only_enabled = 1;
|
|
132
142
|
}
|
package/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 {
|
package/proto/rbac.proto
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package rbac.v1;
|
|
4
|
+
|
|
5
|
+
service RbacService {
|
|
6
|
+
// Permissions catalog (read-only, seeded).
|
|
7
|
+
rpc ListPermissions(ListPermissionsRequest) returns (ListPermissionsResponse);
|
|
8
|
+
|
|
9
|
+
// Roles CRUD.
|
|
10
|
+
rpc ListRoles(ListRolesRequest) returns (ListRolesResponse);
|
|
11
|
+
rpc GetRole(GetRoleRequest) returns (RbacRole);
|
|
12
|
+
rpc CreateRole(CreateRoleRequest) returns (RbacRole);
|
|
13
|
+
rpc UpdateRole(UpdateRoleRequest) returns (RbacRole);
|
|
14
|
+
rpc DeleteRole(DeleteRoleRequest) returns (DeleteRoleResponse);
|
|
15
|
+
|
|
16
|
+
// Account ↔ role bindings.
|
|
17
|
+
rpc AssignAccountRole(AssignAccountRoleRequest) returns (AssignAccountRoleResponse);
|
|
18
|
+
rpc GetAccountPermissions(GetAccountPermissionsRequest) returns (GetAccountPermissionsResponse);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message RbacPermission {
|
|
22
|
+
string id = 1;
|
|
23
|
+
string key = 2;
|
|
24
|
+
string group_key = 3;
|
|
25
|
+
string label = 4;
|
|
26
|
+
string description = 5;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message RbacRole {
|
|
30
|
+
string id = 1;
|
|
31
|
+
string slug = 2;
|
|
32
|
+
string name = 3;
|
|
33
|
+
string description = 4;
|
|
34
|
+
string color = 5;
|
|
35
|
+
bool is_system = 6;
|
|
36
|
+
bool is_protected = 7;
|
|
37
|
+
int32 users_count = 8;
|
|
38
|
+
repeated string permission_keys = 9;
|
|
39
|
+
string created_at = 10;
|
|
40
|
+
string updated_at = 11;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message ListPermissionsRequest {}
|
|
44
|
+
|
|
45
|
+
message ListPermissionsResponse {
|
|
46
|
+
repeated RbacPermission items = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message ListRolesRequest {
|
|
50
|
+
optional string search = 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message ListRolesResponse {
|
|
54
|
+
repeated RbacRole items = 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message GetRoleRequest {
|
|
58
|
+
string id = 1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message CreateRoleRequest {
|
|
62
|
+
string slug = 1;
|
|
63
|
+
string name = 2;
|
|
64
|
+
string description = 3;
|
|
65
|
+
string color = 4;
|
|
66
|
+
repeated string permission_keys = 5;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message UpdateRoleRequest {
|
|
70
|
+
string id = 1;
|
|
71
|
+
optional string name = 2;
|
|
72
|
+
optional string description = 3;
|
|
73
|
+
optional string color = 4;
|
|
74
|
+
// Якщо передано — повна заміна; якщо не передано — без змін.
|
|
75
|
+
repeated string permission_keys = 5;
|
|
76
|
+
bool replace_permissions = 6;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message DeleteRoleRequest {
|
|
80
|
+
string id = 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
message DeleteRoleResponse {
|
|
84
|
+
bool ok = 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message AssignAccountRoleRequest {
|
|
88
|
+
string account_id = 1;
|
|
89
|
+
// Якщо custom_role_id порожній — користувач відвʼязується від кастомної ролі,
|
|
90
|
+
// і дозволи беруться з системної.
|
|
91
|
+
optional string custom_role_id = 2;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message AssignAccountRoleResponse {
|
|
95
|
+
bool ok = 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
message GetAccountPermissionsRequest {
|
|
99
|
+
string account_id = 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message GetAccountPermissionsResponse {
|
|
103
|
+
// Effective permissions з урахуванням system role + custom role override.
|
|
104
|
+
// Може містити "*" — повний доступ (ADMIN).
|
|
105
|
+
repeated string permission_keys = 1;
|
|
106
|
+
// Слаг ефективної ролі (для UI/labels).
|
|
107
|
+
string role_slug = 2;
|
|
108
|
+
string role_name = 3;
|
|
109
|
+
}
|