@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/dist/gen/calculation.d.ts +55 -0
- package/dist/gen/calculation.js +28 -0
- package/dist/gen/coupon.d.ts +96 -0
- package/dist/gen/coupon.js +37 -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_promo.proto +6 -7
- package/dist/proto/coupon.proto +121 -0
- package/dist/proto/promotion.proto +257 -0
- package/dist/src/proto/paths.d.ts +3 -1
- package/dist/src/proto/paths.js +3 -1
- package/gen/calculation.ts +94 -0
- package/gen/coupon.ts +169 -0
- package/gen/promotion.ts +353 -0
- package/package.json +1 -1
- package/proto/calculation.proto +66 -0
- package/proto/common_promo.proto +6 -7
- package/proto/coupon.proto +121 -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
|
@@ -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
|
+
}
|
package/dist/gen/promo.d.ts
DELETED
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { DeleteResponse, PaginationMeta, PaginationRequest } from "./common_promo";
|
|
3
|
-
export declare const protobufPackage = "promo.v1";
|
|
4
|
-
export declare enum PromotionType {
|
|
5
|
-
PROMOTION_TYPE_UNSPECIFIED = 0,
|
|
6
|
-
PROMOTION_TYPE_FIXED = 1,
|
|
7
|
-
PROMOTION_TYPE_PERCENTAGE = 2,
|
|
8
|
-
PROMOTION_TYPE_COUPON = 3,
|
|
9
|
-
PROMOTION_TYPE_N_PLUS_M = 4,
|
|
10
|
-
PROMOTION_TYPE_FIRST_PURCHASE = 5,
|
|
11
|
-
PROMOTION_TYPE_PROMO_PERIOD = 6,
|
|
12
|
-
UNRECOGNIZED = -1
|
|
13
|
-
}
|
|
14
|
-
export declare enum PromotionStatus {
|
|
15
|
-
PROMOTION_STATUS_UNSPECIFIED = 0,
|
|
16
|
-
PROMOTION_STATUS_ACTIVE = 1,
|
|
17
|
-
PROMOTION_STATUS_INACTIVE = 2,
|
|
18
|
-
PROMOTION_STATUS_SCHEDULED = 3,
|
|
19
|
-
PROMOTION_STATUS_ARCHIVED = 4,
|
|
20
|
-
UNRECOGNIZED = -1
|
|
21
|
-
}
|
|
22
|
-
export interface ProductContextItem {
|
|
23
|
-
productId: string;
|
|
24
|
-
categoryId: string;
|
|
25
|
-
brandId: string;
|
|
26
|
-
basePrice: number;
|
|
27
|
-
}
|
|
28
|
-
export interface GetProductsDiscountsRequest {
|
|
29
|
-
items: ProductContextItem[];
|
|
30
|
-
}
|
|
31
|
-
export interface DiscountedProductItem {
|
|
32
|
-
productId: string;
|
|
33
|
-
originalPrice: number;
|
|
34
|
-
discountedPrice: number;
|
|
35
|
-
appliedPromotionId: string;
|
|
36
|
-
}
|
|
37
|
-
export interface GetProductsDiscountsResponse {
|
|
38
|
-
items: DiscountedProductItem[];
|
|
39
|
-
}
|
|
40
|
-
export interface CartItem {
|
|
41
|
-
productId: string;
|
|
42
|
-
categoryId: string;
|
|
43
|
-
brandId: string;
|
|
44
|
-
price: number;
|
|
45
|
-
quantity: number;
|
|
46
|
-
}
|
|
47
|
-
export interface ValidateAndCalculateRequest {
|
|
48
|
-
userId: string;
|
|
49
|
-
items: CartItem[];
|
|
50
|
-
promoCode?: string | undefined;
|
|
51
|
-
isFirstPurchase: boolean;
|
|
52
|
-
}
|
|
53
|
-
export interface AppliedDiscount {
|
|
54
|
-
promotionId: string;
|
|
55
|
-
title: string;
|
|
56
|
-
discountAmount: number;
|
|
57
|
-
}
|
|
58
|
-
export interface ValidateAndCalculateResponse {
|
|
59
|
-
originalTotal: number;
|
|
60
|
-
finalTotal: number;
|
|
61
|
-
totalDiscount: number;
|
|
62
|
-
appliedDiscounts: AppliedDiscount[];
|
|
63
|
-
isCouponValid: boolean;
|
|
64
|
-
couponErrorMessage?: string | undefined;
|
|
65
|
-
}
|
|
66
|
-
export interface PromotionResponse {
|
|
67
|
-
id: string;
|
|
68
|
-
type: PromotionType;
|
|
69
|
-
status: PromotionStatus;
|
|
70
|
-
title: {
|
|
71
|
-
[key: string]: string;
|
|
72
|
-
};
|
|
73
|
-
description: {
|
|
74
|
-
[key: string]: string;
|
|
75
|
-
};
|
|
76
|
-
metaTitle: {
|
|
77
|
-
[key: string]: string;
|
|
78
|
-
};
|
|
79
|
-
metaDescription: {
|
|
80
|
-
[key: string]: string;
|
|
81
|
-
};
|
|
82
|
-
metaKeywords: {
|
|
83
|
-
[key: string]: string;
|
|
84
|
-
};
|
|
85
|
-
image?: string | undefined;
|
|
86
|
-
imageId?: string | undefined;
|
|
87
|
-
discountValue?: number | undefined;
|
|
88
|
-
startDate?: string | undefined;
|
|
89
|
-
endDate?: string | undefined;
|
|
90
|
-
minOrderAmount: number;
|
|
91
|
-
isCombinable: boolean;
|
|
92
|
-
isActive: boolean;
|
|
93
|
-
conditions: string;
|
|
94
|
-
createdAt: string;
|
|
95
|
-
updatedAt: string;
|
|
96
|
-
}
|
|
97
|
-
export interface PromotionResponse_TitleEntry {
|
|
98
|
-
key: string;
|
|
99
|
-
value: string;
|
|
100
|
-
}
|
|
101
|
-
export interface PromotionResponse_DescriptionEntry {
|
|
102
|
-
key: string;
|
|
103
|
-
value: string;
|
|
104
|
-
}
|
|
105
|
-
export interface PromotionResponse_MetaTitleEntry {
|
|
106
|
-
key: string;
|
|
107
|
-
value: string;
|
|
108
|
-
}
|
|
109
|
-
export interface PromotionResponse_MetaDescriptionEntry {
|
|
110
|
-
key: string;
|
|
111
|
-
value: string;
|
|
112
|
-
}
|
|
113
|
-
export interface PromotionResponse_MetaKeywordsEntry {
|
|
114
|
-
key: string;
|
|
115
|
-
value: string;
|
|
116
|
-
}
|
|
117
|
-
export interface GetPromotionsRequest {
|
|
118
|
-
pagination: PaginationRequest | undefined;
|
|
119
|
-
type?: PromotionType | undefined;
|
|
120
|
-
status?: PromotionStatus | undefined;
|
|
121
|
-
search?: string | undefined;
|
|
122
|
-
}
|
|
123
|
-
export interface GetPromotionsResponse {
|
|
124
|
-
items: PromotionResponse[];
|
|
125
|
-
meta: PaginationMeta | undefined;
|
|
126
|
-
}
|
|
127
|
-
export interface GetPromotionRequest {
|
|
128
|
-
id: string;
|
|
129
|
-
}
|
|
130
|
-
export interface CreatePromotionRequest {
|
|
131
|
-
type: PromotionType;
|
|
132
|
-
status: PromotionStatus;
|
|
133
|
-
title: {
|
|
134
|
-
[key: string]: string;
|
|
135
|
-
};
|
|
136
|
-
description: {
|
|
137
|
-
[key: string]: string;
|
|
138
|
-
};
|
|
139
|
-
metaTitle: {
|
|
140
|
-
[key: string]: string;
|
|
141
|
-
};
|
|
142
|
-
metaDescription: {
|
|
143
|
-
[key: string]: string;
|
|
144
|
-
};
|
|
145
|
-
metaKeywords: {
|
|
146
|
-
[key: string]: string;
|
|
147
|
-
};
|
|
148
|
-
image?: string | undefined;
|
|
149
|
-
imageId?: string | undefined;
|
|
150
|
-
discountValue?: number | undefined;
|
|
151
|
-
startDate?: string | undefined;
|
|
152
|
-
endDate?: string | undefined;
|
|
153
|
-
minOrderAmount?: number | undefined;
|
|
154
|
-
isCombinable: boolean;
|
|
155
|
-
isActive: boolean;
|
|
156
|
-
conditions: string;
|
|
157
|
-
}
|
|
158
|
-
export interface CreatePromotionRequest_TitleEntry {
|
|
159
|
-
key: string;
|
|
160
|
-
value: string;
|
|
161
|
-
}
|
|
162
|
-
export interface CreatePromotionRequest_DescriptionEntry {
|
|
163
|
-
key: string;
|
|
164
|
-
value: string;
|
|
165
|
-
}
|
|
166
|
-
export interface CreatePromotionRequest_MetaTitleEntry {
|
|
167
|
-
key: string;
|
|
168
|
-
value: string;
|
|
169
|
-
}
|
|
170
|
-
export interface CreatePromotionRequest_MetaDescriptionEntry {
|
|
171
|
-
key: string;
|
|
172
|
-
value: string;
|
|
173
|
-
}
|
|
174
|
-
export interface CreatePromotionRequest_MetaKeywordsEntry {
|
|
175
|
-
key: string;
|
|
176
|
-
value: string;
|
|
177
|
-
}
|
|
178
|
-
export interface UpdatePromotionRequest {
|
|
179
|
-
id: string;
|
|
180
|
-
type?: PromotionType | undefined;
|
|
181
|
-
status?: PromotionStatus | undefined;
|
|
182
|
-
title: {
|
|
183
|
-
[key: string]: string;
|
|
184
|
-
};
|
|
185
|
-
description: {
|
|
186
|
-
[key: string]: string;
|
|
187
|
-
};
|
|
188
|
-
metaTitle: {
|
|
189
|
-
[key: string]: string;
|
|
190
|
-
};
|
|
191
|
-
metaDescription: {
|
|
192
|
-
[key: string]: string;
|
|
193
|
-
};
|
|
194
|
-
metaKeywords: {
|
|
195
|
-
[key: string]: string;
|
|
196
|
-
};
|
|
197
|
-
image?: string | undefined;
|
|
198
|
-
imageId?: string | undefined;
|
|
199
|
-
discountValue?: number | undefined;
|
|
200
|
-
startDate?: string | undefined;
|
|
201
|
-
endDate?: string | undefined;
|
|
202
|
-
minOrderAmount?: number | undefined;
|
|
203
|
-
isCombinable?: boolean | undefined;
|
|
204
|
-
isActive?: boolean | undefined;
|
|
205
|
-
conditions?: string | undefined;
|
|
206
|
-
}
|
|
207
|
-
export interface UpdatePromotionRequest_TitleEntry {
|
|
208
|
-
key: string;
|
|
209
|
-
value: string;
|
|
210
|
-
}
|
|
211
|
-
export interface UpdatePromotionRequest_DescriptionEntry {
|
|
212
|
-
key: string;
|
|
213
|
-
value: string;
|
|
214
|
-
}
|
|
215
|
-
export interface UpdatePromotionRequest_MetaTitleEntry {
|
|
216
|
-
key: string;
|
|
217
|
-
value: string;
|
|
218
|
-
}
|
|
219
|
-
export interface UpdatePromotionRequest_MetaDescriptionEntry {
|
|
220
|
-
key: string;
|
|
221
|
-
value: string;
|
|
222
|
-
}
|
|
223
|
-
export interface UpdatePromotionRequest_MetaKeywordsEntry {
|
|
224
|
-
key: string;
|
|
225
|
-
value: string;
|
|
226
|
-
}
|
|
227
|
-
export interface DeletePromotionRequest {
|
|
228
|
-
id: string;
|
|
229
|
-
}
|
|
230
|
-
export interface GenerateCouponsBatchRequest {
|
|
231
|
-
promotionId: string;
|
|
232
|
-
batchName: string;
|
|
233
|
-
count: number;
|
|
234
|
-
prefix?: string | undefined;
|
|
235
|
-
globalUsageLimit?: number | undefined;
|
|
236
|
-
perUserUsageLimit?: number | undefined;
|
|
237
|
-
}
|
|
238
|
-
export interface GenerateCouponsBatchResponse {
|
|
239
|
-
batchId: string;
|
|
240
|
-
generatedCount: number;
|
|
241
|
-
success: boolean;
|
|
242
|
-
}
|
|
243
|
-
export interface ExportCouponsCSVRequest {
|
|
244
|
-
promotionId?: string | undefined;
|
|
245
|
-
batchId?: string | undefined;
|
|
246
|
-
}
|
|
247
|
-
export interface ExportCouponsCSVResponse {
|
|
248
|
-
downloadUrl: string;
|
|
249
|
-
}
|
|
250
|
-
export interface GetPromotionAnalyticsRequest {
|
|
251
|
-
promotionId: string;
|
|
252
|
-
}
|
|
253
|
-
export interface PromotionAnalyticsResponse {
|
|
254
|
-
promotionId: string;
|
|
255
|
-
totalUses: number;
|
|
256
|
-
totalDiscountGiven: number;
|
|
257
|
-
totalRevenue: number;
|
|
258
|
-
averageDiscount: number;
|
|
259
|
-
conversionRate: number;
|
|
260
|
-
}
|
|
261
|
-
export declare const PROMO_V1_PACKAGE_NAME = "promo.v1";
|
|
262
|
-
export interface PublicPromoServiceClient {
|
|
263
|
-
getProductsDiscounts(request: GetProductsDiscountsRequest): Observable<GetProductsDiscountsResponse>;
|
|
264
|
-
validateAndCalculate(request: ValidateAndCalculateRequest): Observable<ValidateAndCalculateResponse>;
|
|
265
|
-
}
|
|
266
|
-
export interface PublicPromoServiceController {
|
|
267
|
-
getProductsDiscounts(request: GetProductsDiscountsRequest): Promise<GetProductsDiscountsResponse> | Observable<GetProductsDiscountsResponse> | GetProductsDiscountsResponse;
|
|
268
|
-
validateAndCalculate(request: ValidateAndCalculateRequest): Promise<ValidateAndCalculateResponse> | Observable<ValidateAndCalculateResponse> | ValidateAndCalculateResponse;
|
|
269
|
-
}
|
|
270
|
-
export declare function PublicPromoServiceControllerMethods(): (constructor: Function) => void;
|
|
271
|
-
export declare const PUBLIC_PROMO_SERVICE_NAME = "PublicPromoService";
|
|
272
|
-
export interface AdminPromoServiceClient {
|
|
273
|
-
getPromotions(request: GetPromotionsRequest): Observable<GetPromotionsResponse>;
|
|
274
|
-
getPromotion(request: GetPromotionRequest): Observable<PromotionResponse>;
|
|
275
|
-
createPromotion(request: CreatePromotionRequest): Observable<PromotionResponse>;
|
|
276
|
-
updatePromotion(request: UpdatePromotionRequest): Observable<PromotionResponse>;
|
|
277
|
-
deletePromotion(request: DeletePromotionRequest): Observable<DeleteResponse>;
|
|
278
|
-
generateCouponsBatch(request: GenerateCouponsBatchRequest): Observable<GenerateCouponsBatchResponse>;
|
|
279
|
-
exportCouponsCsv(request: ExportCouponsCSVRequest): Observable<ExportCouponsCSVResponse>;
|
|
280
|
-
getPromotionAnalytics(request: GetPromotionAnalyticsRequest): Observable<PromotionAnalyticsResponse>;
|
|
281
|
-
}
|
|
282
|
-
export interface AdminPromoServiceController {
|
|
283
|
-
getPromotions(request: GetPromotionsRequest): Promise<GetPromotionsResponse> | Observable<GetPromotionsResponse> | GetPromotionsResponse;
|
|
284
|
-
getPromotion(request: GetPromotionRequest): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
|
|
285
|
-
createPromotion(request: CreatePromotionRequest): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
|
|
286
|
-
updatePromotion(request: UpdatePromotionRequest): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
|
|
287
|
-
deletePromotion(request: DeletePromotionRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
288
|
-
generateCouponsBatch(request: GenerateCouponsBatchRequest): Promise<GenerateCouponsBatchResponse> | Observable<GenerateCouponsBatchResponse> | GenerateCouponsBatchResponse;
|
|
289
|
-
exportCouponsCsv(request: ExportCouponsCSVRequest): Promise<ExportCouponsCSVResponse> | Observable<ExportCouponsCSVResponse> | ExportCouponsCSVResponse;
|
|
290
|
-
getPromotionAnalytics(request: GetPromotionAnalyticsRequest): Promise<PromotionAnalyticsResponse> | Observable<PromotionAnalyticsResponse> | PromotionAnalyticsResponse;
|
|
291
|
-
}
|
|
292
|
-
export declare function AdminPromoServiceControllerMethods(): (constructor: Function) => void;
|
|
293
|
-
export declare const ADMIN_PROMO_SERVICE_NAME = "AdminPromoService";
|
package/dist/gen/promo.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
-
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.4
|
|
5
|
-
// protoc v3.21.12
|
|
6
|
-
// source: promo.proto
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ADMIN_PROMO_SERVICE_NAME = exports.PUBLIC_PROMO_SERVICE_NAME = exports.PROMO_V1_PACKAGE_NAME = exports.PromotionStatus = exports.PromotionType = exports.protobufPackage = void 0;
|
|
9
|
-
exports.PublicPromoServiceControllerMethods = PublicPromoServiceControllerMethods;
|
|
10
|
-
exports.AdminPromoServiceControllerMethods = AdminPromoServiceControllerMethods;
|
|
11
|
-
/* eslint-disable */
|
|
12
|
-
const microservices_1 = require("@nestjs/microservices");
|
|
13
|
-
exports.protobufPackage = "promo.v1";
|
|
14
|
-
var PromotionType;
|
|
15
|
-
(function (PromotionType) {
|
|
16
|
-
PromotionType[PromotionType["PROMOTION_TYPE_UNSPECIFIED"] = 0] = "PROMOTION_TYPE_UNSPECIFIED";
|
|
17
|
-
PromotionType[PromotionType["PROMOTION_TYPE_FIXED"] = 1] = "PROMOTION_TYPE_FIXED";
|
|
18
|
-
PromotionType[PromotionType["PROMOTION_TYPE_PERCENTAGE"] = 2] = "PROMOTION_TYPE_PERCENTAGE";
|
|
19
|
-
PromotionType[PromotionType["PROMOTION_TYPE_COUPON"] = 3] = "PROMOTION_TYPE_COUPON";
|
|
20
|
-
PromotionType[PromotionType["PROMOTION_TYPE_N_PLUS_M"] = 4] = "PROMOTION_TYPE_N_PLUS_M";
|
|
21
|
-
PromotionType[PromotionType["PROMOTION_TYPE_FIRST_PURCHASE"] = 5] = "PROMOTION_TYPE_FIRST_PURCHASE";
|
|
22
|
-
PromotionType[PromotionType["PROMOTION_TYPE_PROMO_PERIOD"] = 6] = "PROMOTION_TYPE_PROMO_PERIOD";
|
|
23
|
-
PromotionType[PromotionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
24
|
-
})(PromotionType || (exports.PromotionType = PromotionType = {}));
|
|
25
|
-
var PromotionStatus;
|
|
26
|
-
(function (PromotionStatus) {
|
|
27
|
-
PromotionStatus[PromotionStatus["PROMOTION_STATUS_UNSPECIFIED"] = 0] = "PROMOTION_STATUS_UNSPECIFIED";
|
|
28
|
-
PromotionStatus[PromotionStatus["PROMOTION_STATUS_ACTIVE"] = 1] = "PROMOTION_STATUS_ACTIVE";
|
|
29
|
-
PromotionStatus[PromotionStatus["PROMOTION_STATUS_INACTIVE"] = 2] = "PROMOTION_STATUS_INACTIVE";
|
|
30
|
-
PromotionStatus[PromotionStatus["PROMOTION_STATUS_SCHEDULED"] = 3] = "PROMOTION_STATUS_SCHEDULED";
|
|
31
|
-
PromotionStatus[PromotionStatus["PROMOTION_STATUS_ARCHIVED"] = 4] = "PROMOTION_STATUS_ARCHIVED";
|
|
32
|
-
PromotionStatus[PromotionStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
33
|
-
})(PromotionStatus || (exports.PromotionStatus = PromotionStatus = {}));
|
|
34
|
-
exports.PROMO_V1_PACKAGE_NAME = "promo.v1";
|
|
35
|
-
function PublicPromoServiceControllerMethods() {
|
|
36
|
-
return function (constructor) {
|
|
37
|
-
const grpcMethods = ["getProductsDiscounts", "validateAndCalculate"];
|
|
38
|
-
for (const method of grpcMethods) {
|
|
39
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
40
|
-
(0, microservices_1.GrpcMethod)("PublicPromoService", method)(constructor.prototype[method], method, descriptor);
|
|
41
|
-
}
|
|
42
|
-
const grpcStreamMethods = [];
|
|
43
|
-
for (const method of grpcStreamMethods) {
|
|
44
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
45
|
-
(0, microservices_1.GrpcStreamMethod)("PublicPromoService", method)(constructor.prototype[method], method, descriptor);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
exports.PUBLIC_PROMO_SERVICE_NAME = "PublicPromoService";
|
|
50
|
-
function AdminPromoServiceControllerMethods() {
|
|
51
|
-
return function (constructor) {
|
|
52
|
-
const grpcMethods = [
|
|
53
|
-
"getPromotions",
|
|
54
|
-
"getPromotion",
|
|
55
|
-
"createPromotion",
|
|
56
|
-
"updatePromotion",
|
|
57
|
-
"deletePromotion",
|
|
58
|
-
"generateCouponsBatch",
|
|
59
|
-
"exportCouponsCsv",
|
|
60
|
-
"getPromotionAnalytics",
|
|
61
|
-
];
|
|
62
|
-
for (const method of grpcMethods) {
|
|
63
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
64
|
-
(0, microservices_1.GrpcMethod)("AdminPromoService", method)(constructor.prototype[method], method, descriptor);
|
|
65
|
-
}
|
|
66
|
-
const grpcStreamMethods = [];
|
|
67
|
-
for (const method of grpcStreamMethods) {
|
|
68
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
69
|
-
(0, microservices_1.GrpcStreamMethod)("AdminPromoService", method)(constructor.prototype[method], method, descriptor);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
exports.ADMIN_PROMO_SERVICE_NAME = "AdminPromoService";
|