@mamindom/contracts 1.0.50 → 1.0.51

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/proto/promo.proto DELETED
@@ -1,238 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package promo.v1;
4
-
5
-
6
- import "common_promo.proto";
7
-
8
- service PublicPromoService {
9
-
10
- rpc GetProductsDiscounts (GetProductsDiscountsRequest) returns (GetProductsDiscountsResponse);
11
-
12
-
13
- rpc ValidateAndCalculate (ValidateAndCalculateRequest) returns (ValidateAndCalculateResponse);
14
- }
15
-
16
- service AdminPromoService {
17
-
18
- rpc GetPromotions (GetPromotionsRequest) returns (GetPromotionsResponse);
19
- rpc GetPromotion (GetPromotionRequest) returns (PromotionResponse);
20
- rpc CreatePromotion (CreatePromotionRequest) returns (PromotionResponse);
21
- rpc UpdatePromotion (UpdatePromotionRequest) returns (PromotionResponse);
22
- rpc DeletePromotion (DeletePromotionRequest) returns (DeleteResponse);
23
-
24
-
25
- rpc GenerateCouponsBatch (GenerateCouponsBatchRequest) returns (GenerateCouponsBatchResponse);
26
- rpc ExportCouponsCSV (ExportCouponsCSVRequest) returns (ExportCouponsCSVResponse);
27
-
28
-
29
- rpc GetPromotionAnalytics (GetPromotionAnalyticsRequest) returns (PromotionAnalyticsResponse);
30
- }
31
-
32
-
33
- message ProductContextItem {
34
- string product_id = 1;
35
- string category_id = 2;
36
- string brand_id = 3;
37
- double base_price = 4;
38
- }
39
-
40
- message GetProductsDiscountsRequest {
41
- repeated ProductContextItem items = 1;
42
- }
43
-
44
- message DiscountedProductItem {
45
- string product_id = 1;
46
- double original_price = 2;
47
- double discounted_price = 3;
48
- string applied_promotion_id = 4;
49
- }
50
-
51
- message GetProductsDiscountsResponse {
52
- repeated DiscountedProductItem items = 1;
53
- }
54
-
55
-
56
- message CartItem {
57
- string product_id = 1;
58
- string category_id = 2;
59
- string brand_id = 3;
60
- double price = 4;
61
- int32 quantity = 5;
62
- }
63
-
64
- message ValidateAndCalculateRequest {
65
- string user_id = 1;
66
- repeated CartItem items = 2;
67
- optional string promo_code = 3;
68
- bool is_first_purchase = 4;
69
- }
70
-
71
- message AppliedDiscount {
72
- string promotion_id = 1;
73
- string title = 2;
74
- double discount_amount = 3;
75
- }
76
-
77
- message ValidateAndCalculateResponse {
78
- double original_total = 1;
79
- double final_total = 2;
80
- double total_discount = 3;
81
- repeated AppliedDiscount applied_discounts = 4;
82
- bool is_coupon_valid = 5;
83
- optional string coupon_error_message = 6;
84
- }
85
-
86
-
87
- message PromotionResponse {
88
- string id = 1;
89
- PromotionType type = 2;
90
- PromotionStatus status = 3;
91
-
92
- map<string, string> title = 4;
93
- map<string, string> description = 5;
94
- map<string, string> meta_title = 6;
95
- map<string, string> meta_description = 7;
96
- map<string, string> meta_keywords = 8;
97
-
98
- optional string image = 9;
99
- optional string image_id = 10;
100
-
101
- optional double discount_value = 11;
102
- optional string start_date = 12;
103
- optional string end_date = 13;
104
- double min_order_amount = 14;
105
-
106
- bool is_combinable = 15;
107
- bool is_active = 16;
108
-
109
- string conditions = 17;
110
-
111
- string created_at = 18;
112
- string updated_at = 19;
113
- }
114
-
115
-
116
- message GetPromotionsRequest {
117
- PaginationRequest pagination = 1;
118
- optional PromotionType type = 2;
119
- optional PromotionStatus status = 3;
120
- optional string search = 4;
121
- }
122
-
123
- message GetPromotionsResponse {
124
- repeated PromotionResponse items = 1;
125
- PaginationMeta meta = 2;
126
- }
127
-
128
- message GetPromotionRequest {
129
- string id = 1;
130
- }
131
-
132
- message CreatePromotionRequest {
133
- PromotionType type = 1;
134
- PromotionStatus status = 2;
135
-
136
- map<string, string> title = 3;
137
- map<string, string> description = 4;
138
- map<string, string> meta_title = 5;
139
- map<string, string> meta_description = 6;
140
- map<string, string> meta_keywords = 7;
141
-
142
- optional string image = 8;
143
- optional string image_id = 9;
144
-
145
- optional double discount_value = 10;
146
- optional string start_date = 11;
147
- optional string end_date = 12;
148
- optional double min_order_amount = 13;
149
-
150
- bool is_combinable = 14;
151
- bool is_active = 15;
152
- string conditions = 16;
153
- }
154
-
155
- message UpdatePromotionRequest {
156
- string id = 1;
157
- optional PromotionType type = 2;
158
- optional PromotionStatus status = 3;
159
-
160
- map<string, string> title = 4;
161
- map<string, string> description = 5;
162
- map<string, string> meta_title = 6;
163
- map<string, string> meta_description = 7;
164
- map<string, string> meta_keywords = 8;
165
-
166
- optional string image = 9;
167
- optional string image_id = 10;
168
-
169
- optional double discount_value = 11;
170
- optional string start_date = 12;
171
- optional string end_date = 13;
172
- optional double min_order_amount = 14;
173
-
174
- optional bool is_combinable = 15;
175
- optional bool is_active = 16;
176
- optional string conditions = 17;
177
- }
178
-
179
- message DeletePromotionRequest {
180
- string id = 1;
181
- }
182
-
183
-
184
- message GenerateCouponsBatchRequest {
185
- string promotion_id = 1;
186
- string batch_name = 2;
187
- int32 count = 3;
188
- optional string prefix = 4;
189
- optional int32 global_usage_limit = 5;
190
- optional int32 per_user_usage_limit = 6;
191
- }
192
-
193
- message GenerateCouponsBatchResponse {
194
- string batch_id = 1;
195
- int32 generated_count = 2;
196
- bool success = 3;
197
- }
198
-
199
- message ExportCouponsCSVRequest {
200
- optional string promotion_id = 1;
201
- optional string batch_id = 2;
202
- }
203
-
204
- message ExportCouponsCSVResponse {
205
- string download_url = 1;
206
- }
207
-
208
-
209
- message GetPromotionAnalyticsRequest {
210
- string promotion_id = 1;
211
- }
212
-
213
- message PromotionAnalyticsResponse {
214
- string promotion_id = 1;
215
- int32 total_uses = 2;
216
- double total_discount_given = 3;
217
- double total_revenue = 4;
218
- double average_discount = 5;
219
- double conversion_rate = 6;
220
- }
221
-
222
- enum PromotionType {
223
- PROMOTION_TYPE_UNSPECIFIED = 0;
224
- PROMOTION_TYPE_FIXED = 1;
225
- PROMOTION_TYPE_PERCENTAGE = 2;
226
- PROMOTION_TYPE_COUPON = 3;
227
- PROMOTION_TYPE_N_PLUS_M = 4;
228
- PROMOTION_TYPE_FIRST_PURCHASE = 5;
229
- PROMOTION_TYPE_PROMO_PERIOD = 6;
230
- }
231
-
232
- enum PromotionStatus {
233
- PROMOTION_STATUS_UNSPECIFIED = 0;
234
- PROMOTION_STATUS_ACTIVE = 1;
235
- PROMOTION_STATUS_INACTIVE = 2;
236
- PROMOTION_STATUS_SCHEDULED = 3;
237
- PROMOTION_STATUS_ARCHIVED = 4;
238
- }