@mamindom/contracts 1.0.49 → 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.
@@ -0,0 +1,55 @@
1
+ import { Observable } from "rxjs";
2
+ import { SuccessResponse } from "./common_promo";
3
+ export declare const protobufPackage = "promo.v1";
4
+ export interface CartItem {
5
+ productId: string;
6
+ categoryId: string;
7
+ brandId: string;
8
+ quantity: number;
9
+ price: number;
10
+ }
11
+ export interface ValidateAndCalculateRequest {
12
+ userId: string;
13
+ items: CartItem[];
14
+ orderTotal: number;
15
+ couponCode?: string | undefined;
16
+ isFirstOrder: boolean;
17
+ orderCount: number;
18
+ }
19
+ export interface ValidateAndCalculateResponse {
20
+ isValid: boolean;
21
+ discountAmount: number;
22
+ finalTotal: number;
23
+ appliedPromotions: AppliedPromotion[];
24
+ appliedCoupon?: AppliedCoupon | undefined;
25
+ errorMessage?: string | undefined;
26
+ }
27
+ export interface AppliedPromotion {
28
+ promotionId: string;
29
+ promotionName: string;
30
+ discountAmount: number;
31
+ }
32
+ export interface AppliedCoupon {
33
+ couponId: string;
34
+ code: string;
35
+ promotionId: string;
36
+ discountAmount: number;
37
+ }
38
+ export interface ApplyPromotionRequest {
39
+ userId: string;
40
+ orderId: string;
41
+ discountAmount: number;
42
+ couponCode?: string | undefined;
43
+ promotionIds: string[];
44
+ }
45
+ export declare const PROMO_V1_PACKAGE_NAME = "promo.v1";
46
+ export interface PromoCalculationServiceClient {
47
+ validateAndCalculate(request: ValidateAndCalculateRequest): Observable<ValidateAndCalculateResponse>;
48
+ applyPromotion(request: ApplyPromotionRequest): Observable<SuccessResponse>;
49
+ }
50
+ export interface PromoCalculationServiceController {
51
+ validateAndCalculate(request: ValidateAndCalculateRequest): Promise<ValidateAndCalculateResponse> | Observable<ValidateAndCalculateResponse> | ValidateAndCalculateResponse;
52
+ applyPromotion(request: ApplyPromotionRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
53
+ }
54
+ export declare function PromoCalculationServiceControllerMethods(): (constructor: Function) => void;
55
+ export declare const PROMO_CALCULATION_SERVICE_NAME = "PromoCalculationService";
@@ -0,0 +1,28 @@
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: calculation.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PROMO_CALCULATION_SERVICE_NAME = exports.PROMO_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.PromoCalculationServiceControllerMethods = PromoCalculationServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "promo.v1";
13
+ exports.PROMO_V1_PACKAGE_NAME = "promo.v1";
14
+ function PromoCalculationServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["validateAndCalculate", "applyPromotion"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("PromoCalculationService", method)(constructor.prototype[method], method, descriptor);
20
+ }
21
+ const grpcStreamMethods = [];
22
+ for (const method of grpcStreamMethods) {
23
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
24
+ (0, microservices_1.GrpcStreamMethod)("PromoCalculationService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.PROMO_CALCULATION_SERVICE_NAME = "PromoCalculationService";
@@ -0,0 +1,18 @@
1
+ export declare const protobufPackage = "promo.v1";
2
+ export interface SuccessResponse {
3
+ success: boolean;
4
+ }
5
+ export interface DeleteResponse {
6
+ success: boolean;
7
+ }
8
+ export interface PaginationRequest {
9
+ page: number;
10
+ limit: number;
11
+ }
12
+ export interface PaginationMeta {
13
+ totalItems: number;
14
+ totalPages: number;
15
+ currentPage: number;
16
+ perPage: number;
17
+ }
18
+ export declare const PROMO_V1_PACKAGE_NAME = "promo.v1";
@@ -0,0 +1,11 @@
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: common_promo.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PROMO_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "promo.v1";
11
+ exports.PROMO_V1_PACKAGE_NAME = "promo.v1";
@@ -0,0 +1,96 @@
1
+ import { Observable } from "rxjs";
2
+ import { PaginationMeta, PaginationRequest, SuccessResponse } from "./common_promo";
3
+ export declare const protobufPackage = "promo.v1";
4
+ export interface CouponResponse {
5
+ id: string;
6
+ promotionId: string;
7
+ code: string;
8
+ usageLimitTotal?: number | undefined;
9
+ usageLimitPerUser?: number | undefined;
10
+ usageCount: number;
11
+ isActive: boolean;
12
+ expiresAt?: string | undefined;
13
+ createdAt: string;
14
+ }
15
+ export interface GetCouponsRequest {
16
+ pagination: PaginationRequest | undefined;
17
+ promotionId?: string | undefined;
18
+ isActive?: boolean | undefined;
19
+ search?: string | undefined;
20
+ }
21
+ export interface GetCouponsResponse {
22
+ items: CouponResponse[];
23
+ meta: PaginationMeta | undefined;
24
+ }
25
+ export interface GetCouponRequest {
26
+ id: string;
27
+ code?: string | undefined;
28
+ }
29
+ export interface CreateCouponRequest {
30
+ promotionId: string;
31
+ code: string;
32
+ usageLimitTotal?: number | undefined;
33
+ usageLimitPerUser?: number | undefined;
34
+ expiresAt?: string | undefined;
35
+ isActive: boolean;
36
+ }
37
+ export interface UpdateCouponRequest {
38
+ id: string;
39
+ usageLimitTotal?: number | undefined;
40
+ usageLimitPerUser?: number | undefined;
41
+ expiresAt?: string | undefined;
42
+ isActive?: boolean | undefined;
43
+ }
44
+ export interface DeactivateCouponRequest {
45
+ id: string;
46
+ }
47
+ export interface GenerateCouponsRequest {
48
+ promotionId: string;
49
+ count: number;
50
+ prefix?: string | undefined;
51
+ randomLength?: number | undefined;
52
+ usageLimitPerUser?: number | undefined;
53
+ expiresAt?: string | undefined;
54
+ }
55
+ export interface GenerateCouponsResponse {
56
+ generated: number;
57
+ }
58
+ export interface ExportCouponsRequest {
59
+ promotionId: string;
60
+ activeOnly?: boolean | undefined;
61
+ }
62
+ export interface ExportCouponsResponse {
63
+ csvContent: string;
64
+ }
65
+ export interface ImportCouponsRequest {
66
+ promotionId: string;
67
+ csvContent: string;
68
+ }
69
+ export interface ImportCouponsResponse {
70
+ imported: number;
71
+ skipped: number;
72
+ errors: string[];
73
+ }
74
+ export declare const PROMO_V1_PACKAGE_NAME = "promo.v1";
75
+ export interface CouponServiceClient {
76
+ getCoupons(request: GetCouponsRequest): Observable<GetCouponsResponse>;
77
+ getCoupon(request: GetCouponRequest): Observable<CouponResponse>;
78
+ createCoupon(request: CreateCouponRequest): Observable<CouponResponse>;
79
+ updateCoupon(request: UpdateCouponRequest): Observable<CouponResponse>;
80
+ deactivateCoupon(request: DeactivateCouponRequest): Observable<SuccessResponse>;
81
+ generateCoupons(request: GenerateCouponsRequest): Observable<GenerateCouponsResponse>;
82
+ exportCoupons(request: ExportCouponsRequest): Observable<ExportCouponsResponse>;
83
+ importCoupons(request: ImportCouponsRequest): Observable<ImportCouponsResponse>;
84
+ }
85
+ export interface CouponServiceController {
86
+ getCoupons(request: GetCouponsRequest): Promise<GetCouponsResponse> | Observable<GetCouponsResponse> | GetCouponsResponse;
87
+ getCoupon(request: GetCouponRequest): Promise<CouponResponse> | Observable<CouponResponse> | CouponResponse;
88
+ createCoupon(request: CreateCouponRequest): Promise<CouponResponse> | Observable<CouponResponse> | CouponResponse;
89
+ updateCoupon(request: UpdateCouponRequest): Promise<CouponResponse> | Observable<CouponResponse> | CouponResponse;
90
+ deactivateCoupon(request: DeactivateCouponRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
91
+ generateCoupons(request: GenerateCouponsRequest): Promise<GenerateCouponsResponse> | Observable<GenerateCouponsResponse> | GenerateCouponsResponse;
92
+ exportCoupons(request: ExportCouponsRequest): Promise<ExportCouponsResponse> | Observable<ExportCouponsResponse> | ExportCouponsResponse;
93
+ importCoupons(request: ImportCouponsRequest): Promise<ImportCouponsResponse> | Observable<ImportCouponsResponse> | ImportCouponsResponse;
94
+ }
95
+ export declare function CouponServiceControllerMethods(): (constructor: Function) => void;
96
+ export declare const COUPON_SERVICE_NAME = "CouponService";
@@ -0,0 +1,37 @@
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: coupon.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.COUPON_SERVICE_NAME = exports.PROMO_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.CouponServiceControllerMethods = CouponServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "promo.v1";
13
+ exports.PROMO_V1_PACKAGE_NAME = "promo.v1";
14
+ function CouponServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = [
17
+ "getCoupons",
18
+ "getCoupon",
19
+ "createCoupon",
20
+ "updateCoupon",
21
+ "deactivateCoupon",
22
+ "generateCoupons",
23
+ "exportCoupons",
24
+ "importCoupons",
25
+ ];
26
+ for (const method of grpcMethods) {
27
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
28
+ (0, microservices_1.GrpcMethod)("CouponService", method)(constructor.prototype[method], method, descriptor);
29
+ }
30
+ const grpcStreamMethods = [];
31
+ for (const method of grpcStreamMethods) {
32
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
33
+ (0, microservices_1.GrpcStreamMethod)("CouponService", method)(constructor.prototype[method], method, descriptor);
34
+ }
35
+ };
36
+ }
37
+ exports.COUPON_SERVICE_NAME = "CouponService";
@@ -0,0 +1,284 @@
1
+ import { Observable } from "rxjs";
2
+ import { DeleteResponse, PaginationMeta, PaginationRequest, SuccessResponse } 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_BUY_N_GET_M = 4,
10
+ PROMOTION_TYPE_FIRST_ORDER = 5,
11
+ PROMOTION_TYPE_LOYALTY = 6,
12
+ PROMOTION_TYPE_PROMO_PERIOD = 7,
13
+ UNRECOGNIZED = -1
14
+ }
15
+ export declare enum DiscountType {
16
+ DISCOUNT_TYPE_UNSPECIFIED = 0,
17
+ DISCOUNT_TYPE_FIXED = 1,
18
+ DISCOUNT_TYPE_PERCENTAGE = 2,
19
+ UNRECOGNIZED = -1
20
+ }
21
+ export declare enum PromotionStatus {
22
+ PROMOTION_STATUS_UNSPECIFIED = 0,
23
+ PROMOTION_STATUS_DRAFT = 1,
24
+ PROMOTION_STATUS_ACTIVE = 2,
25
+ PROMOTION_STATUS_INACTIVE = 3,
26
+ PROMOTION_STATUS_EXPIRED = 4,
27
+ UNRECOGNIZED = -1
28
+ }
29
+ export declare enum ConditionLogic {
30
+ CONDITION_LOGIC_UNSPECIFIED = 0,
31
+ CONDITION_LOGIC_AND = 1,
32
+ CONDITION_LOGIC_OR = 2,
33
+ UNRECOGNIZED = -1
34
+ }
35
+ export declare enum ConditionType {
36
+ CONDITION_TYPE_UNSPECIFIED = 0,
37
+ CONDITION_TYPE_PRODUCT = 1,
38
+ CONDITION_TYPE_CATEGORY = 2,
39
+ CONDITION_TYPE_BRAND = 3,
40
+ CONDITION_TYPE_USER_GROUP = 4,
41
+ CONDITION_TYPE_FIRST_ORDER = 5,
42
+ CONDITION_TYPE_MIN_ORDER_COUNT = 6,
43
+ CONDITION_TYPE_MIN_AMOUNT = 7,
44
+ UNRECOGNIZED = -1
45
+ }
46
+ export declare enum ExclusionEntityType {
47
+ EXCLUSION_ENTITY_UNSPECIFIED = 0,
48
+ EXCLUSION_ENTITY_PRODUCT = 1,
49
+ EXCLUSION_ENTITY_CATEGORY = 2,
50
+ EXCLUSION_ENTITY_BRAND = 3,
51
+ UNRECOGNIZED = -1
52
+ }
53
+ export interface PromotionConditionPayload {
54
+ logicType: ConditionLogic;
55
+ conditionType: ConditionType;
56
+ value: string;
57
+ }
58
+ export interface PromotionExclusionPayload {
59
+ entityType: ExclusionEntityType;
60
+ entityId: string;
61
+ }
62
+ export interface PromotionConditionResponse {
63
+ id: string;
64
+ logicType: ConditionLogic;
65
+ conditionType: ConditionType;
66
+ value: string;
67
+ }
68
+ export interface PromotionExclusionResponse {
69
+ id: string;
70
+ entityType: ExclusionEntityType;
71
+ entityId: string;
72
+ }
73
+ export interface PromotionResponse {
74
+ id: string;
75
+ name: {
76
+ [key: string]: string;
77
+ };
78
+ description: {
79
+ [key: string]: string;
80
+ };
81
+ type: PromotionType;
82
+ discountType: DiscountType;
83
+ status: PromotionStatus;
84
+ discountValue: number;
85
+ startsAt?: string | undefined;
86
+ endsAt?: string | undefined;
87
+ minOrderAmount?: number | undefined;
88
+ usageLimitTotal?: number | undefined;
89
+ usageLimitPerUser?: number | undefined;
90
+ usageCount: number;
91
+ isActive: boolean;
92
+ isExclusive: boolean;
93
+ buyQuantity?: number | undefined;
94
+ getQuantity?: number | undefined;
95
+ seoSlug?: string | undefined;
96
+ seoTitle: {
97
+ [key: string]: string;
98
+ };
99
+ seoDescription: {
100
+ [key: string]: string;
101
+ };
102
+ createdById: string;
103
+ createdAt: string;
104
+ updatedAt: string;
105
+ conditions: PromotionConditionResponse[];
106
+ exclusions: PromotionExclusionResponse[];
107
+ }
108
+ export interface PromotionResponse_NameEntry {
109
+ key: string;
110
+ value: string;
111
+ }
112
+ export interface PromotionResponse_DescriptionEntry {
113
+ key: string;
114
+ value: string;
115
+ }
116
+ export interface PromotionResponse_SeoTitleEntry {
117
+ key: string;
118
+ value: string;
119
+ }
120
+ export interface PromotionResponse_SeoDescriptionEntry {
121
+ key: string;
122
+ value: string;
123
+ }
124
+ export interface GetPromotionsRequest {
125
+ pagination: PaginationRequest | undefined;
126
+ type?: PromotionType | undefined;
127
+ status?: PromotionStatus | undefined;
128
+ search?: string | undefined;
129
+ categoryId?: string | undefined;
130
+ dateFrom?: string | undefined;
131
+ dateTo?: string | undefined;
132
+ }
133
+ export interface GetPromotionsResponse {
134
+ items: PromotionListItem[];
135
+ meta: PaginationMeta | undefined;
136
+ }
137
+ export interface PromotionListItem {
138
+ id: string;
139
+ name: {
140
+ [key: string]: string;
141
+ };
142
+ type: PromotionType;
143
+ status: PromotionStatus;
144
+ startsAt?: string | undefined;
145
+ endsAt?: string | undefined;
146
+ usageCount: number;
147
+ isActive: boolean;
148
+ createdAt: string;
149
+ }
150
+ export interface PromotionListItem_NameEntry {
151
+ key: string;
152
+ value: string;
153
+ }
154
+ export interface GetPromotionRequest {
155
+ id: string;
156
+ }
157
+ export interface CreatePromotionRequest {
158
+ name: {
159
+ [key: string]: string;
160
+ };
161
+ description: {
162
+ [key: string]: string;
163
+ };
164
+ type: PromotionType;
165
+ discountType: DiscountType;
166
+ discountValue: number;
167
+ startsAt?: string | undefined;
168
+ endsAt?: string | undefined;
169
+ minOrderAmount?: number | undefined;
170
+ usageLimitTotal?: number | undefined;
171
+ usageLimitPerUser?: number | undefined;
172
+ isActive: boolean;
173
+ isExclusive: boolean;
174
+ buyQuantity?: number | undefined;
175
+ getQuantity?: number | undefined;
176
+ seoSlug?: string | undefined;
177
+ seoTitle: {
178
+ [key: string]: string;
179
+ };
180
+ seoDescription: {
181
+ [key: string]: string;
182
+ };
183
+ createdById: string;
184
+ conditions: PromotionConditionPayload[];
185
+ exclusions: PromotionExclusionPayload[];
186
+ }
187
+ export interface CreatePromotionRequest_NameEntry {
188
+ key: string;
189
+ value: string;
190
+ }
191
+ export interface CreatePromotionRequest_DescriptionEntry {
192
+ key: string;
193
+ value: string;
194
+ }
195
+ export interface CreatePromotionRequest_SeoTitleEntry {
196
+ key: string;
197
+ value: string;
198
+ }
199
+ export interface CreatePromotionRequest_SeoDescriptionEntry {
200
+ key: string;
201
+ value: string;
202
+ }
203
+ export interface UpdatePromotionRequest {
204
+ id: string;
205
+ name: {
206
+ [key: string]: string;
207
+ };
208
+ description: {
209
+ [key: string]: string;
210
+ };
211
+ type?: PromotionType | undefined;
212
+ discountType?: DiscountType | undefined;
213
+ discountValue?: number | undefined;
214
+ startsAt?: string | undefined;
215
+ endsAt?: string | undefined;
216
+ minOrderAmount?: number | undefined;
217
+ usageLimitTotal?: number | undefined;
218
+ usageLimitPerUser?: number | undefined;
219
+ isActive?: boolean | undefined;
220
+ isExclusive?: boolean | undefined;
221
+ buyQuantity?: number | undefined;
222
+ getQuantity?: number | undefined;
223
+ seoSlug?: string | undefined;
224
+ seoTitle: {
225
+ [key: string]: string;
226
+ };
227
+ seoDescription: {
228
+ [key: string]: string;
229
+ };
230
+ conditions: PromotionConditionPayload[];
231
+ exclusions: PromotionExclusionPayload[];
232
+ }
233
+ export interface UpdatePromotionRequest_NameEntry {
234
+ key: string;
235
+ value: string;
236
+ }
237
+ export interface UpdatePromotionRequest_DescriptionEntry {
238
+ key: string;
239
+ value: string;
240
+ }
241
+ export interface UpdatePromotionRequest_SeoTitleEntry {
242
+ key: string;
243
+ value: string;
244
+ }
245
+ export interface UpdatePromotionRequest_SeoDescriptionEntry {
246
+ key: string;
247
+ value: string;
248
+ }
249
+ export interface DeletePromotionRequest {
250
+ id: string;
251
+ }
252
+ export interface BulkApplyToCategoriesRequest {
253
+ promotionId: string;
254
+ categoryIds: string[];
255
+ }
256
+ export interface GetActivePromotionsRequest {
257
+ pagination: PaginationRequest | undefined;
258
+ lang?: string | undefined;
259
+ }
260
+ export interface GetActivePromotionsResponse {
261
+ items: PromotionListItem[];
262
+ meta: PaginationMeta | undefined;
263
+ }
264
+ export declare const PROMO_V1_PACKAGE_NAME = "promo.v1";
265
+ export interface PromotionServiceClient {
266
+ getPromotions(request: GetPromotionsRequest): Observable<GetPromotionsResponse>;
267
+ getPromotion(request: GetPromotionRequest): Observable<PromotionResponse>;
268
+ createPromotion(request: CreatePromotionRequest): Observable<PromotionResponse>;
269
+ updatePromotion(request: UpdatePromotionRequest): Observable<PromotionResponse>;
270
+ deletePromotion(request: DeletePromotionRequest): Observable<DeleteResponse>;
271
+ bulkApplyToCategories(request: BulkApplyToCategoriesRequest): Observable<SuccessResponse>;
272
+ getActivePromotions(request: GetActivePromotionsRequest): Observable<GetActivePromotionsResponse>;
273
+ }
274
+ export interface PromotionServiceController {
275
+ getPromotions(request: GetPromotionsRequest): Promise<GetPromotionsResponse> | Observable<GetPromotionsResponse> | GetPromotionsResponse;
276
+ getPromotion(request: GetPromotionRequest): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
277
+ createPromotion(request: CreatePromotionRequest): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
278
+ updatePromotion(request: UpdatePromotionRequest): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
279
+ deletePromotion(request: DeletePromotionRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
280
+ bulkApplyToCategories(request: BulkApplyToCategoriesRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
281
+ getActivePromotions(request: GetActivePromotionsRequest): Promise<GetActivePromotionsResponse> | Observable<GetActivePromotionsResponse> | GetActivePromotionsResponse;
282
+ }
283
+ export declare function PromotionServiceControllerMethods(): (constructor: Function) => void;
284
+ export declare const PROMOTION_SERVICE_NAME = "PromotionService";
@@ -0,0 +1,91 @@
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: promotion.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PROMOTION_SERVICE_NAME = exports.PROMO_V1_PACKAGE_NAME = exports.ExclusionEntityType = exports.ConditionType = exports.ConditionLogic = exports.PromotionStatus = exports.DiscountType = exports.PromotionType = exports.protobufPackage = void 0;
9
+ exports.PromotionServiceControllerMethods = PromotionServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "promo.v1";
13
+ var PromotionType;
14
+ (function (PromotionType) {
15
+ PromotionType[PromotionType["PROMOTION_TYPE_UNSPECIFIED"] = 0] = "PROMOTION_TYPE_UNSPECIFIED";
16
+ PromotionType[PromotionType["PROMOTION_TYPE_FIXED"] = 1] = "PROMOTION_TYPE_FIXED";
17
+ PromotionType[PromotionType["PROMOTION_TYPE_PERCENTAGE"] = 2] = "PROMOTION_TYPE_PERCENTAGE";
18
+ PromotionType[PromotionType["PROMOTION_TYPE_COUPON"] = 3] = "PROMOTION_TYPE_COUPON";
19
+ PromotionType[PromotionType["PROMOTION_TYPE_BUY_N_GET_M"] = 4] = "PROMOTION_TYPE_BUY_N_GET_M";
20
+ PromotionType[PromotionType["PROMOTION_TYPE_FIRST_ORDER"] = 5] = "PROMOTION_TYPE_FIRST_ORDER";
21
+ PromotionType[PromotionType["PROMOTION_TYPE_LOYALTY"] = 6] = "PROMOTION_TYPE_LOYALTY";
22
+ PromotionType[PromotionType["PROMOTION_TYPE_PROMO_PERIOD"] = 7] = "PROMOTION_TYPE_PROMO_PERIOD";
23
+ PromotionType[PromotionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
24
+ })(PromotionType || (exports.PromotionType = PromotionType = {}));
25
+ var DiscountType;
26
+ (function (DiscountType) {
27
+ DiscountType[DiscountType["DISCOUNT_TYPE_UNSPECIFIED"] = 0] = "DISCOUNT_TYPE_UNSPECIFIED";
28
+ DiscountType[DiscountType["DISCOUNT_TYPE_FIXED"] = 1] = "DISCOUNT_TYPE_FIXED";
29
+ DiscountType[DiscountType["DISCOUNT_TYPE_PERCENTAGE"] = 2] = "DISCOUNT_TYPE_PERCENTAGE";
30
+ DiscountType[DiscountType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
31
+ })(DiscountType || (exports.DiscountType = DiscountType = {}));
32
+ var PromotionStatus;
33
+ (function (PromotionStatus) {
34
+ PromotionStatus[PromotionStatus["PROMOTION_STATUS_UNSPECIFIED"] = 0] = "PROMOTION_STATUS_UNSPECIFIED";
35
+ PromotionStatus[PromotionStatus["PROMOTION_STATUS_DRAFT"] = 1] = "PROMOTION_STATUS_DRAFT";
36
+ PromotionStatus[PromotionStatus["PROMOTION_STATUS_ACTIVE"] = 2] = "PROMOTION_STATUS_ACTIVE";
37
+ PromotionStatus[PromotionStatus["PROMOTION_STATUS_INACTIVE"] = 3] = "PROMOTION_STATUS_INACTIVE";
38
+ PromotionStatus[PromotionStatus["PROMOTION_STATUS_EXPIRED"] = 4] = "PROMOTION_STATUS_EXPIRED";
39
+ PromotionStatus[PromotionStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
40
+ })(PromotionStatus || (exports.PromotionStatus = PromotionStatus = {}));
41
+ var ConditionLogic;
42
+ (function (ConditionLogic) {
43
+ ConditionLogic[ConditionLogic["CONDITION_LOGIC_UNSPECIFIED"] = 0] = "CONDITION_LOGIC_UNSPECIFIED";
44
+ ConditionLogic[ConditionLogic["CONDITION_LOGIC_AND"] = 1] = "CONDITION_LOGIC_AND";
45
+ ConditionLogic[ConditionLogic["CONDITION_LOGIC_OR"] = 2] = "CONDITION_LOGIC_OR";
46
+ ConditionLogic[ConditionLogic["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
47
+ })(ConditionLogic || (exports.ConditionLogic = ConditionLogic = {}));
48
+ var ConditionType;
49
+ (function (ConditionType) {
50
+ ConditionType[ConditionType["CONDITION_TYPE_UNSPECIFIED"] = 0] = "CONDITION_TYPE_UNSPECIFIED";
51
+ ConditionType[ConditionType["CONDITION_TYPE_PRODUCT"] = 1] = "CONDITION_TYPE_PRODUCT";
52
+ ConditionType[ConditionType["CONDITION_TYPE_CATEGORY"] = 2] = "CONDITION_TYPE_CATEGORY";
53
+ ConditionType[ConditionType["CONDITION_TYPE_BRAND"] = 3] = "CONDITION_TYPE_BRAND";
54
+ ConditionType[ConditionType["CONDITION_TYPE_USER_GROUP"] = 4] = "CONDITION_TYPE_USER_GROUP";
55
+ ConditionType[ConditionType["CONDITION_TYPE_FIRST_ORDER"] = 5] = "CONDITION_TYPE_FIRST_ORDER";
56
+ ConditionType[ConditionType["CONDITION_TYPE_MIN_ORDER_COUNT"] = 6] = "CONDITION_TYPE_MIN_ORDER_COUNT";
57
+ ConditionType[ConditionType["CONDITION_TYPE_MIN_AMOUNT"] = 7] = "CONDITION_TYPE_MIN_AMOUNT";
58
+ ConditionType[ConditionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
59
+ })(ConditionType || (exports.ConditionType = ConditionType = {}));
60
+ var ExclusionEntityType;
61
+ (function (ExclusionEntityType) {
62
+ ExclusionEntityType[ExclusionEntityType["EXCLUSION_ENTITY_UNSPECIFIED"] = 0] = "EXCLUSION_ENTITY_UNSPECIFIED";
63
+ ExclusionEntityType[ExclusionEntityType["EXCLUSION_ENTITY_PRODUCT"] = 1] = "EXCLUSION_ENTITY_PRODUCT";
64
+ ExclusionEntityType[ExclusionEntityType["EXCLUSION_ENTITY_CATEGORY"] = 2] = "EXCLUSION_ENTITY_CATEGORY";
65
+ ExclusionEntityType[ExclusionEntityType["EXCLUSION_ENTITY_BRAND"] = 3] = "EXCLUSION_ENTITY_BRAND";
66
+ ExclusionEntityType[ExclusionEntityType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
67
+ })(ExclusionEntityType || (exports.ExclusionEntityType = ExclusionEntityType = {}));
68
+ exports.PROMO_V1_PACKAGE_NAME = "promo.v1";
69
+ function PromotionServiceControllerMethods() {
70
+ return function (constructor) {
71
+ const grpcMethods = [
72
+ "getPromotions",
73
+ "getPromotion",
74
+ "createPromotion",
75
+ "updatePromotion",
76
+ "deletePromotion",
77
+ "bulkApplyToCategories",
78
+ "getActivePromotions",
79
+ ];
80
+ for (const method of grpcMethods) {
81
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
82
+ (0, microservices_1.GrpcMethod)("PromotionService", method)(constructor.prototype[method], method, descriptor);
83
+ }
84
+ const grpcStreamMethods = [];
85
+ for (const method of grpcStreamMethods) {
86
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
87
+ (0, microservices_1.GrpcStreamMethod)("PromotionService", method)(constructor.prototype[method], method, descriptor);
88
+ }
89
+ };
90
+ }
91
+ exports.PROMOTION_SERVICE_NAME = "PromotionService";