@mamindom/contracts 1.0.14 → 1.0.16
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/proto/paths.d.ts +5 -1
- package/dist/proto/paths.js +5 -1
- package/gen/attribute.ts +312 -0
- package/gen/brand.ts +149 -0
- package/gen/catalog.ts +345 -0
- package/gen/categorie.ts +1 -1
- package/gen/category.ts +246 -0
- package/gen/common.ts +31 -0
- package/gen/product.ts +363 -0
- package/package.json +1 -1
- package/proto/attribute.proto +156 -0
- package/proto/brand.proto +74 -0
- package/proto/category.proto +112 -0
- package/proto/common.proto +24 -0
- package/proto/product.proto +213 -0
- package/proto/categorie.proto +0 -7
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package catalog.v1;
|
|
4
|
+
|
|
5
|
+
message SuccessResponse {
|
|
6
|
+
bool success = 1;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
message DeleteResponse {
|
|
10
|
+
bool success = 1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
message PaginationRequest {
|
|
15
|
+
int32 page = 1;
|
|
16
|
+
int32 limit = 2;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message PaginationMeta {
|
|
20
|
+
int32 total_items = 1;
|
|
21
|
+
int32 total_pages = 2;
|
|
22
|
+
int32 current_page = 3;
|
|
23
|
+
int32 per_page = 4;
|
|
24
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package catalog.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import "common.proto";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
service ProductService {
|
|
10
|
+
// Базовий CRUD
|
|
11
|
+
rpc GetProducts (GetProductsRequest) returns (GetProductsResponse);
|
|
12
|
+
rpc GetProduct (GetProductRequest) returns (ProductDetailResponse);
|
|
13
|
+
|
|
14
|
+
rpc CreateProduct (CreateProductRequest) returns (ProductDetailResponse);
|
|
15
|
+
rpc UpdateProduct (UpdateProductRequest) returns (ProductDetailResponse);
|
|
16
|
+
rpc DeleteProduct (DeleteProductRequest) returns (DeleteResponse);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
rpc BulkUpdateStatus (BulkUpdateStatusRequest) returns (SuccessResponse);
|
|
20
|
+
rpc BulkUpdateCategory (BulkUpdateCategoryRequest) returns (SuccessResponse);
|
|
21
|
+
rpc BulkUpdateDiscount (BulkUpdateDiscountRequest) returns (SuccessResponse);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
enum ProductStatus {
|
|
26
|
+
PRODUCT_STATUS_UNSPECIFIED = 0;
|
|
27
|
+
PRODUCT_STATUS_DRAFT = 1;
|
|
28
|
+
PRODUCT_STATUS_ACTIVE = 2;
|
|
29
|
+
PRODUCT_STATUS_INACTIVE = 3;
|
|
30
|
+
PRODUCT_STATUS_ARCHIVED = 4;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
message ProductListItemResponse {
|
|
35
|
+
string id = 1;
|
|
36
|
+
string sku = 2;
|
|
37
|
+
string slug = 3;
|
|
38
|
+
ProductStatus status = 4;
|
|
39
|
+
|
|
40
|
+
map<string, string> name = 5;
|
|
41
|
+
string main_image = 6;
|
|
42
|
+
|
|
43
|
+
double price = 7;
|
|
44
|
+
optional double old_price = 8;
|
|
45
|
+
|
|
46
|
+
int32 total_stock = 9;
|
|
47
|
+
|
|
48
|
+
optional string brand_id = 10;
|
|
49
|
+
repeated string category_ids = 11;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
message ProductDetailResponse {
|
|
54
|
+
string id = 1;
|
|
55
|
+
string sku = 2;
|
|
56
|
+
string slug = 3;
|
|
57
|
+
ProductStatus status = 4;
|
|
58
|
+
int32 sort_order = 5;
|
|
59
|
+
|
|
60
|
+
optional string brand_id = 6;
|
|
61
|
+
|
|
62
|
+
double price = 7;
|
|
63
|
+
optional double old_price = 8;
|
|
64
|
+
|
|
65
|
+
map<string, string> name = 9;
|
|
66
|
+
map<string, string> short_description = 10;
|
|
67
|
+
map<string, string> description = 11;
|
|
68
|
+
map<string, string> composition = 12;
|
|
69
|
+
map<string, string> instructions = 13;
|
|
70
|
+
|
|
71
|
+
map<string, string> meta_title = 14;
|
|
72
|
+
map<string, string> meta_description = 15;
|
|
73
|
+
map<string, string> meta_keywords = 16;
|
|
74
|
+
|
|
75
|
+
string main_image = 17;
|
|
76
|
+
optional string video_url = 18;
|
|
77
|
+
optional string guid_1c = 19;
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
repeated string category_ids = 20;
|
|
81
|
+
repeated ProductImageResponse images = 21;
|
|
82
|
+
repeated ProductWarehouseResponse warehouses = 22;
|
|
83
|
+
repeated ProductVariantResponse variants = 23;
|
|
84
|
+
repeated ProductAttributeResponse attributes = 24;
|
|
85
|
+
repeated ProductFileResponse files = 25;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
message ProductImageResponse {
|
|
90
|
+
string id = 1;
|
|
91
|
+
string url = 2;
|
|
92
|
+
map<string, string> alt = 3;
|
|
93
|
+
int32 sort_order = 4;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message ProductWarehouseResponse {
|
|
97
|
+
string warehouse_id = 1;
|
|
98
|
+
int32 quantity = 2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message ProductVariantResponse {
|
|
102
|
+
string id = 1;
|
|
103
|
+
string sku = 2;
|
|
104
|
+
optional double price = 3;
|
|
105
|
+
int32 stock = 4;
|
|
106
|
+
map<string, string> options = 5;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message ProductAttributeResponse {
|
|
110
|
+
string attribute_id = 1;
|
|
111
|
+
string attribute_value_id = 2;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
message ProductFileResponse {
|
|
115
|
+
string id = 1;
|
|
116
|
+
string url = 2;
|
|
117
|
+
map<string, string> name = 3;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
message GetProductsRequest {
|
|
123
|
+
PaginationRequest pagination = 1;
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
optional string search = 2;
|
|
127
|
+
optional string category_id = 3;
|
|
128
|
+
optional string brand_id = 4;
|
|
129
|
+
optional ProductStatus status = 5;
|
|
130
|
+
optional bool in_stock = 6;
|
|
131
|
+
|
|
132
|
+
optional double price_min = 7;
|
|
133
|
+
optional double price_max = 8;
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
optional string sort_by = 9;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
message GetProductsResponse {
|
|
140
|
+
repeated ProductListItemResponse items = 1;
|
|
141
|
+
PaginationMeta meta = 2;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
message GetProductRequest {
|
|
145
|
+
string id = 1;
|
|
146
|
+
optional string slug = 2;
|
|
147
|
+
optional string sku = 3;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
message CreateProductRequest {
|
|
152
|
+
string sku = 1;
|
|
153
|
+
string slug = 2;
|
|
154
|
+
ProductStatus status = 3;
|
|
155
|
+
|
|
156
|
+
optional string brand_id = 4;
|
|
157
|
+
double price = 5;
|
|
158
|
+
optional double old_price = 6;
|
|
159
|
+
|
|
160
|
+
map<string, string> name = 7;
|
|
161
|
+
map<string, string> short_description = 8;
|
|
162
|
+
map<string, string> description = 9;
|
|
163
|
+
|
|
164
|
+
map<string, string> meta_title = 10;
|
|
165
|
+
map<string, string> meta_description = 11;
|
|
166
|
+
|
|
167
|
+
optional string main_image = 12;
|
|
168
|
+
optional string guid_1c = 13;
|
|
169
|
+
|
|
170
|
+
repeated string category_ids = 14;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
message UpdateProductRequest {
|
|
174
|
+
string id = 1;
|
|
175
|
+
optional string sku = 2;
|
|
176
|
+
optional string slug = 3;
|
|
177
|
+
optional ProductStatus status = 4;
|
|
178
|
+
|
|
179
|
+
optional string brand_id = 5;
|
|
180
|
+
optional double price = 6;
|
|
181
|
+
optional double old_price = 7;
|
|
182
|
+
|
|
183
|
+
map<string, string> name = 8;
|
|
184
|
+
map<string, string> description = 9;
|
|
185
|
+
map<string, string> short_description = 10;
|
|
186
|
+
|
|
187
|
+
map<string, string> meta_title = 11;
|
|
188
|
+
map<string, string> meta_description = 12;
|
|
189
|
+
|
|
190
|
+
optional string main_image = 13;
|
|
191
|
+
repeated string category_ids = 14;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
message DeleteProductRequest {
|
|
195
|
+
string id = 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
message BulkUpdateStatusRequest {
|
|
200
|
+
repeated string product_ids = 1;
|
|
201
|
+
ProductStatus status = 2;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
message BulkUpdateCategoryRequest {
|
|
205
|
+
repeated string product_ids = 1;
|
|
206
|
+
string category_id = 2;
|
|
207
|
+
bool append = 3;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
message BulkUpdateDiscountRequest {
|
|
211
|
+
repeated string product_ids = 1;
|
|
212
|
+
double discount_percentage = 2;
|
|
213
|
+
}
|