@mamindom/contracts 1.0.48 → 1.0.50

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/gen/promo.ts ADDED
@@ -0,0 +1,390 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v3.21.12
5
+ // source: promo.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { DeleteResponse, PaginationMeta, PaginationRequest } from "./common_promo";
11
+
12
+ export const protobufPackage = "promo.v1";
13
+
14
+ export enum PromotionType {
15
+ PROMOTION_TYPE_UNSPECIFIED = 0,
16
+ PROMOTION_TYPE_FIXED = 1,
17
+ PROMOTION_TYPE_PERCENTAGE = 2,
18
+ PROMOTION_TYPE_COUPON = 3,
19
+ PROMOTION_TYPE_N_PLUS_M = 4,
20
+ PROMOTION_TYPE_FIRST_PURCHASE = 5,
21
+ PROMOTION_TYPE_PROMO_PERIOD = 6,
22
+ UNRECOGNIZED = -1,
23
+ }
24
+
25
+ export enum PromotionStatus {
26
+ PROMOTION_STATUS_UNSPECIFIED = 0,
27
+ PROMOTION_STATUS_ACTIVE = 1,
28
+ PROMOTION_STATUS_INACTIVE = 2,
29
+ PROMOTION_STATUS_SCHEDULED = 3,
30
+ PROMOTION_STATUS_ARCHIVED = 4,
31
+ UNRECOGNIZED = -1,
32
+ }
33
+
34
+ export interface ProductContextItem {
35
+ productId: string;
36
+ categoryId: string;
37
+ brandId: string;
38
+ basePrice: number;
39
+ }
40
+
41
+ export interface GetProductsDiscountsRequest {
42
+ items: ProductContextItem[];
43
+ }
44
+
45
+ export interface DiscountedProductItem {
46
+ productId: string;
47
+ originalPrice: number;
48
+ discountedPrice: number;
49
+ appliedPromotionId: string;
50
+ }
51
+
52
+ export interface GetProductsDiscountsResponse {
53
+ items: DiscountedProductItem[];
54
+ }
55
+
56
+ export interface CartItem {
57
+ productId: string;
58
+ categoryId: string;
59
+ brandId: string;
60
+ price: number;
61
+ quantity: number;
62
+ }
63
+
64
+ export interface ValidateAndCalculateRequest {
65
+ userId: string;
66
+ items: CartItem[];
67
+ promoCode?: string | undefined;
68
+ isFirstPurchase: boolean;
69
+ }
70
+
71
+ export interface AppliedDiscount {
72
+ promotionId: string;
73
+ title: string;
74
+ discountAmount: number;
75
+ }
76
+
77
+ export interface ValidateAndCalculateResponse {
78
+ originalTotal: number;
79
+ finalTotal: number;
80
+ totalDiscount: number;
81
+ appliedDiscounts: AppliedDiscount[];
82
+ isCouponValid: boolean;
83
+ couponErrorMessage?: string | undefined;
84
+ }
85
+
86
+ export interface PromotionResponse {
87
+ id: string;
88
+ type: PromotionType;
89
+ status: PromotionStatus;
90
+ title: { [key: string]: string };
91
+ description: { [key: string]: string };
92
+ metaTitle: { [key: string]: string };
93
+ metaDescription: { [key: string]: string };
94
+ metaKeywords: { [key: string]: string };
95
+ image?: string | undefined;
96
+ imageId?: string | undefined;
97
+ discountValue?: number | undefined;
98
+ startDate?: string | undefined;
99
+ endDate?: string | undefined;
100
+ minOrderAmount: number;
101
+ isCombinable: boolean;
102
+ isActive: boolean;
103
+ conditions: string;
104
+ createdAt: string;
105
+ updatedAt: string;
106
+ }
107
+
108
+ export interface PromotionResponse_TitleEntry {
109
+ key: string;
110
+ value: string;
111
+ }
112
+
113
+ export interface PromotionResponse_DescriptionEntry {
114
+ key: string;
115
+ value: string;
116
+ }
117
+
118
+ export interface PromotionResponse_MetaTitleEntry {
119
+ key: string;
120
+ value: string;
121
+ }
122
+
123
+ export interface PromotionResponse_MetaDescriptionEntry {
124
+ key: string;
125
+ value: string;
126
+ }
127
+
128
+ export interface PromotionResponse_MetaKeywordsEntry {
129
+ key: string;
130
+ value: string;
131
+ }
132
+
133
+ export interface GetPromotionsRequest {
134
+ pagination: PaginationRequest | undefined;
135
+ type?: PromotionType | undefined;
136
+ status?: PromotionStatus | undefined;
137
+ search?: string | undefined;
138
+ }
139
+
140
+ export interface GetPromotionsResponse {
141
+ items: PromotionResponse[];
142
+ meta: PaginationMeta | undefined;
143
+ }
144
+
145
+ export interface GetPromotionRequest {
146
+ id: string;
147
+ }
148
+
149
+ export interface CreatePromotionRequest {
150
+ type: PromotionType;
151
+ status: PromotionStatus;
152
+ title: { [key: string]: string };
153
+ description: { [key: string]: string };
154
+ metaTitle: { [key: string]: string };
155
+ metaDescription: { [key: string]: string };
156
+ metaKeywords: { [key: string]: string };
157
+ image?: string | undefined;
158
+ imageId?: string | undefined;
159
+ discountValue?: number | undefined;
160
+ startDate?: string | undefined;
161
+ endDate?: string | undefined;
162
+ minOrderAmount?: number | undefined;
163
+ isCombinable: boolean;
164
+ isActive: boolean;
165
+ conditions: string;
166
+ }
167
+
168
+ export interface CreatePromotionRequest_TitleEntry {
169
+ key: string;
170
+ value: string;
171
+ }
172
+
173
+ export interface CreatePromotionRequest_DescriptionEntry {
174
+ key: string;
175
+ value: string;
176
+ }
177
+
178
+ export interface CreatePromotionRequest_MetaTitleEntry {
179
+ key: string;
180
+ value: string;
181
+ }
182
+
183
+ export interface CreatePromotionRequest_MetaDescriptionEntry {
184
+ key: string;
185
+ value: string;
186
+ }
187
+
188
+ export interface CreatePromotionRequest_MetaKeywordsEntry {
189
+ key: string;
190
+ value: string;
191
+ }
192
+
193
+ export interface UpdatePromotionRequest {
194
+ id: string;
195
+ type?: PromotionType | undefined;
196
+ status?: PromotionStatus | undefined;
197
+ title: { [key: string]: string };
198
+ description: { [key: string]: string };
199
+ metaTitle: { [key: string]: string };
200
+ metaDescription: { [key: string]: string };
201
+ metaKeywords: { [key: string]: string };
202
+ image?: string | undefined;
203
+ imageId?: string | undefined;
204
+ discountValue?: number | undefined;
205
+ startDate?: string | undefined;
206
+ endDate?: string | undefined;
207
+ minOrderAmount?: number | undefined;
208
+ isCombinable?: boolean | undefined;
209
+ isActive?: boolean | undefined;
210
+ conditions?: string | undefined;
211
+ }
212
+
213
+ export interface UpdatePromotionRequest_TitleEntry {
214
+ key: string;
215
+ value: string;
216
+ }
217
+
218
+ export interface UpdatePromotionRequest_DescriptionEntry {
219
+ key: string;
220
+ value: string;
221
+ }
222
+
223
+ export interface UpdatePromotionRequest_MetaTitleEntry {
224
+ key: string;
225
+ value: string;
226
+ }
227
+
228
+ export interface UpdatePromotionRequest_MetaDescriptionEntry {
229
+ key: string;
230
+ value: string;
231
+ }
232
+
233
+ export interface UpdatePromotionRequest_MetaKeywordsEntry {
234
+ key: string;
235
+ value: string;
236
+ }
237
+
238
+ export interface DeletePromotionRequest {
239
+ id: string;
240
+ }
241
+
242
+ export interface GenerateCouponsBatchRequest {
243
+ promotionId: string;
244
+ batchName: string;
245
+ count: number;
246
+ prefix?: string | undefined;
247
+ globalUsageLimit?: number | undefined;
248
+ perUserUsageLimit?: number | undefined;
249
+ }
250
+
251
+ export interface GenerateCouponsBatchResponse {
252
+ batchId: string;
253
+ generatedCount: number;
254
+ success: boolean;
255
+ }
256
+
257
+ export interface ExportCouponsCSVRequest {
258
+ promotionId?: string | undefined;
259
+ batchId?: string | undefined;
260
+ }
261
+
262
+ export interface ExportCouponsCSVResponse {
263
+ downloadUrl: string;
264
+ }
265
+
266
+ export interface GetPromotionAnalyticsRequest {
267
+ promotionId: string;
268
+ }
269
+
270
+ export interface PromotionAnalyticsResponse {
271
+ promotionId: string;
272
+ totalUses: number;
273
+ totalDiscountGiven: number;
274
+ totalRevenue: number;
275
+ averageDiscount: number;
276
+ conversionRate: number;
277
+ }
278
+
279
+ export const PROMO_V1_PACKAGE_NAME = "promo.v1";
280
+
281
+ export interface PublicPromoServiceClient {
282
+ getProductsDiscounts(request: GetProductsDiscountsRequest): Observable<GetProductsDiscountsResponse>;
283
+
284
+ validateAndCalculate(request: ValidateAndCalculateRequest): Observable<ValidateAndCalculateResponse>;
285
+ }
286
+
287
+ export interface PublicPromoServiceController {
288
+ getProductsDiscounts(
289
+ request: GetProductsDiscountsRequest,
290
+ ): Promise<GetProductsDiscountsResponse> | Observable<GetProductsDiscountsResponse> | GetProductsDiscountsResponse;
291
+
292
+ validateAndCalculate(
293
+ request: ValidateAndCalculateRequest,
294
+ ): Promise<ValidateAndCalculateResponse> | Observable<ValidateAndCalculateResponse> | ValidateAndCalculateResponse;
295
+ }
296
+
297
+ export function PublicPromoServiceControllerMethods() {
298
+ return function (constructor: Function) {
299
+ const grpcMethods: string[] = ["getProductsDiscounts", "validateAndCalculate"];
300
+ for (const method of grpcMethods) {
301
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
302
+ GrpcMethod("PublicPromoService", method)(constructor.prototype[method], method, descriptor);
303
+ }
304
+ const grpcStreamMethods: string[] = [];
305
+ for (const method of grpcStreamMethods) {
306
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
307
+ GrpcStreamMethod("PublicPromoService", method)(constructor.prototype[method], method, descriptor);
308
+ }
309
+ };
310
+ }
311
+
312
+ export const PUBLIC_PROMO_SERVICE_NAME = "PublicPromoService";
313
+
314
+ export interface AdminPromoServiceClient {
315
+ getPromotions(request: GetPromotionsRequest): Observable<GetPromotionsResponse>;
316
+
317
+ getPromotion(request: GetPromotionRequest): Observable<PromotionResponse>;
318
+
319
+ createPromotion(request: CreatePromotionRequest): Observable<PromotionResponse>;
320
+
321
+ updatePromotion(request: UpdatePromotionRequest): Observable<PromotionResponse>;
322
+
323
+ deletePromotion(request: DeletePromotionRequest): Observable<DeleteResponse>;
324
+
325
+ generateCouponsBatch(request: GenerateCouponsBatchRequest): Observable<GenerateCouponsBatchResponse>;
326
+
327
+ exportCouponsCsv(request: ExportCouponsCSVRequest): Observable<ExportCouponsCSVResponse>;
328
+
329
+ getPromotionAnalytics(request: GetPromotionAnalyticsRequest): Observable<PromotionAnalyticsResponse>;
330
+ }
331
+
332
+ export interface AdminPromoServiceController {
333
+ getPromotions(
334
+ request: GetPromotionsRequest,
335
+ ): Promise<GetPromotionsResponse> | Observable<GetPromotionsResponse> | GetPromotionsResponse;
336
+
337
+ getPromotion(
338
+ request: GetPromotionRequest,
339
+ ): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
340
+
341
+ createPromotion(
342
+ request: CreatePromotionRequest,
343
+ ): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
344
+
345
+ updatePromotion(
346
+ request: UpdatePromotionRequest,
347
+ ): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
348
+
349
+ deletePromotion(
350
+ request: DeletePromotionRequest,
351
+ ): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
352
+
353
+ generateCouponsBatch(
354
+ request: GenerateCouponsBatchRequest,
355
+ ): Promise<GenerateCouponsBatchResponse> | Observable<GenerateCouponsBatchResponse> | GenerateCouponsBatchResponse;
356
+
357
+ exportCouponsCsv(
358
+ request: ExportCouponsCSVRequest,
359
+ ): Promise<ExportCouponsCSVResponse> | Observable<ExportCouponsCSVResponse> | ExportCouponsCSVResponse;
360
+
361
+ getPromotionAnalytics(
362
+ request: GetPromotionAnalyticsRequest,
363
+ ): Promise<PromotionAnalyticsResponse> | Observable<PromotionAnalyticsResponse> | PromotionAnalyticsResponse;
364
+ }
365
+
366
+ export function AdminPromoServiceControllerMethods() {
367
+ return function (constructor: Function) {
368
+ const grpcMethods: string[] = [
369
+ "getPromotions",
370
+ "getPromotion",
371
+ "createPromotion",
372
+ "updatePromotion",
373
+ "deletePromotion",
374
+ "generateCouponsBatch",
375
+ "exportCouponsCsv",
376
+ "getPromotionAnalytics",
377
+ ];
378
+ for (const method of grpcMethods) {
379
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
380
+ GrpcMethod("AdminPromoService", method)(constructor.prototype[method], method, descriptor);
381
+ }
382
+ const grpcStreamMethods: string[] = [];
383
+ for (const method of grpcStreamMethods) {
384
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
385
+ GrpcStreamMethod("AdminPromoService", method)(constructor.prototype[method], method, descriptor);
386
+ }
387
+ };
388
+ }
389
+
390
+ export const ADMIN_PROMO_SERVICE_NAME = "AdminPromoService";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.48",
4
+ "version": "1.0.50",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -15,7 +15,7 @@ service AccountService {
15
15
  rpc AdminBlockAccount(AdminBlockAccountRequest) returns (AdminBlockAccountResponse);
16
16
  rpc AdminCreateAccount(AdminCreateAccountRequest) returns (AdminCreateAccountResponse);
17
17
 
18
- rpc AdminGetAllAccounts(AdminGetAllAccountsRequest) returns (AdminGetAllAccountsResponse);
18
+ rpc AdminGetAccounts(AdminGetAccountsRequest) returns (AdminGetAccountsResponse);
19
19
  }
