@mamindom/contracts 1.0.15 → 1.0.17

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.
@@ -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
+ }
@@ -2,40 +2,29 @@ syntax = "proto3";
2
2
 
3
3
  package catalog.v1;
4
4
 
5
- service CatalogService {
6
-
5
+
6
+ import "common.proto";
7
+
8
+
9
+ service CategoryService {
7
10
  rpc GetCategoryTree (GetCategoryTreeRequest) returns (GetCategoryTreeResponse);
8
11
 
9
12
  rpc GetCategory (GetCategoryRequest) returns (CategoryResponse);
10
13
  rpc CreateCategory (CreateCategoryRequest) returns (CategoryResponse);
11
14
  rpc UpdateCategory (UpdateCategoryRequest) returns (CategoryResponse);
15
+
16
+
12
17
  rpc DeleteCategory (DeleteCategoryRequest) returns (DeleteResponse);
13
18
 
19
+
14
20
  rpc UpdateCategoryOrder (UpdateCategoryOrderRequest) returns (SuccessResponse);
15
-
16
- rpc GetAttribute (GetAttributeRequest) returns (AttributeResponse);
17
- rpc CreateAttribute (CreateAttributeRequest) returns (AttributeResponse);
18
- rpc UpdateAttribute (UpdateAttributeRequest) returns (AttributeResponse);
19
- rpc DeleteAttribute (DeleteAttributeRequest) returns (DeleteResponse);
20
-
21
- rpc BindAttributeToCategory (BindAttributeRequest) returns (SuccessResponse);
22
- rpc UnbindAttributeFromCategory (BindAttributeRequest) returns (SuccessResponse);
23
21
  }
24
22
 
25
23
 
26
- message SuccessResponse {
27
- bool success = 1;
28
- }
29
-
30
- message DeleteResponse {
31
- bool success = 1;
32
- }
33
-
34
24
  message GetCategoryTreeRequest {
35
25
  string lang = 1;
36
26
  }
37
27
 
38
-
39
28
  message CategoryTreeNode {
40
29
  string id = 1;
41
30
  string parent_id = 2;
@@ -49,7 +38,6 @@ message GetCategoryTreeResponse {
49
38
  repeated CategoryTreeNode items = 1;
50
39
  }
51
40
 
52
-
53
41
  message CategoryResponse {
54
42
  string id = 1;
55
43
  optional string parent_id = 2;
@@ -58,7 +46,6 @@ message CategoryResponse {
58
46
  bool status = 5;
59
47
  int32 sort_order = 6;
60
48
 
61
-
62
49
  map<string, string> name = 7;
63
50
  map<string, string> description = 8;
64
51
 
@@ -122,39 +109,4 @@ message CategoryOrderItem {
122
109
 
123
110
  message UpdateCategoryOrderRequest {
124
111
  repeated CategoryOrderItem items = 1;
125
- }
126
-
127
- message AttributeResponse {
128
- string id = 1;
129
- string slug = 2;
130
- map<string, string> name = 3;
131
- string display_type = 4;
132
- optional string guid_1c = 5;
133
- }
134
-
135
- message GetAttributeRequest {
136
- string id = 1;
137
- }
138
-
139
- message CreateAttributeRequest {
140
- string slug = 1;
141
- map<string, string> name = 2;
142
- string display_type = 3;
143
- optional string guid_1c = 4;
144
- }
145
-
146
- message UpdateAttributeRequest {
147
- string id = 1;
148
- optional string slug = 2;
149
- map<string, string> name = 3;
150
- optional string display_type = 4;
151
- }
152
-
153
- message DeleteAttributeRequest {
154
- string id = 1;
155
- }
156
-
157
- message BindAttributeRequest {
158
- string category_id = 1;
159
- string attribute_id = 2;
160
112
  }
@@ -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,215 @@
1
+ syntax = "proto3";
2
+
3
+ package catalog.v1;
4
+
5
+
6
+ import "common.proto";
7
+
8
+
9
+ service ProductService {
10
+
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
+ string created_by_id = 15;
173
+ }
174
+
175
+ message UpdateProductRequest {
176
+ string id = 1;
177
+ optional string sku = 2;
178
+ optional string slug = 3;
179
+ optional ProductStatus status = 4;
180
+
181
+ optional string brand_id = 5;
182
+ optional double price = 6;
183
+ optional double old_price = 7;
184
+
185
+ map<string, string> name = 8;
186
+ map<string, string> description = 9;
187
+ map<string, string> short_description = 10;
188
+
189
+ map<string, string> meta_title = 11;
190
+ map<string, string> meta_description = 12;
191
+
192
+ optional string main_image = 13;
193
+ repeated string category_ids = 14;
194
+ }
195
+
196
+ message DeleteProductRequest {
197
+ string id = 1;
198
+ }
199
+
200
+
201
+ message BulkUpdateStatusRequest {
202
+ repeated string product_ids = 1;
203
+ ProductStatus status = 2;
204
+ }
205
+
206
+ message BulkUpdateCategoryRequest {
207
+ repeated string product_ids = 1;
208
+ string category_id = 2;
209
+ bool append = 3;
210
+ }
211
+
212
+ message BulkUpdateDiscountRequest {
213
+ repeated string product_ids = 1;
214
+ double discount_percentage = 2;
215
+ }