@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
package/gen/product.ts
ADDED
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.4
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: product.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { DeleteResponse, PaginationMeta, PaginationRequest, SuccessResponse } from "./common";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "catalog.v1";
|
|
13
|
+
|
|
14
|
+
export enum ProductStatus {
|
|
15
|
+
PRODUCT_STATUS_UNSPECIFIED = 0,
|
|
16
|
+
PRODUCT_STATUS_DRAFT = 1,
|
|
17
|
+
PRODUCT_STATUS_ACTIVE = 2,
|
|
18
|
+
PRODUCT_STATUS_INACTIVE = 3,
|
|
19
|
+
PRODUCT_STATUS_ARCHIVED = 4,
|
|
20
|
+
UNRECOGNIZED = -1,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ProductListItemResponse {
|
|
24
|
+
id: string;
|
|
25
|
+
sku: string;
|
|
26
|
+
slug: string;
|
|
27
|
+
status: ProductStatus;
|
|
28
|
+
name: { [key: string]: string };
|
|
29
|
+
mainImage: string;
|
|
30
|
+
price: number;
|
|
31
|
+
oldPrice?: number | undefined;
|
|
32
|
+
totalStock: number;
|
|
33
|
+
brandId?: string | undefined;
|
|
34
|
+
categoryIds: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ProductListItemResponse_NameEntry {
|
|
38
|
+
key: string;
|
|
39
|
+
value: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ProductDetailResponse {
|
|
43
|
+
id: string;
|
|
44
|
+
sku: string;
|
|
45
|
+
slug: string;
|
|
46
|
+
status: ProductStatus;
|
|
47
|
+
sortOrder: number;
|
|
48
|
+
brandId?: string | undefined;
|
|
49
|
+
price: number;
|
|
50
|
+
oldPrice?: number | undefined;
|
|
51
|
+
name: { [key: string]: string };
|
|
52
|
+
shortDescription: { [key: string]: string };
|
|
53
|
+
description: { [key: string]: string };
|
|
54
|
+
composition: { [key: string]: string };
|
|
55
|
+
instructions: { [key: string]: string };
|
|
56
|
+
metaTitle: { [key: string]: string };
|
|
57
|
+
metaDescription: { [key: string]: string };
|
|
58
|
+
metaKeywords: { [key: string]: string };
|
|
59
|
+
mainImage: string;
|
|
60
|
+
videoUrl?: string | undefined;
|
|
61
|
+
guid1c?: string | undefined;
|
|
62
|
+
categoryIds: string[];
|
|
63
|
+
images: ProductImageResponse[];
|
|
64
|
+
warehouses: ProductWarehouseResponse[];
|
|
65
|
+
variants: ProductVariantResponse[];
|
|
66
|
+
attributes: ProductAttributeResponse[];
|
|
67
|
+
files: ProductFileResponse[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface ProductDetailResponse_NameEntry {
|
|
71
|
+
key: string;
|
|
72
|
+
value: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ProductDetailResponse_ShortDescriptionEntry {
|
|
76
|
+
key: string;
|
|
77
|
+
value: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ProductDetailResponse_DescriptionEntry {
|
|
81
|
+
key: string;
|
|
82
|
+
value: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface ProductDetailResponse_CompositionEntry {
|
|
86
|
+
key: string;
|
|
87
|
+
value: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface ProductDetailResponse_InstructionsEntry {
|
|
91
|
+
key: string;
|
|
92
|
+
value: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface ProductDetailResponse_MetaTitleEntry {
|
|
96
|
+
key: string;
|
|
97
|
+
value: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface ProductDetailResponse_MetaDescriptionEntry {
|
|
101
|
+
key: string;
|
|
102
|
+
value: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface ProductDetailResponse_MetaKeywordsEntry {
|
|
106
|
+
key: string;
|
|
107
|
+
value: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface ProductImageResponse {
|
|
111
|
+
id: string;
|
|
112
|
+
url: string;
|
|
113
|
+
alt: { [key: string]: string };
|
|
114
|
+
sortOrder: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface ProductImageResponse_AltEntry {
|
|
118
|
+
key: string;
|
|
119
|
+
value: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface ProductWarehouseResponse {
|
|
123
|
+
warehouseId: string;
|
|
124
|
+
quantity: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface ProductVariantResponse {
|
|
128
|
+
id: string;
|
|
129
|
+
sku: string;
|
|
130
|
+
price?: number | undefined;
|
|
131
|
+
stock: number;
|
|
132
|
+
options: { [key: string]: string };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface ProductVariantResponse_OptionsEntry {
|
|
136
|
+
key: string;
|
|
137
|
+
value: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface ProductAttributeResponse {
|
|
141
|
+
attributeId: string;
|
|
142
|
+
attributeValueId: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface ProductFileResponse {
|
|
146
|
+
id: string;
|
|
147
|
+
url: string;
|
|
148
|
+
name: { [key: string]: string };
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface ProductFileResponse_NameEntry {
|
|
152
|
+
key: string;
|
|
153
|
+
value: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface GetProductsRequest {
|
|
157
|
+
pagination: PaginationRequest | undefined;
|
|
158
|
+
search?: string | undefined;
|
|
159
|
+
categoryId?: string | undefined;
|
|
160
|
+
brandId?: string | undefined;
|
|
161
|
+
status?: ProductStatus | undefined;
|
|
162
|
+
inStock?: boolean | undefined;
|
|
163
|
+
priceMin?: number | undefined;
|
|
164
|
+
priceMax?: number | undefined;
|
|
165
|
+
sortBy?: string | undefined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface GetProductsResponse {
|
|
169
|
+
items: ProductListItemResponse[];
|
|
170
|
+
meta: PaginationMeta | undefined;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface GetProductRequest {
|
|
174
|
+
id: string;
|
|
175
|
+
slug?: string | undefined;
|
|
176
|
+
sku?: string | undefined;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface CreateProductRequest {
|
|
180
|
+
sku: string;
|
|
181
|
+
slug: string;
|
|
182
|
+
status: ProductStatus;
|
|
183
|
+
brandId?: string | undefined;
|
|
184
|
+
price: number;
|
|
185
|
+
oldPrice?: number | undefined;
|
|
186
|
+
name: { [key: string]: string };
|
|
187
|
+
shortDescription: { [key: string]: string };
|
|
188
|
+
description: { [key: string]: string };
|
|
189
|
+
metaTitle: { [key: string]: string };
|
|
190
|
+
metaDescription: { [key: string]: string };
|
|
191
|
+
mainImage?: string | undefined;
|
|
192
|
+
guid1c?: string | undefined;
|
|
193
|
+
categoryIds: string[];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface CreateProductRequest_NameEntry {
|
|
197
|
+
key: string;
|
|
198
|
+
value: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface CreateProductRequest_ShortDescriptionEntry {
|
|
202
|
+
key: string;
|
|
203
|
+
value: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface CreateProductRequest_DescriptionEntry {
|
|
207
|
+
key: string;
|
|
208
|
+
value: string;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface CreateProductRequest_MetaTitleEntry {
|
|
212
|
+
key: string;
|
|
213
|
+
value: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface CreateProductRequest_MetaDescriptionEntry {
|
|
217
|
+
key: string;
|
|
218
|
+
value: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface UpdateProductRequest {
|
|
222
|
+
id: string;
|
|
223
|
+
sku?: string | undefined;
|
|
224
|
+
slug?: string | undefined;
|
|
225
|
+
status?: ProductStatus | undefined;
|
|
226
|
+
brandId?: string | undefined;
|
|
227
|
+
price?: number | undefined;
|
|
228
|
+
oldPrice?: number | undefined;
|
|
229
|
+
name: { [key: string]: string };
|
|
230
|
+
description: { [key: string]: string };
|
|
231
|
+
shortDescription: { [key: string]: string };
|
|
232
|
+
metaTitle: { [key: string]: string };
|
|
233
|
+
metaDescription: { [key: string]: string };
|
|
234
|
+
mainImage?: string | undefined;
|
|
235
|
+
categoryIds: string[];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface UpdateProductRequest_NameEntry {
|
|
239
|
+
key: string;
|
|
240
|
+
value: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface UpdateProductRequest_DescriptionEntry {
|
|
244
|
+
key: string;
|
|
245
|
+
value: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface UpdateProductRequest_ShortDescriptionEntry {
|
|
249
|
+
key: string;
|
|
250
|
+
value: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface UpdateProductRequest_MetaTitleEntry {
|
|
254
|
+
key: string;
|
|
255
|
+
value: string;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface UpdateProductRequest_MetaDescriptionEntry {
|
|
259
|
+
key: string;
|
|
260
|
+
value: string;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export interface DeleteProductRequest {
|
|
264
|
+
id: string;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface BulkUpdateStatusRequest {
|
|
268
|
+
productIds: string[];
|
|
269
|
+
status: ProductStatus;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface BulkUpdateCategoryRequest {
|
|
273
|
+
productIds: string[];
|
|
274
|
+
categoryId: string;
|
|
275
|
+
append: boolean;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface BulkUpdateDiscountRequest {
|
|
279
|
+
productIds: string[];
|
|
280
|
+
discountPercentage: number;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
284
|
+
|
|
285
|
+
export interface ProductServiceClient {
|
|
286
|
+
/** Базовий CRUD */
|
|
287
|
+
|
|
288
|
+
getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
|
|
289
|
+
|
|
290
|
+
getProduct(request: GetProductRequest): Observable<ProductDetailResponse>;
|
|
291
|
+
|
|
292
|
+
createProduct(request: CreateProductRequest): Observable<ProductDetailResponse>;
|
|
293
|
+
|
|
294
|
+
updateProduct(request: UpdateProductRequest): Observable<ProductDetailResponse>;
|
|
295
|
+
|
|
296
|
+
deleteProduct(request: DeleteProductRequest): Observable<DeleteResponse>;
|
|
297
|
+
|
|
298
|
+
bulkUpdateStatus(request: BulkUpdateStatusRequest): Observable<SuccessResponse>;
|
|
299
|
+
|
|
300
|
+
bulkUpdateCategory(request: BulkUpdateCategoryRequest): Observable<SuccessResponse>;
|
|
301
|
+
|
|
302
|
+
bulkUpdateDiscount(request: BulkUpdateDiscountRequest): Observable<SuccessResponse>;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface ProductServiceController {
|
|
306
|
+
/** Базовий CRUD */
|
|
307
|
+
|
|
308
|
+
getProducts(
|
|
309
|
+
request: GetProductsRequest,
|
|
310
|
+
): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
|
|
311
|
+
|
|
312
|
+
getProduct(
|
|
313
|
+
request: GetProductRequest,
|
|
314
|
+
): Promise<ProductDetailResponse> | Observable<ProductDetailResponse> | ProductDetailResponse;
|
|
315
|
+
|
|
316
|
+
createProduct(
|
|
317
|
+
request: CreateProductRequest,
|
|
318
|
+
): Promise<ProductDetailResponse> | Observable<ProductDetailResponse> | ProductDetailResponse;
|
|
319
|
+
|
|
320
|
+
updateProduct(
|
|
321
|
+
request: UpdateProductRequest,
|
|
322
|
+
): Promise<ProductDetailResponse> | Observable<ProductDetailResponse> | ProductDetailResponse;
|
|
323
|
+
|
|
324
|
+
deleteProduct(request: DeleteProductRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
325
|
+
|
|
326
|
+
bulkUpdateStatus(
|
|
327
|
+
request: BulkUpdateStatusRequest,
|
|
328
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
329
|
+
|
|
330
|
+
bulkUpdateCategory(
|
|
331
|
+
request: BulkUpdateCategoryRequest,
|
|
332
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
333
|
+
|
|
334
|
+
bulkUpdateDiscount(
|
|
335
|
+
request: BulkUpdateDiscountRequest,
|
|
336
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export function ProductServiceControllerMethods() {
|
|
340
|
+
return function (constructor: Function) {
|
|
341
|
+
const grpcMethods: string[] = [
|
|
342
|
+
"getProducts",
|
|
343
|
+
"getProduct",
|
|
344
|
+
"createProduct",
|
|
345
|
+
"updateProduct",
|
|
346
|
+
"deleteProduct",
|
|
347
|
+
"bulkUpdateStatus",
|
|
348
|
+
"bulkUpdateCategory",
|
|
349
|
+
"bulkUpdateDiscount",
|
|
350
|
+
];
|
|
351
|
+
for (const method of grpcMethods) {
|
|
352
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
353
|
+
GrpcMethod("ProductService", method)(constructor.prototype[method], method, descriptor);
|
|
354
|
+
}
|
|
355
|
+
const grpcStreamMethods: string[] = [];
|
|
356
|
+
for (const method of grpcStreamMethods) {
|
|
357
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
358
|
+
GrpcStreamMethod("ProductService", method)(constructor.prototype[method], method, descriptor);
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export const PRODUCT_SERVICE_NAME = "ProductService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package catalog.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import "common.proto";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
service AttributeService {
|
|
10
|
+
|
|
11
|
+
rpc GetAttributeGroups (GetAttributeGroupsRequest) returns (GetAttributeGroupsResponse);
|
|
12
|
+
rpc GetAttributeGroup (GetAttributeGroupRequest) returns (AttributeGroupResponse);
|
|
13
|
+
rpc CreateAttributeGroup (CreateAttributeGroupRequest) returns (AttributeGroupResponse);
|
|
14
|
+
rpc UpdateAttributeGroup (UpdateAttributeGroupRequest) returns (AttributeGroupResponse);
|
|
15
|
+
rpc DeleteAttributeGroup (DeleteAttributeGroupRequest) returns (DeleteResponse);
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
rpc GetAttributes (GetAttributesRequest) returns (GetAttributesResponse);
|
|
19
|
+
rpc GetAttribute (GetAttributeRequest) returns (AttributeResponse);
|
|
20
|
+
rpc CreateAttribute (CreateAttributeRequest) returns (AttributeResponse);
|
|
21
|
+
rpc UpdateAttribute (UpdateAttributeRequest) returns (AttributeResponse);
|
|
22
|
+
rpc DeleteAttribute (DeleteAttributeRequest) returns (DeleteResponse);
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
rpc GetAttributeValues (GetAttributeValuesRequest) returns (GetAttributeValuesResponse);
|
|
26
|
+
rpc CreateAttributeValue (CreateAttributeValueRequest) returns (AttributeValueResponse);
|
|
27
|
+
rpc UpdateAttributeValue (UpdateAttributeValueRequest) returns (AttributeValueResponse);
|
|
28
|
+
rpc DeleteAttributeValue (DeleteAttributeValueRequest) returns (DeleteResponse);
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
rpc BindAttributeToCategory (BindAttributeRequest) returns (SuccessResponse);
|
|
32
|
+
rpc UnbindAttributeFromCategory (BindAttributeRequest) returns (SuccessResponse);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
message AttributeGroupResponse {
|
|
37
|
+
string id = 1;
|
|
38
|
+
map<string, string> name = 2;
|
|
39
|
+
int32 sort_order = 3;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message GetAttributeGroupsRequest {
|
|
43
|
+
PaginationRequest pagination = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message GetAttributeGroupsResponse {
|
|
47
|
+
repeated AttributeGroupResponse items = 1;
|
|
48
|
+
PaginationMeta meta = 2;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message GetAttributeGroupRequest {
|
|
52
|
+
string id = 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message CreateAttributeGroupRequest {
|
|
56
|
+
map<string, string> name = 1;
|
|
57
|
+
int32 sort_order = 2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message UpdateAttributeGroupRequest {
|
|
61
|
+
string id = 1;
|
|
62
|
+
map<string, string> name = 2;
|
|
63
|
+
optional int32 sort_order = 3;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message DeleteAttributeGroupRequest {
|
|
67
|
+
string id = 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
message AttributeResponse {
|
|
72
|
+
string id = 1;
|
|
73
|
+
optional string group_id = 2;
|
|
74
|
+
string slug = 3;
|
|
75
|
+
map<string, string> name = 4;
|
|
76
|
+
string display_type = 5;
|
|
77
|
+
int32 sort_order = 6;
|
|
78
|
+
optional string guid_1c = 7;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message GetAttributesRequest {
|
|
82
|
+
PaginationRequest pagination = 1;
|
|
83
|
+
optional string group_id = 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message GetAttributesResponse {
|
|
87
|
+
repeated AttributeResponse items = 1;
|
|
88
|
+
PaginationMeta meta = 2;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
message GetAttributeRequest {
|
|
92
|
+
string id = 1;
|
|
93
|
+
optional string slug = 2;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message CreateAttributeRequest {
|
|
97
|
+
optional string group_id = 1;
|
|
98
|
+
string slug = 2;
|
|
99
|
+
map<string, string> name = 3;
|
|
100
|
+
string display_type = 4;
|
|
101
|
+
int32 sort_order = 5;
|
|
102
|
+
optional string guid_1c = 6;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message UpdateAttributeRequest {
|
|
106
|
+
string id = 1;
|
|
107
|
+
optional string group_id = 2;
|
|
108
|
+
optional string slug = 3;
|
|
109
|
+
map<string, string> name = 4;
|
|
110
|
+
optional string display_type = 5;
|
|
111
|
+
optional int32 sort_order = 6;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
message DeleteAttributeRequest {
|
|
115
|
+
string id = 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
message AttributeValueResponse {
|
|
120
|
+
string id = 1;
|
|
121
|
+
string attribute_id = 2;
|
|
122
|
+
map<string, string> value = 3;
|
|
123
|
+
optional string meta = 4;
|
|
124
|
+
optional string guid_1c = 5;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
message GetAttributeValuesRequest {
|
|
128
|
+
string attribute_id = 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
message GetAttributeValuesResponse {
|
|
132
|
+
repeated AttributeValueResponse items = 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
message CreateAttributeValueRequest {
|
|
136
|
+
string attribute_id = 1;
|
|
137
|
+
map<string, string> value = 2;
|
|
138
|
+
optional string meta = 3;
|
|
139
|
+
optional string guid_1c = 4;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
message UpdateAttributeValueRequest {
|
|
143
|
+
string id = 1;
|
|
144
|
+
map<string, string> value = 2;
|
|
145
|
+
optional string meta = 3;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
message DeleteAttributeValueRequest {
|
|
149
|
+
string id = 1;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
message BindAttributeRequest {
|
|
154
|
+
string category_id = 1;
|
|
155
|
+
string attribute_id = 2;
|
|
156
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package catalog.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import "common.proto";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
service BrandService {
|
|
10
|
+
rpc GetBrands (GetBrandsRequest) returns (GetBrandsResponse);
|
|
11
|
+
rpc GetBrand (GetBrandRequest) returns (BrandResponse);
|
|
12
|
+
|
|
13
|
+
rpc CreateBrand (CreateBrandRequest) returns (BrandResponse);
|
|
14
|
+
rpc UpdateBrand (UpdateBrandRequest) returns (BrandResponse);
|
|
15
|
+
rpc DeleteBrand (DeleteBrandRequest) returns (DeleteResponse);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
message BrandResponse {
|
|
20
|
+
string id = 1;
|
|
21
|
+
string slug = 2;
|
|
22
|
+
string name = 3;
|
|
23
|
+
optional string image = 4;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
map<string, string> description = 5;
|
|
27
|
+
map<string, string> meta_title = 6;
|
|
28
|
+
map<string, string> meta_description = 7;
|
|
29
|
+
|
|
30
|
+
optional string guid_1c = 8;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
message GetBrandsRequest {
|
|
35
|
+
PaginationRequest pagination = 1;
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message GetBrandsResponse {
|
|
40
|
+
repeated BrandResponse items = 1;
|
|
41
|
+
PaginationMeta meta = 2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message GetBrandRequest {
|
|
45
|
+
string id = 1;
|
|
46
|
+
optional string slug = 2;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message CreateBrandRequest {
|
|
50
|
+
string slug = 1;
|
|
51
|
+
string name = 2;
|
|
52
|
+
optional string image = 3;
|
|
53
|
+
|
|
54
|
+
map<string, string> description = 4;
|
|
55
|
+
map<string, string> meta_title = 5;
|
|
56
|
+
map<string, string> meta_description = 6;
|
|
57
|
+
|
|
58
|
+
optional string guid_1c = 7;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message UpdateBrandRequest {
|
|
62
|
+
string id = 1;
|
|
63
|
+
optional string slug = 2;
|
|
64
|
+
optional string name = 3;
|
|
65
|
+
optional string image = 4;
|
|
66
|
+
|
|
67
|
+
map<string, string> description = 5;
|
|
68
|
+
map<string, string> meta_title = 6;
|
|
69
|
+
map<string, string> meta_description = 7;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message DeleteBrandRequest {
|
|
73
|
+
string id = 1;
|
|
74
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package catalog.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import "common.proto";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
service CategoryService {
|
|
10
|
+
rpc GetCategoryTree (GetCategoryTreeRequest) returns (GetCategoryTreeResponse);
|
|
11
|
+
|
|
12
|
+
rpc GetCategory (GetCategoryRequest) returns (CategoryResponse);
|
|
13
|
+
rpc CreateCategory (CreateCategoryRequest) returns (CategoryResponse);
|
|
14
|
+
rpc UpdateCategory (UpdateCategoryRequest) returns (CategoryResponse);
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
rpc DeleteCategory (DeleteCategoryRequest) returns (DeleteResponse);
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
rpc UpdateCategoryOrder (UpdateCategoryOrderRequest) returns (SuccessResponse);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
message GetCategoryTreeRequest {
|
|
25
|
+
string lang = 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message CategoryTreeNode {
|
|
29
|
+
string id = 1;
|
|
30
|
+
string parent_id = 2;
|
|
31
|
+
string slug = 3;
|
|
32
|
+
string name = 4;
|
|
33
|
+
string image = 5;
|
|
34
|
+
repeated CategoryTreeNode children = 6;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message GetCategoryTreeResponse {
|
|
38
|
+
repeated CategoryTreeNode items = 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message CategoryResponse {
|
|
42
|
+
string id = 1;
|
|
43
|
+
optional string parent_id = 2;
|
|
44
|
+
string slug = 3;
|
|
45
|
+
optional string image = 4;
|
|
46
|
+
bool status = 5;
|
|
47
|
+
int32 sort_order = 6;
|
|
48
|
+
|
|
49
|
+
map<string, string> name = 7;
|
|
50
|
+
map<string, string> description = 8;
|
|
51
|
+
|
|
52
|
+
map<string, string> meta_title = 9;
|
|
53
|
+
map<string, string> meta_description = 10;
|
|
54
|
+
map<string, string> meta_keywords = 11;
|
|
55
|
+
map<string, string> meta_h1 = 12;
|
|
56
|
+
|
|
57
|
+
optional string guid_1c = 13;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message GetCategoryRequest {
|
|
61
|
+
string id = 1;
|
|
62
|
+
optional string slug = 2;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message CreateCategoryRequest {
|
|
66
|
+
optional string parent_id = 1;
|
|
67
|
+
string slug = 2;
|
|
68
|
+
optional string image = 3;
|
|
69
|
+
bool status = 4;
|
|
70
|
+
int32 sort_order = 5;
|
|
71
|
+
|
|
72
|
+
map<string, string> name = 6;
|
|
73
|
+
map<string, string> description = 7;
|
|
74
|
+
|
|
75
|
+
map<string, string> meta_title = 8;
|
|
76
|
+
map<string, string> meta_description = 9;
|
|
77
|
+
map<string, string> meta_keywords = 10;
|
|
78
|
+
map<string, string> meta_h1 = 11;
|
|
79
|
+
|
|
80
|
+
optional string guid_1c = 12;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
message UpdateCategoryRequest {
|
|
84
|
+
string id = 1;
|
|
85
|
+
optional string parent_id = 2;
|
|
86
|
+
optional string slug = 3;
|
|
87
|
+
optional string image = 4;
|
|
88
|
+
optional bool status = 5;
|
|
89
|
+
optional int32 sort_order = 6;
|
|
90
|
+
|
|
91
|
+
map<string, string> name = 7;
|
|
92
|
+
map<string, string> description = 8;
|
|
93
|
+
|
|
94
|
+
map<string, string> meta_title = 9;
|
|
95
|
+
map<string, string> meta_description = 10;
|
|
96
|
+
map<string, string> meta_keywords = 11;
|
|
97
|
+
map<string, string> meta_h1 = 12;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
message DeleteCategoryRequest {
|
|
101
|
+
string id = 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message CategoryOrderItem {
|
|
105
|
+
string id = 1;
|
|
106
|
+
int32 sort_order = 2;
|
|
107
|
+
optional string parent_id = 3;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
message UpdateCategoryOrderRequest {
|
|
111
|
+
repeated CategoryOrderItem items = 1;
|
|
112
|
+
}
|