@mamindom/contracts 1.0.50 → 1.0.52
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/gen/calculation.d.ts +55 -0
- package/dist/gen/calculation.js +28 -0
- package/dist/gen/common_post.d.ts +18 -0
- package/dist/gen/common_post.js +11 -0
- package/dist/gen/coupon.d.ts +96 -0
- package/dist/gen/coupon.js +37 -0
- package/dist/gen/post.d.ts +304 -0
- package/dist/gen/post.js +55 -0
- package/dist/gen/post_category.d.ts +104 -0
- package/dist/gen/post_category.js +43 -0
- package/dist/gen/post_comment.d.ts +54 -0
- package/dist/gen/post_comment.js +36 -0
- package/dist/gen/post_tag.d.ts +68 -0
- package/dist/gen/post_tag.js +28 -0
- package/dist/gen/post_version.d.ts +73 -0
- package/dist/gen/post_version.js +28 -0
- package/dist/gen/promotion.d.ts +284 -0
- package/dist/gen/promotion.js +91 -0
- package/dist/proto/calculation.proto +66 -0
- package/dist/proto/common_post.proto +23 -0
- package/dist/proto/common_promo.proto +6 -7
- package/dist/proto/coupon.proto +121 -0
- package/dist/proto/post.proto +193 -0
- package/dist/proto/post_category.proto +84 -0
- package/dist/proto/post_comment.proto +66 -0
- package/dist/proto/post_tag.proto +57 -0
- package/dist/proto/post_version.proto +61 -0
- package/dist/proto/promotion.proto +257 -0
- package/dist/src/proto/paths.d.ts +8 -1
- package/dist/src/proto/paths.js +8 -1
- package/gen/calculation.ts +94 -0
- package/gen/common_post.ts +31 -0
- package/gen/coupon.ts +169 -0
- package/gen/post.ts +346 -0
- package/gen/post_category.ts +157 -0
- package/gen/post_comment.ts +99 -0
- package/gen/post_tag.ts +113 -0
- package/gen/post_version.ts +112 -0
- package/gen/promotion.ts +353 -0
- package/package.json +1 -1
- package/proto/calculation.proto +66 -0
- package/proto/common_post.proto +23 -0
- package/proto/common_promo.proto +6 -7
- package/proto/coupon.proto +121 -0
- package/proto/post.proto +193 -0
- package/proto/post_category.proto +84 -0
- package/proto/post_comment.proto +66 -0
- package/proto/post_tag.proto +57 -0
- package/proto/post_version.proto +61 -0
- package/proto/promotion.proto +257 -0
- package/dist/gen/promo.d.ts +0 -293
- package/dist/gen/promo.js +0 -73
- package/dist/proto/promo.proto +0 -238
- package/gen/promo.ts +0 -390
- package/proto/promo.proto +0 -238
package/proto/post.proto
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package content.v1;
|
|
4
|
+
|
|
5
|
+
import "common_post.proto";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service PostService {
|
|
9
|
+
|
|
10
|
+
rpc GetPosts (GetPostsRequest) returns (GetPostsResponse);
|
|
11
|
+
rpc GetPost (GetPostRequest) returns (PostResponse);
|
|
12
|
+
rpc CreatePost (CreatePostRequest) returns (PostResponse);
|
|
13
|
+
rpc UpdatePost (UpdatePostRequest) returns (PostResponse);
|
|
14
|
+
rpc DeletePost (DeletePostRequest) returns (DeleteResponse);
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
rpc PublishPost (PostIdRequest) returns (PostResponse);
|
|
18
|
+
rpc SchedulePost (SchedulePostRequest) returns (PostResponse);
|
|
19
|
+
rpc ArchivePost (PostIdRequest) returns (PostResponse);
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
rpc IncrementViews (PostIdRequest) returns (SuccessResponse);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
enum PostType {
|
|
27
|
+
POST_TYPE_UNSPECIFIED = 0;
|
|
28
|
+
POST_TYPE_ARTICLE = 1;
|
|
29
|
+
POST_TYPE_NEWS = 2;
|
|
30
|
+
POST_TYPE_PAGE = 3;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
enum PostStatus {
|
|
34
|
+
POST_STATUS_UNSPECIFIED = 0;
|
|
35
|
+
POST_STATUS_DRAFT = 1;
|
|
36
|
+
POST_STATUS_SCHEDULED = 2;
|
|
37
|
+
POST_STATUS_PUBLISHED = 3;
|
|
38
|
+
POST_STATUS_ARCHIVED = 4;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message PostResponse {
|
|
42
|
+
string id = 1;
|
|
43
|
+
string slug = 2;
|
|
44
|
+
PostType type = 3;
|
|
45
|
+
PostStatus status = 4;
|
|
46
|
+
|
|
47
|
+
map<string, string> title = 5;
|
|
48
|
+
map<string, string> excerpt = 6;
|
|
49
|
+
map<string, string> content = 7;
|
|
50
|
+
|
|
51
|
+
optional string cover_image = 8;
|
|
52
|
+
optional string cover_image_id = 9;
|
|
53
|
+
|
|
54
|
+
optional string published_at = 10;
|
|
55
|
+
int32 read_time = 11;
|
|
56
|
+
int32 views_count = 12;
|
|
57
|
+
int32 comments_count = 13;
|
|
58
|
+
|
|
59
|
+
map<string, string> seo_title = 14;
|
|
60
|
+
map<string, string> seo_description = 15;
|
|
61
|
+
map<string, string> seo_keywords = 16;
|
|
62
|
+
map<string, string> seo_h1 = 17;
|
|
63
|
+
|
|
64
|
+
string created_by_id = 18;
|
|
65
|
+
string created_at = 19;
|
|
66
|
+
string updated_at = 20;
|
|
67
|
+
|
|
68
|
+
repeated PostCategoryItem categories = 21;
|
|
69
|
+
repeated PostTagItem tags = 22;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
message PostCategoryItem {
|
|
74
|
+
string id = 1;
|
|
75
|
+
string slug = 2;
|
|
76
|
+
map<string, string> name = 3;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message PostTagItem {
|
|
80
|
+
string id = 1;
|
|
81
|
+
string slug = 2;
|
|
82
|
+
map<string, string> name = 3;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
message PostListItem {
|
|
87
|
+
string id = 1;
|
|
88
|
+
string slug = 2;
|
|
89
|
+
PostType type = 3;
|
|
90
|
+
PostStatus status = 4;
|
|
91
|
+
|
|
92
|
+
map<string, string> title = 5;
|
|
93
|
+
map<string, string> excerpt = 6;
|
|
94
|
+
|
|
95
|
+
optional string cover_image = 7;
|
|
96
|
+
optional string published_at = 8;
|
|
97
|
+
int32 read_time = 9;
|
|
98
|
+
int32 views_count = 10;
|
|
99
|
+
int32 comments_count = 11;
|
|
100
|
+
|
|
101
|
+
repeated PostCategoryItem categories = 12;
|
|
102
|
+
repeated PostTagItem tags = 13;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
message GetPostsRequest {
|
|
107
|
+
PaginationRequest pagination = 1;
|
|
108
|
+
|
|
109
|
+
optional PostType type = 2;
|
|
110
|
+
optional PostStatus status = 3;
|
|
111
|
+
optional string search = 4;
|
|
112
|
+
optional string category_id = 5;
|
|
113
|
+
optional string tag_id = 6;
|
|
114
|
+
optional string date_from = 7;
|
|
115
|
+
optional string date_to = 8;
|
|
116
|
+
optional string sort_by = 9;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message GetPostsResponse {
|
|
120
|
+
repeated PostListItem items = 1;
|
|
121
|
+
PaginationMeta meta = 2;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
message GetPostRequest {
|
|
126
|
+
string id = 1;
|
|
127
|
+
optional string slug = 2;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
message CreatePostRequest {
|
|
132
|
+
PostType type = 1;
|
|
133
|
+
|
|
134
|
+
optional string slug = 2;
|
|
135
|
+
|
|
136
|
+
map<string, string> title = 3;
|
|
137
|
+
map<string, string> excerpt = 4;
|
|
138
|
+
map<string, string> content = 5;
|
|
139
|
+
|
|
140
|
+
optional string cover_image = 6;
|
|
141
|
+
optional string cover_image_id = 7;
|
|
142
|
+
|
|
143
|
+
map<string, string> seo_title = 8;
|
|
144
|
+
map<string, string> seo_description = 9;
|
|
145
|
+
map<string, string> seo_keywords = 10;
|
|
146
|
+
map<string, string> seo_h1 = 11;
|
|
147
|
+
|
|
148
|
+
repeated string category_ids = 12;
|
|
149
|
+
repeated string tag_ids = 13;
|
|
150
|
+
|
|
151
|
+
string created_by_id = 14;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
message UpdatePostRequest {
|
|
156
|
+
string id = 1;
|
|
157
|
+
|
|
158
|
+
optional string slug = 2;
|
|
159
|
+
|
|
160
|
+
map<string, string> title = 3;
|
|
161
|
+
map<string, string> excerpt = 4;
|
|
162
|
+
map<string, string> content = 5;
|
|
163
|
+
|
|
164
|
+
optional string cover_image = 6;
|
|
165
|
+
optional string cover_image_id = 7;
|
|
166
|
+
|
|
167
|
+
map<string, string> seo_title = 8;
|
|
168
|
+
map<string, string> seo_description = 9;
|
|
169
|
+
map<string, string> seo_keywords = 10;
|
|
170
|
+
map<string, string> seo_h1 = 11;
|
|
171
|
+
|
|
172
|
+
repeated string category_ids = 12;
|
|
173
|
+
repeated string tag_ids = 13;
|
|
174
|
+
|
|
175
|
+
string updated_by_id = 14;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
message DeletePostRequest {
|
|
180
|
+
string id = 1;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
message PostIdRequest {
|
|
185
|
+
string id = 1;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
message SchedulePostRequest {
|
|
190
|
+
string id = 1;
|
|
191
|
+
string publish_at = 2;
|
|
192
|
+
string updated_by_id = 3;
|
|
193
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package content.v1;
|
|
4
|
+
|
|
5
|
+
import "common_post.proto";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service PostCategoryService {
|
|
9
|
+
rpc GetPostCategories (GetPostCategoriesRequest) returns (GetPostCategoriesResponse);
|
|
10
|
+
rpc GetPostCategory (GetPostCategoryRequest) returns (PostCategoryResponse);
|
|
11
|
+
rpc CreatePostCategory (CreatePostCategoryRequest) returns (PostCategoryResponse);
|
|
12
|
+
rpc UpdatePostCategory (UpdatePostCategoryRequest) returns (PostCategoryResponse);
|
|
13
|
+
rpc DeletePostCategory (DeletePostCategoryRequest) returns (DeleteResponse);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
enum PostCategoryType {
|
|
18
|
+
POST_CATEGORY_TYPE_UNSPECIFIED = 0;
|
|
19
|
+
POST_CATEGORY_TYPE_ARTICLE = 1;
|
|
20
|
+
POST_CATEGORY_TYPE_NEWS = 2;
|
|
21
|
+
POST_CATEGORY_TYPE_PAGE = 3;
|
|
22
|
+
POST_CATEGORY_TYPE_ALL = 4;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
message PostCategoryResponse {
|
|
27
|
+
string id = 1;
|
|
28
|
+
string slug = 2;
|
|
29
|
+
|
|
30
|
+
map<string, string> name = 3;
|
|
31
|
+
map<string, string> description = 4;
|
|
32
|
+
|
|
33
|
+
int32 sort_order = 5;
|
|
34
|
+
PostCategoryType post_type = 6;
|
|
35
|
+
|
|
36
|
+
string created_at = 7;
|
|
37
|
+
string updated_at = 8;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
message GetPostCategoriesRequest {
|
|
42
|
+
PaginationRequest pagination = 1;
|
|
43
|
+
optional PostCategoryType post_type = 2;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message GetPostCategoriesResponse {
|
|
47
|
+
repeated PostCategoryResponse items = 1;
|
|
48
|
+
PaginationMeta meta = 2;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
message GetPostCategoryRequest {
|
|
53
|
+
string id = 1;
|
|
54
|
+
optional string slug = 2;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
message CreatePostCategoryRequest {
|
|
59
|
+
string slug = 1;
|
|
60
|
+
|
|
61
|
+
map<string, string> name = 2;
|
|
62
|
+
map<string, string> description = 3;
|
|
63
|
+
|
|
64
|
+
int32 sort_order = 4;
|
|
65
|
+
PostCategoryType post_type = 5;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
message UpdatePostCategoryRequest {
|
|
70
|
+
string id = 1;
|
|
71
|
+
|
|
72
|
+
optional string slug = 2;
|
|
73
|
+
|
|
74
|
+
map<string, string> name = 3;
|
|
75
|
+
map<string, string> description = 4;
|
|
76
|
+
|
|
77
|
+
optional int32 sort_order = 5;
|
|
78
|
+
optional PostCategoryType post_type = 6;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
message DeletePostCategoryRequest {
|
|
83
|
+
string id = 1;
|
|
84
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package content.v1;
|
|
4
|
+
|
|
5
|
+
import "common_post.proto";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service PostCommentService {
|
|
9
|
+
|
|
10
|
+
rpc GetComments (GetCommentsRequest) returns (GetCommentsResponse);
|
|
11
|
+
|
|
12
|
+
rpc CreateComment (CreateCommentRequest) returns (CommentResponse);
|
|
13
|
+
|
|
14
|
+
rpc ApproveComment (CommentIdRequest) returns (CommentResponse);
|
|
15
|
+
rpc RejectComment (CommentIdRequest) returns (CommentResponse);
|
|
16
|
+
rpc DeleteComment (CommentIdRequest) returns (DeleteResponse);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
enum CommentStatus {
|
|
21
|
+
COMMENT_STATUS_UNSPECIFIED = 0;
|
|
22
|
+
COMMENT_STATUS_PENDING = 1;
|
|
23
|
+
COMMENT_STATUS_APPROVED = 2;
|
|
24
|
+
COMMENT_STATUS_REJECTED = 3;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
message CommentResponse {
|
|
29
|
+
string id = 1;
|
|
30
|
+
string post_id = 2;
|
|
31
|
+
|
|
32
|
+
string author_name = 3;
|
|
33
|
+
string author_email = 4;
|
|
34
|
+
string body = 5;
|
|
35
|
+
|
|
36
|
+
CommentStatus status = 6;
|
|
37
|
+
|
|
38
|
+
string created_at = 7;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
message GetCommentsRequest {
|
|
43
|
+
PaginationRequest pagination = 1;
|
|
44
|
+
|
|
45
|
+
optional string post_id = 2;
|
|
46
|
+
optional CommentStatus status = 3;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message GetCommentsResponse {
|
|
50
|
+
repeated CommentResponse items = 1;
|
|
51
|
+
PaginationMeta meta = 2;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
message CreateCommentRequest {
|
|
56
|
+
string post_id = 1;
|
|
57
|
+
|
|
58
|
+
string author_name = 2;
|
|
59
|
+
string author_email = 3;
|
|
60
|
+
string body = 4;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
message CommentIdRequest {
|
|
65
|
+
string id = 1;
|
|
66
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package content.v1;
|
|
4
|
+
|
|
5
|
+
import "common_post.proto";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service PostTagService {
|
|
9
|
+
rpc GetPostTags (GetPostTagsRequest) returns (GetPostTagsResponse);
|
|
10
|
+
rpc GetPostTag (GetPostTagRequest) returns (PostTagResponse);
|
|
11
|
+
rpc CreatePostTag (CreatePostTagRequest) returns (PostTagResponse);
|
|
12
|
+
rpc UpdatePostTag (UpdatePostTagRequest) returns (PostTagResponse);
|
|
13
|
+
rpc DeletePostTag (DeletePostTagRequest) returns (DeleteResponse);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
message PostTagResponse {
|
|
18
|
+
string id = 1;
|
|
19
|
+
string slug = 2;
|
|
20
|
+
map<string, string> name = 3;
|
|
21
|
+
string created_at = 4;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
message GetPostTagsRequest {
|
|
26
|
+
PaginationRequest pagination = 1;
|
|
27
|
+
optional string search = 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message GetPostTagsResponse {
|
|
31
|
+
repeated PostTagResponse items = 1;
|
|
32
|
+
PaginationMeta meta = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
message GetPostTagRequest {
|
|
37
|
+
string id = 1;
|
|
38
|
+
optional string slug = 2;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
message CreatePostTagRequest {
|
|
43
|
+
string slug = 1;
|
|
44
|
+
map<string, string> name = 2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
message UpdatePostTagRequest {
|
|
49
|
+
string id = 1;
|
|
50
|
+
optional string slug = 2;
|
|
51
|
+
map<string, string> name = 3;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
message DeletePostTagRequest {
|
|
56
|
+
string id = 1;
|
|
57
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package content.v1;
|
|
4
|
+
|
|
5
|
+
import "common_post.proto";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service PostVersionService {
|
|
9
|
+
|
|
10
|
+
rpc GetPostVersions (GetPostVersionsRequest) returns (GetPostVersionsResponse);
|
|
11
|
+
|
|
12
|
+
rpc GetPostVersion (GetPostVersionRequest) returns (PostVersionResponse);
|
|
13
|
+
|
|
14
|
+
rpc RestorePostVersion (RestorePostVersionRequest) returns (SuccessResponse);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
message PostVersionResponse {
|
|
19
|
+
string id = 1;
|
|
20
|
+
string post_id = 2;
|
|
21
|
+
|
|
22
|
+
map<string, string> title = 3;
|
|
23
|
+
map<string, string> excerpt = 4;
|
|
24
|
+
map<string, string> content = 5;
|
|
25
|
+
|
|
26
|
+
int32 version = 6;
|
|
27
|
+
string saved_by_id = 7;
|
|
28
|
+
string created_at = 8;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
message PostVersionListItem {
|
|
33
|
+
string id = 1;
|
|
34
|
+
string post_id = 2;
|
|
35
|
+
int32 version = 3;
|
|
36
|
+
string saved_by_id = 4;
|
|
37
|
+
string created_at = 5;
|
|
38
|
+
map<string, string> title = 6;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
message GetPostVersionsRequest {
|
|
43
|
+
string post_id = 1;
|
|
44
|
+
PaginationRequest pagination = 2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message GetPostVersionsResponse {
|
|
48
|
+
repeated PostVersionListItem items = 1;
|
|
49
|
+
PaginationMeta meta = 2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
message GetPostVersionRequest {
|
|
54
|
+
string id = 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
message RestorePostVersionRequest {
|
|
59
|
+
string version_id = 1;
|
|
60
|
+
string restored_by_id = 2;
|
|
61
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package promo.v1;
|
|
4
|
+
|
|
5
|
+
import "common_promo.proto";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service PromotionService {
|
|
9
|
+
|
|
10
|
+
rpc GetPromotions (GetPromotionsRequest) returns (GetPromotionsResponse);
|
|
11
|
+
rpc GetPromotion (GetPromotionRequest) returns (PromotionResponse);
|
|
12
|
+
rpc CreatePromotion (CreatePromotionRequest) returns (PromotionResponse);
|
|
13
|
+
rpc UpdatePromotion (UpdatePromotionRequest) returns (PromotionResponse);
|
|
14
|
+
rpc DeletePromotion (DeletePromotionRequest) returns (DeleteResponse);
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
rpc BulkApplyToCategories (BulkApplyToCategoriesRequest) returns (SuccessResponse);
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
rpc GetActivePromotions (GetActivePromotionsRequest) returns (GetActivePromotionsResponse);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
enum PromotionType {
|
|
25
|
+
PROMOTION_TYPE_UNSPECIFIED = 0;
|
|
26
|
+
PROMOTION_TYPE_FIXED = 1;
|
|
27
|
+
PROMOTION_TYPE_PERCENTAGE = 2;
|
|
28
|
+
PROMOTION_TYPE_COUPON = 3;
|
|
29
|
+
PROMOTION_TYPE_BUY_N_GET_M = 4;
|
|
30
|
+
PROMOTION_TYPE_FIRST_ORDER = 5;
|
|
31
|
+
PROMOTION_TYPE_LOYALTY = 6;
|
|
32
|
+
PROMOTION_TYPE_PROMO_PERIOD = 7;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
enum DiscountType {
|
|
36
|
+
DISCOUNT_TYPE_UNSPECIFIED = 0;
|
|
37
|
+
DISCOUNT_TYPE_FIXED = 1;
|
|
38
|
+
DISCOUNT_TYPE_PERCENTAGE = 2;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
enum PromotionStatus {
|
|
42
|
+
PROMOTION_STATUS_UNSPECIFIED = 0;
|
|
43
|
+
PROMOTION_STATUS_DRAFT = 1;
|
|
44
|
+
PROMOTION_STATUS_ACTIVE = 2;
|
|
45
|
+
PROMOTION_STATUS_INACTIVE = 3;
|
|
46
|
+
PROMOTION_STATUS_EXPIRED = 4;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
enum ConditionLogic {
|
|
50
|
+
CONDITION_LOGIC_UNSPECIFIED = 0;
|
|
51
|
+
CONDITION_LOGIC_AND = 1;
|
|
52
|
+
CONDITION_LOGIC_OR = 2;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
enum ConditionType {
|
|
56
|
+
CONDITION_TYPE_UNSPECIFIED = 0;
|
|
57
|
+
CONDITION_TYPE_PRODUCT = 1;
|
|
58
|
+
CONDITION_TYPE_CATEGORY = 2;
|
|
59
|
+
CONDITION_TYPE_BRAND = 3;
|
|
60
|
+
CONDITION_TYPE_USER_GROUP = 4;
|
|
61
|
+
CONDITION_TYPE_FIRST_ORDER = 5;
|
|
62
|
+
CONDITION_TYPE_MIN_ORDER_COUNT = 6;
|
|
63
|
+
CONDITION_TYPE_MIN_AMOUNT = 7;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
enum ExclusionEntityType {
|
|
67
|
+
EXCLUSION_ENTITY_UNSPECIFIED = 0;
|
|
68
|
+
EXCLUSION_ENTITY_PRODUCT = 1;
|
|
69
|
+
EXCLUSION_ENTITY_CATEGORY = 2;
|
|
70
|
+
EXCLUSION_ENTITY_BRAND = 3;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
message PromotionConditionPayload {
|
|
75
|
+
ConditionLogic logic_type = 1;
|
|
76
|
+
ConditionType condition_type = 2;
|
|
77
|
+
string value = 3;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message PromotionExclusionPayload {
|
|
81
|
+
ExclusionEntityType entity_type = 1;
|
|
82
|
+
string entity_id = 2;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message PromotionConditionResponse {
|
|
86
|
+
string id = 1;
|
|
87
|
+
ConditionLogic logic_type = 2;
|
|
88
|
+
ConditionType condition_type = 3;
|
|
89
|
+
string value = 4;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message PromotionExclusionResponse {
|
|
93
|
+
string id = 1;
|
|
94
|
+
ExclusionEntityType entity_type = 2;
|
|
95
|
+
string entity_id = 3;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
message PromotionResponse {
|
|
100
|
+
string id = 1;
|
|
101
|
+
map<string, string> name = 2;
|
|
102
|
+
map<string, string> description = 3;
|
|
103
|
+
|
|
104
|
+
PromotionType type = 4;
|
|
105
|
+
DiscountType discount_type = 5;
|
|
106
|
+
PromotionStatus status = 6;
|
|
107
|
+
|
|
108
|
+
double discount_value = 7;
|
|
109
|
+
|
|
110
|
+
optional string starts_at = 8;
|
|
111
|
+
optional string ends_at = 9;
|
|
112
|
+
|
|
113
|
+
optional double min_order_amount = 10;
|
|
114
|
+
optional int32 usage_limit_total = 11;
|
|
115
|
+
optional int32 usage_limit_per_user = 12;
|
|
116
|
+
int32 usage_count = 13;
|
|
117
|
+
|
|
118
|
+
bool is_active = 14;
|
|
119
|
+
bool is_exclusive = 15;
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
optional int32 buy_quantity = 16;
|
|
123
|
+
optional int32 get_quantity = 17;
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
optional string seo_slug = 18;
|
|
127
|
+
map<string, string> seo_title = 19;
|
|
128
|
+
map<string, string> seo_description = 20;
|
|
129
|
+
|
|
130
|
+
string created_by_id = 21;
|
|
131
|
+
string created_at = 22;
|
|
132
|
+
string updated_at = 23;
|
|
133
|
+
|
|
134
|
+
repeated PromotionConditionResponse conditions = 24;
|
|
135
|
+
repeated PromotionExclusionResponse exclusions = 25;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
message GetPromotionsRequest {
|
|
140
|
+
PaginationRequest pagination = 1;
|
|
141
|
+
|
|
142
|
+
optional PromotionType type = 2;
|
|
143
|
+
optional PromotionStatus status = 3;
|
|
144
|
+
optional string search = 4;
|
|
145
|
+
optional string category_id = 5;
|
|
146
|
+
optional string date_from = 6;
|
|
147
|
+
optional string date_to = 7;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
message GetPromotionsResponse {
|
|
151
|
+
repeated PromotionListItem items = 1;
|
|
152
|
+
PaginationMeta meta = 2;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
message PromotionListItem {
|
|
156
|
+
string id = 1;
|
|
157
|
+
map<string, string> name = 2;
|
|
158
|
+
PromotionType type = 3;
|
|
159
|
+
PromotionStatus status = 4;
|
|
160
|
+
optional string starts_at = 5;
|
|
161
|
+
optional string ends_at = 6;
|
|
162
|
+
int32 usage_count = 7;
|
|
163
|
+
bool is_active = 8;
|
|
164
|
+
string created_at = 9;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
message GetPromotionRequest {
|
|
169
|
+
string id = 1;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
message CreatePromotionRequest {
|
|
174
|
+
map<string, string> name = 1;
|
|
175
|
+
map<string, string> description = 2;
|
|
176
|
+
|
|
177
|
+
PromotionType type = 3;
|
|
178
|
+
DiscountType discount_type = 4;
|
|
179
|
+
double discount_value = 5;
|
|
180
|
+
|
|
181
|
+
optional string starts_at = 6;
|
|
182
|
+
optional string ends_at = 7;
|
|
183
|
+
|
|
184
|
+
optional double min_order_amount = 8;
|
|
185
|
+
optional int32 usage_limit_total = 9;
|
|
186
|
+
optional int32 usage_limit_per_user = 10;
|
|
187
|
+
|
|
188
|
+
bool is_active = 11;
|
|
189
|
+
bool is_exclusive = 12;
|
|
190
|
+
|
|
191
|
+
optional int32 buy_quantity = 13;
|
|
192
|
+
optional int32 get_quantity = 14;
|
|
193
|
+
|
|
194
|
+
optional string seo_slug = 15;
|
|
195
|
+
map<string, string> seo_title = 16;
|
|
196
|
+
map<string, string> seo_description = 17;
|
|
197
|
+
|
|
198
|
+
string created_by_id = 18;
|
|
199
|
+
|
|
200
|
+
repeated PromotionConditionPayload conditions = 19;
|
|
201
|
+
repeated PromotionExclusionPayload exclusions = 20;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
message UpdatePromotionRequest {
|
|
206
|
+
string id = 1;
|
|
207
|
+
|
|
208
|
+
map<string, string> name = 2;
|
|
209
|
+
map<string, string> description = 3;
|
|
210
|
+
|
|
211
|
+
optional PromotionType type = 4;
|
|
212
|
+
optional DiscountType discount_type = 5;
|
|
213
|
+
optional double discount_value = 6;
|
|
214
|
+
|
|
215
|
+
optional string starts_at = 7;
|
|
216
|
+
optional string ends_at = 8;
|
|
217
|
+
|
|
218
|
+
optional double min_order_amount = 9;
|
|
219
|
+
optional int32 usage_limit_total = 10;
|
|
220
|
+
optional int32 usage_limit_per_user = 11;
|
|
221
|
+
|
|
222
|
+
optional bool is_active = 12;
|
|
223
|
+
optional bool is_exclusive = 13;
|
|
224
|
+
|
|
225
|
+
optional int32 buy_quantity = 14;
|
|
226
|
+
optional int32 get_quantity = 15;
|
|
227
|
+
|
|
228
|
+
optional string seo_slug = 16;
|
|
229
|
+
map<string, string> seo_title = 17;
|
|
230
|
+
map<string, string> seo_description = 18;
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
repeated PromotionConditionPayload conditions = 19;
|
|
234
|
+
repeated PromotionExclusionPayload exclusions = 20;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
message DeletePromotionRequest {
|
|
239
|
+
string id = 1;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
message BulkApplyToCategoriesRequest {
|
|
244
|
+
string promotion_id = 1;
|
|
245
|
+
repeated string category_ids = 2;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
message GetActivePromotionsRequest {
|
|
250
|
+
PaginationRequest pagination = 1;
|
|
251
|
+
optional string lang = 2;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
message GetActivePromotionsResponse {
|
|
255
|
+
repeated PromotionListItem items = 1;
|
|
256
|
+
PaginationMeta meta = 2;
|
|
257
|
+
}
|