@platfformx/proto-contracts 1.6.1 → 1.6.3
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.
|
@@ -51,6 +51,12 @@ export interface DeactivatePromocodeRequest {
|
|
|
51
51
|
export interface DeactivatePromocodeResponse {
|
|
52
52
|
success: boolean;
|
|
53
53
|
}
|
|
54
|
+
export interface DeletePromocodeRequest {
|
|
55
|
+
promocodeId: string;
|
|
56
|
+
}
|
|
57
|
+
export interface DeletePromocodeResponse {
|
|
58
|
+
success: boolean;
|
|
59
|
+
}
|
|
54
60
|
export interface ValidatePromocodeRequest {
|
|
55
61
|
code: string;
|
|
56
62
|
totalOrderSum: string;
|
|
@@ -61,19 +67,20 @@ export interface ValidatePromocodeResponse {
|
|
|
61
67
|
discountAmount: string;
|
|
62
68
|
errorMessage: string;
|
|
63
69
|
discountType: DiscountType;
|
|
64
|
-
discountValue: string;
|
|
65
70
|
}
|
|
66
71
|
export declare const PROMO_V1_PACKAGE_NAME = "promo.v1";
|
|
67
72
|
export interface PromoServiceClient {
|
|
68
73
|
createPromocode(request: CreatePromocodeRequest): Observable<CreatePromocodeResponse>;
|
|
69
74
|
applyPromocode(request: ApplyPromocodeRequest): Observable<ApplyPromocodeResponse>;
|
|
70
75
|
deactivatePromocode(request: DeactivatePromocodeRequest): Observable<DeactivatePromocodeResponse>;
|
|
76
|
+
deletePromocode(request: DeletePromocodeRequest): Observable<DeletePromocodeResponse>;
|
|
71
77
|
validatePromocode(request: ValidatePromocodeRequest): Observable<ValidatePromocodeResponse>;
|
|
72
78
|
}
|
|
73
79
|
export interface PromoServiceController {
|
|
74
80
|
createPromocode(request: CreatePromocodeRequest): Promise<CreatePromocodeResponse> | Observable<CreatePromocodeResponse> | CreatePromocodeResponse;
|
|
75
81
|
applyPromocode(request: ApplyPromocodeRequest): Promise<ApplyPromocodeResponse> | Observable<ApplyPromocodeResponse> | ApplyPromocodeResponse;
|
|
76
82
|
deactivatePromocode(request: DeactivatePromocodeRequest): Promise<DeactivatePromocodeResponse> | Observable<DeactivatePromocodeResponse> | DeactivatePromocodeResponse;
|
|
83
|
+
deletePromocode(request: DeletePromocodeRequest): Promise<DeletePromocodeResponse> | Observable<DeletePromocodeResponse> | DeletePromocodeResponse;
|
|
77
84
|
validatePromocode(request: ValidatePromocodeRequest): Promise<ValidatePromocodeResponse> | Observable<ValidatePromocodeResponse> | ValidatePromocodeResponse;
|
|
78
85
|
}
|
|
79
86
|
export declare function PromoServiceControllerMethods(): (constructor: Function) => void;
|
|
@@ -38,7 +38,13 @@ var PromocodeType;
|
|
|
38
38
|
exports.PROMO_V1_PACKAGE_NAME = "promo.v1";
|
|
39
39
|
function PromoServiceControllerMethods() {
|
|
40
40
|
return function (constructor) {
|
|
41
|
-
const grpcMethods = [
|
|
41
|
+
const grpcMethods = [
|
|
42
|
+
"createPromocode",
|
|
43
|
+
"applyPromocode",
|
|
44
|
+
"deactivatePromocode",
|
|
45
|
+
"deletePromocode",
|
|
46
|
+
"validatePromocode",
|
|
47
|
+
];
|
|
42
48
|
for (const method of grpcMethods) {
|
|
43
49
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
44
50
|
(0, microservices_1.GrpcMethod)("PromoService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ service PromoService {
|
|
|
8
8
|
rpc CreatePromocode (CreatePromocodeRequest) returns (CreatePromocodeResponse);
|
|
9
9
|
rpc ApplyPromocode (ApplyPromocodeRequest) returns (ApplyPromocodeResponse);
|
|
10
10
|
rpc DeactivatePromocode (DeactivatePromocodeRequest) returns (DeactivatePromocodeResponse);
|
|
11
|
+
rpc DeletePromocode (DeletePromocodeRequest) returns (DeletePromocodeResponse);
|
|
11
12
|
rpc ValidatePromocode (ValidatePromocodeRequest) returns (ValidatePromocodeResponse);
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -44,6 +45,12 @@ message DeactivatePromocodeRequest {
|
|
|
44
45
|
message DeactivatePromocodeResponse {
|
|
45
46
|
bool success = 1;
|
|
46
47
|
}
|
|
48
|
+
message DeletePromocodeRequest {
|
|
49
|
+
string promocode_id = 1;
|
|
50
|
+
}
|
|
51
|
+
message DeletePromocodeResponse {
|
|
52
|
+
bool success = 1;
|
|
53
|
+
}
|
|
47
54
|
|
|
48
55
|
message ValidatePromocodeRequest {
|
|
49
56
|
string code = 1;
|
|
@@ -55,7 +62,6 @@ message ValidatePromocodeResponse {
|
|
|
55
62
|
string discount_amount = 2;
|
|
56
63
|
string error_message = 3;
|
|
57
64
|
DiscountType discount_type = 4;
|
|
58
|
-
string discount_value = 5;
|
|
59
65
|
}
|
|
60
66
|
|
|
61
67
|
enum TargetType {
|