20
20
 
21
21
  message GetAccountRequest {
@@ -116,29 +116,20 @@ message AdminCreateAccountResponse {
116
116
  string id = 1;
117
117
  }
118
118
 
119
- message AdminGetAllAccountsRequest {
120
- int32 page = 1;
121
- int32 limit = 2;
119
+
120
+
121
+ message AdminGetAccountsRequest {
122
+ optional int32 page = 1;
123
+ optional int32 limit = 2;
122
124
  optional string search = 3;
123
125
  optional Role role = 4;
126
+ optional bool is_blocked = 5;
127
+ optional string sort_by = 6;
124
128
  }
125
129
 
126
- message AdminAccountItem {
127
- string id = 1;
128
- string phone = 2;
129
- string email = 3;
130
- string first_name = 4;
131
- string last_name = 5;
132
- Role role = 6;
133
- bool is_blocked = 7;
134
- string created_at = 8;
135
- }
136
-
137
- message AdminGetAllAccountsResponse {
138
- repeated AdminAccountItem items = 1;
130
+ message AdminGetAccountsResponse {
131
+ repeated AdminGetAccountResponse items = 1;
139
132
  int32 total = 2;
140
- int32 page = 3;
141
- int32 limit = 4;
142
133
  }
143
134
 
144
135
 
@@ -0,0 +1,24 @@
1
+ syntax = "proto3";
2
+
3
+ package promo.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,238 @@
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
+ }