-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct.proto
101 lines (83 loc) · 2.71 KB
/
product.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
syntax = "proto3";
option csharp_namespace = "GsServer.Protobufs";
import "gs_protobufs/protos/custom_types/decimal_value.proto";
import "gs_protobufs/protos/custom_types/void_value.proto";
import "google/protobuf/wrappers.proto";
package protos.product;
service ProductService {
rpc GetAllAsync(custom_types.void.VoidValue) returns (GetAllProductsResponse);
rpc GetByIdAsync(GetProductByIdRequest) returns (GetProductByIdResponse);
rpc PostAsync(CreateProductRequest) returns (custom_types.void.VoidValue);
rpc PutAsync(UpdateProductRequest) returns (custom_types.void.VoidValue);
rpc DeleteAsync(DeleteProductRequest) returns (custom_types.void.VoidValue);
rpc GetAllBrandsAsync(custom_types.void.VoidValue) returns (GetAllProductBrandsResponse);
rpc PostBrandAsync(CreateProductBrandRequest) returns (custom_types.void.VoidValue);
rpc GetAllCategoriesAsync(custom_types.void.VoidValue) returns (GetAllProductCategoriesResponse);
rpc PostCategoryAsync(CreateProductCategoryRequest) returns (custom_types.void.VoidValue);
}
message GetAllProductsResponse {
repeated GetProductByIdResponse products = 1;
}
message GetProductByIdRequest {
string product_id = 1;
}
message GetProductByIdResponse {
string product_id = 1;
string name = 2;
google.protobuf.StringValue picture_path = 3;
ProductBrand product_brand = 4;
ProductCategory product_category = 5;
repeated ProductVariant variants = 6;
}
message CreateProductRequest {
string name = 2;
optional bytes picture_binary = 3;
string product_brand_id = 4;
string product_category_id = 5;
repeated ProductVariant variants = 6;
}
message UpdateProductRequest {
string product_id = 1;
string name = 2;
optional bytes picture_binary = 3;
google.protobuf.StringValue product_brand_id = 4;
google.protobuf.StringValue product_category_id = 5;
repeated ProductVariant variants = 6;
}
message DeleteProductRequest {
string product_id = 1;
}
message GetAllProductBrandsResponse {
repeated ProductBrand brands = 1;
}
message CreateProductBrandRequest {
string name = 1;
}
message ProductBrand {
string product_brand_id = 1;
string name = 2;
}
message GetAllProductCategoriesResponse {
repeated ProductCategory brands = 1;
}
message CreateProductCategoryRequest {
string name = 1;
}
message ProductCategory {
string product_category_id = 1;
string name = 2;
}
message ProductVariant {
string product_variant_id = 1;
string color = 2;
string size = 3;
string bar_code = 4;
string sku = 5;
custom_types.decimal_value.DecimalValue unit_price = 6;
ProductVariantInventory inventory = 7;
}
message ProductVariantInventory {
string product_variant_inventory_id = 1;
int32 quantity_available = 2;
int32 minimum_stock_amount = 3;
}