@lean2708/shared-grpc-contracts 1.0.9 → 1.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lean2708/shared-grpc-contracts",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "Shared gRPC Protocol Buffer contracts",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,83 @@
1
+ syntax = "proto3";
2
+
3
+ package shared.variant.v1;
4
+
5
+ option java_multiple_files = true;
6
+ option java_package = "com.shared.grpc.variant";
7
+ option java_outer_classname = "VariantProto";
8
+
9
+ service VariantService {
10
+
11
+ rpc GetVariantForFlashSale(GetVariantForFlashSaleRequest)
12
+ returns (GetVariantForFlashSaleResponse);
13
+
14
+ rpc GetVariantForCart(GetVariantForCartRequest)
15
+ returns (CartVariantInfo);
16
+
17
+ rpc GetVariantsForCart(GetVariantsForCartRequest)
18
+ returns (GetVariantsForCartResponse);
19
+ }
20
+
21
+
22
+ // ==================== FLASH SALE ====================
23
+ message GetVariantForFlashSaleRequest {
24
+
25
+ int64 product_id = 1;
26
+
27
+ int64 variant_id = 2;
28
+ }
29
+
30
+ message GetVariantForFlashSaleResponse {
31
+
32
+ int64 product_id = 1;
33
+
34
+ int64 variant_id = 2;
35
+
36
+ string price = 3;
37
+
38
+ bool available = 4;
39
+ }
40
+
41
+
42
+ // ==================== CART ====================
43
+ message GetVariantForCartRequest {
44
+
45
+ int64 product_id = 1;
46
+
47
+ int64 variant_id = 2;
48
+ }
49
+
50
+ message GetVariantsForCartRequest {
51
+
52
+ repeated int64 variant_ids = 1;
53
+ }
54
+
55
+ message CartVariantInfo {
56
+
57
+ int64 product_id = 1;
58
+
59
+ int64 variant_id = 2;
60
+
61
+ int64 shop_id = 3;
62
+
63
+ string product_name = 4;
64
+
65
+ string variant_name = 5;
66
+
67
+ string image_url = 6;
68
+
69
+ string price = 7;
70
+
71
+ int32 available_quantity = 8;
72
+
73
+ bool available = 9;
74
+
75
+ string shop_name = 10;
76
+
77
+ string shop_avatar_url = 11;
78
+ }
79
+
80
+ message GetVariantsForCartResponse {
81
+
82
+ repeated CartVariantInfo variants = 1;
83
+ }