@mamindom/contracts 1.0.124 → 1.0.125
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/bonus_settings.d.ts +35 -0
- package/dist/gen/bonus_settings.js +28 -0
- package/dist/gen/delivery_settings.d.ts +33 -0
- package/dist/gen/delivery_settings.js +28 -0
- package/dist/proto/bonus_settings.proto +35 -0
- package/dist/proto/delivery_settings.proto +35 -0
- package/dist/src/proto/paths.d.ts +2 -0
- package/dist/src/proto/paths.js +3 -1
- package/gen/bonus_settings.ts +71 -0
- package/gen/delivery_settings.ts +69 -0
- package/package.json +1 -1
- package/proto/bonus_settings.proto +35 -0
- package/proto/delivery_settings.proto +35 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "promo.v1";
|
|
3
|
+
export interface BonusSettingsResponse {
|
|
4
|
+
/** Курс нарахування бонусів від суми замовлення (0.02 = 2%). */
|
|
5
|
+
earnRate: number;
|
|
6
|
+
/** Курс списання бонусів (1 бонус = N грн, default 1.0). */
|
|
7
|
+
redeemRate: number;
|
|
8
|
+
/** Мінімальна сума замовлення для нарахування бонусів (0 = без обмеження). */
|
|
9
|
+
minOrderForEarn: number;
|
|
10
|
+
/**
|
|
11
|
+
* Максимальний відсоток від суми замовлення, який можна оплатити бонусами
|
|
12
|
+
* (1.0 = до 100%, 0.5 = до 50%; 0 — без обмеження).
|
|
13
|
+
*/
|
|
14
|
+
maxRedeemShare: number;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}
|
|
17
|
+
export interface GetBonusSettingsRequest {
|
|
18
|
+
}
|
|
19
|
+
export interface UpdateBonusSettingsRequest {
|
|
20
|
+
earnRate?: number | undefined;
|
|
21
|
+
redeemRate?: number | undefined;
|
|
22
|
+
minOrderForEarn?: number | undefined;
|
|
23
|
+
maxRedeemShare?: number | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare const PROMO_V1_PACKAGE_NAME = "promo.v1";
|
|
26
|
+
export interface BonusSettingsServiceClient {
|
|
27
|
+
getBonusSettings(request: GetBonusSettingsRequest): Observable<BonusSettingsResponse>;
|
|
28
|
+
updateBonusSettings(request: UpdateBonusSettingsRequest): Observable<BonusSettingsResponse>;
|
|
29
|
+
}
|
|
30
|
+
export interface BonusSettingsServiceController {
|
|
31
|
+
getBonusSettings(request: GetBonusSettingsRequest): Promise<BonusSettingsResponse> | Observable<BonusSettingsResponse> | BonusSettingsResponse;
|
|
32
|
+
updateBonusSettings(request: UpdateBonusSettingsRequest): Promise<BonusSettingsResponse> | Observable<BonusSettingsResponse> | BonusSettingsResponse;
|
|
33
|
+
}
|
|
34
|
+
export declare function BonusSettingsServiceControllerMethods(): (constructor: Function) => void;
|
|
35
|
+
export declare const BONUS_SETTINGS_SERVICE_NAME = "BonusSettingsService";
|
|
@@ -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: bonus_settings.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.BONUS_SETTINGS_SERVICE_NAME = exports.PROMO_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.BonusSettingsServiceControllerMethods = BonusSettingsServiceControllerMethods;
|
|
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 BonusSettingsServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["getBonusSettings", "updateBonusSettings"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("BonusSettingsService", 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)("BonusSettingsService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.BONUS_SETTINGS_SERVICE_NAME = "BonusSettingsService";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "delivery.v1";
|
|
3
|
+
export interface DeliverySettingsResponse {
|
|
4
|
+
/** Дефолтна вага позиції у кг — fallback коли catalog не повертає weight. */
|
|
5
|
+
defaultItemWeightKg: number;
|
|
6
|
+
/** Поріг безкоштовної доставки в грн (0 = вимкнено). */
|
|
7
|
+
freeShippingThreshold: number;
|
|
8
|
+
/** Дефолтна оголошена вартість на одиницю товару у грн (для страхування НП). */
|
|
9
|
+
defaultDeclaredValue: number;
|
|
10
|
+
/** Reference відправника у НП (вибране warehouse адміністратором у settings). */
|
|
11
|
+
npSenderWarehouseRef?: string | undefined;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GetDeliverySettingsRequest {
|
|
15
|
+
}
|
|
16
|
+
export interface UpdateDeliverySettingsRequest {
|
|
17
|
+
defaultItemWeightKg?: number | undefined;
|
|
18
|
+
freeShippingThreshold?: number | undefined;
|
|
19
|
+
defaultDeclaredValue?: number | undefined;
|
|
20
|
+
npSenderWarehouseRef?: string | undefined;
|
|
21
|
+
clearNpSenderWarehouseRef: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const DELIVERY_V1_PACKAGE_NAME = "delivery.v1";
|
|
24
|
+
export interface DeliverySettingsServiceClient {
|
|
25
|
+
getDeliverySettings(request: GetDeliverySettingsRequest): Observable<DeliverySettingsResponse>;
|
|
26
|
+
updateDeliverySettings(request: UpdateDeliverySettingsRequest): Observable<DeliverySettingsResponse>;
|
|
27
|
+
}
|
|
28
|
+
export interface DeliverySettingsServiceController {
|
|
29
|
+
getDeliverySettings(request: GetDeliverySettingsRequest): Promise<DeliverySettingsResponse> | Observable<DeliverySettingsResponse> | DeliverySettingsResponse;
|
|
30
|
+
updateDeliverySettings(request: UpdateDeliverySettingsRequest): Promise<DeliverySettingsResponse> | Observable<DeliverySettingsResponse> | DeliverySettingsResponse;
|
|
31
|
+
}
|
|
32
|
+
export declare function DeliverySettingsServiceControllerMethods(): (constructor: Function) => void;
|
|
33
|
+
export declare const DELIVERY_SETTINGS_SERVICE_NAME = "DeliverySettingsService";
|
|
@@ -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: delivery_settings.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.DELIVERY_SETTINGS_SERVICE_NAME = exports.DELIVERY_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.DeliverySettingsServiceControllerMethods = DeliverySettingsServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "delivery.v1";
|
|
13
|
+
exports.DELIVERY_V1_PACKAGE_NAME = "delivery.v1";
|
|
14
|
+
function DeliverySettingsServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["getDeliverySettings", "updateDeliverySettings"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("DeliverySettingsService", 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)("DeliverySettingsService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.DELIVERY_SETTINGS_SERVICE_NAME = "DeliverySettingsService";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package promo.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
service BonusSettingsService {
|
|
7
|
+
rpc GetBonusSettings (GetBonusSettingsRequest) returns (BonusSettingsResponse);
|
|
8
|
+
rpc UpdateBonusSettings (UpdateBonusSettingsRequest) returns (BonusSettingsResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
message BonusSettingsResponse {
|
|
13
|
+
// Курс нарахування бонусів від суми замовлення (0.02 = 2%).
|
|
14
|
+
double earn_rate = 1;
|
|
15
|
+
// Курс списання бонусів (1 бонус = N грн, default 1.0).
|
|
16
|
+
double redeem_rate = 2;
|
|
17
|
+
// Мінімальна сума замовлення для нарахування бонусів (0 = без обмеження).
|
|
18
|
+
double min_order_for_earn = 3;
|
|
19
|
+
// Максимальний відсоток від суми замовлення, який можна оплатити бонусами
|
|
20
|
+
// (1.0 = до 100%, 0.5 = до 50%; 0 — без обмеження).
|
|
21
|
+
double max_redeem_share = 4;
|
|
22
|
+
|
|
23
|
+
string updated_at = 5;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
message GetBonusSettingsRequest {}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
message UpdateBonusSettingsRequest {
|
|
31
|
+
optional double earn_rate = 1;
|
|
32
|
+
optional double redeem_rate = 2;
|
|
33
|
+
optional double min_order_for_earn = 3;
|
|
34
|
+
optional double max_redeem_share = 4;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package delivery.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
service DeliverySettingsService {
|
|
7
|
+
rpc GetDeliverySettings (GetDeliverySettingsRequest) returns (DeliverySettingsResponse);
|
|
8
|
+
rpc UpdateDeliverySettings (UpdateDeliverySettingsRequest) returns (DeliverySettingsResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
message DeliverySettingsResponse {
|
|
13
|
+
// Дефолтна вага позиції у кг — fallback коли catalog не повертає weight.
|
|
14
|
+
double default_item_weight_kg = 1;
|
|
15
|
+
// Поріг безкоштовної доставки в грн (0 = вимкнено).
|
|
16
|
+
double free_shipping_threshold = 2;
|
|
17
|
+
// Дефолтна оголошена вартість на одиницю товару у грн (для страхування НП).
|
|
18
|
+
double default_declared_value = 3;
|
|
19
|
+
// Reference відправника у НП (вибране warehouse адміністратором у settings).
|
|
20
|
+
optional string np_sender_warehouse_ref = 4;
|
|
21
|
+
|
|
22
|
+
string updated_at = 5;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
message GetDeliverySettingsRequest {}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
message UpdateDeliverySettingsRequest {
|
|
30
|
+
optional double default_item_weight_kg = 1;
|
|
31
|
+
optional double free_shipping_threshold = 2;
|
|
32
|
+
optional double default_declared_value = 3;
|
|
33
|
+
optional string np_sender_warehouse_ref = 4;
|
|
34
|
+
bool clear_np_sender_warehouse_ref = 5;
|
|
35
|
+
}
|
|
@@ -19,6 +19,7 @@ export declare const PROTO_PATHS: {
|
|
|
19
19
|
readonly CALCULATION: string;
|
|
20
20
|
readonly COUPON: string;
|
|
21
21
|
readonly PROMOTION: string;
|
|
22
|
+
readonly BONUS_SETTINGS: string;
|
|
22
23
|
readonly COMMON_POST: string;
|
|
23
24
|
readonly POST: string;
|
|
24
25
|
readonly POST_CATEGORY: string;
|
|
@@ -33,4 +34,5 @@ export declare const PROTO_PATHS: {
|
|
|
33
34
|
readonly ORDER: string;
|
|
34
35
|
readonly PAYMENT: string;
|
|
35
36
|
readonly DELIVERY: string;
|
|
37
|
+
readonly DELIVERY_SETTINGS: string;
|
|
36
38
|
};
|
package/dist/src/proto/paths.js
CHANGED
|
@@ -23,6 +23,7 @@ exports.PROTO_PATHS = {
|
|
|
23
23
|
CALCULATION: (0, node_path_1.join)(__dirname, '../../proto/calculation.proto'),
|
|
24
24
|
COUPON: (0, node_path_1.join)(__dirname, '../../proto/coupon.proto'),
|
|
25
25
|
PROMOTION: (0, node_path_1.join)(__dirname, '../../proto/promotion.proto'),
|
|
26
|
+
BONUS_SETTINGS: (0, node_path_1.join)(__dirname, '../../proto/bonus_settings.proto'),
|
|
26
27
|
COMMON_POST: (0, node_path_1.join)(__dirname, '../../proto/common_post.proto'),
|
|
27
28
|
POST: (0, node_path_1.join)(__dirname, '../../proto/post.proto'),
|
|
28
29
|
POST_CATEGORY: (0, node_path_1.join)(__dirname, '../../proto/post_category.proto'),
|
|
@@ -36,5 +37,6 @@ exports.PROTO_PATHS = {
|
|
|
36
37
|
CART: (0, node_path_1.join)(__dirname, '../../proto/cart.proto'),
|
|
37
38
|
ORDER: (0, node_path_1.join)(__dirname, '../../proto/order.proto'),
|
|
38
39
|
PAYMENT: (0, node_path_1.join)(__dirname, '../../proto/payment.proto'),
|
|
39
|
-
DELIVERY: (0, node_path_1.join)(__dirname, '../../proto/delivery.proto')
|
|
40
|
+
DELIVERY: (0, node_path_1.join)(__dirname, '../../proto/delivery.proto'),
|
|
41
|
+
DELIVERY_SETTINGS: (0, node_path_1.join)(__dirname, '../../proto/delivery_settings.proto')
|
|
40
42
|
};
|
|
@@ -0,0 +1,71 @@
|
|
|
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: bonus_settings.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "promo.v1";
|
|
12
|
+
|
|
13
|
+
export interface BonusSettingsResponse {
|
|
14
|
+
/** Курс нарахування бонусів від суми замовлення (0.02 = 2%). */
|
|
15
|
+
earnRate: number;
|
|
16
|
+
/** Курс списання бонусів (1 бонус = N грн, default 1.0). */
|
|
17
|
+
redeemRate: number;
|
|
18
|
+
/** Мінімальна сума замовлення для нарахування бонусів (0 = без обмеження). */
|
|
19
|
+
minOrderForEarn: number;
|
|
20
|
+
/**
|
|
21
|
+
* Максимальний відсоток від суми замовлення, який можна оплатити бонусами
|
|
22
|
+
* (1.0 = до 100%, 0.5 = до 50%; 0 — без обмеження).
|
|
23
|
+
*/
|
|
24
|
+
maxRedeemShare: number;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface GetBonusSettingsRequest {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface UpdateBonusSettingsRequest {
|
|
32
|
+
earnRate?: number | undefined;
|
|
33
|
+
redeemRate?: number | undefined;
|
|
34
|
+
minOrderForEarn?: number | undefined;
|
|
35
|
+
maxRedeemShare?: number | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const PROMO_V1_PACKAGE_NAME = "promo.v1";
|
|
39
|
+
|
|
40
|
+
export interface BonusSettingsServiceClient {
|
|
41
|
+
getBonusSettings(request: GetBonusSettingsRequest): Observable<BonusSettingsResponse>;
|
|
42
|
+
|
|
43
|
+
updateBonusSettings(request: UpdateBonusSettingsRequest): Observable<BonusSettingsResponse>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface BonusSettingsServiceController {
|
|
47
|
+
getBonusSettings(
|
|
48
|
+
request: GetBonusSettingsRequest,
|
|
49
|
+
): Promise<BonusSettingsResponse> | Observable<BonusSettingsResponse> | BonusSettingsResponse;
|
|
50
|
+
|
|
51
|
+
updateBonusSettings(
|
|
52
|
+
request: UpdateBonusSettingsRequest,
|
|
53
|
+
): Promise<BonusSettingsResponse> | Observable<BonusSettingsResponse> | BonusSettingsResponse;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function BonusSettingsServiceControllerMethods() {
|
|
57
|
+
return function (constructor: Function) {
|
|
58
|
+
const grpcMethods: string[] = ["getBonusSettings", "updateBonusSettings"];
|
|
59
|
+
for (const method of grpcMethods) {
|
|
60
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
61
|
+
GrpcMethod("BonusSettingsService", method)(constructor.prototype[method], method, descriptor);
|
|
62
|
+
}
|
|
63
|
+
const grpcStreamMethods: string[] = [];
|
|
64
|
+
for (const method of grpcStreamMethods) {
|
|
65
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
66
|
+
GrpcStreamMethod("BonusSettingsService", method)(constructor.prototype[method], method, descriptor);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const BONUS_SETTINGS_SERVICE_NAME = "BonusSettingsService";
|
|
@@ -0,0 +1,69 @@
|
|
|
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: delivery_settings.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "delivery.v1";
|
|
12
|
+
|
|
13
|
+
export interface DeliverySettingsResponse {
|
|
14
|
+
/** Дефолтна вага позиції у кг — fallback коли catalog не повертає weight. */
|
|
15
|
+
defaultItemWeightKg: number;
|
|
16
|
+
/** Поріг безкоштовної доставки в грн (0 = вимкнено). */
|
|
17
|
+
freeShippingThreshold: number;
|
|
18
|
+
/** Дефолтна оголошена вартість на одиницю товару у грн (для страхування НП). */
|
|
19
|
+
defaultDeclaredValue: number;
|
|
20
|
+
/** Reference відправника у НП (вибране warehouse адміністратором у settings). */
|
|
21
|
+
npSenderWarehouseRef?: string | undefined;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface GetDeliverySettingsRequest {
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface UpdateDeliverySettingsRequest {
|
|
29
|
+
defaultItemWeightKg?: number | undefined;
|
|
30
|
+
freeShippingThreshold?: number | undefined;
|
|
31
|
+
defaultDeclaredValue?: number | undefined;
|
|
32
|
+
npSenderWarehouseRef?: string | undefined;
|
|
33
|
+
clearNpSenderWarehouseRef: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const DELIVERY_V1_PACKAGE_NAME = "delivery.v1";
|
|
37
|
+
|
|
38
|
+
export interface DeliverySettingsServiceClient {
|
|
39
|
+
getDeliverySettings(request: GetDeliverySettingsRequest): Observable<DeliverySettingsResponse>;
|
|
40
|
+
|
|
41
|
+
updateDeliverySettings(request: UpdateDeliverySettingsRequest): Observable<DeliverySettingsResponse>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface DeliverySettingsServiceController {
|
|
45
|
+
getDeliverySettings(
|
|
46
|
+
request: GetDeliverySettingsRequest,
|
|
47
|
+
): Promise<DeliverySettingsResponse> | Observable<DeliverySettingsResponse> | DeliverySettingsResponse;
|
|
48
|
+
|
|
49
|
+
updateDeliverySettings(
|
|
50
|
+
request: UpdateDeliverySettingsRequest,
|
|
51
|
+
): Promise<DeliverySettingsResponse> | Observable<DeliverySettingsResponse> | DeliverySettingsResponse;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function DeliverySettingsServiceControllerMethods() {
|
|
55
|
+
return function (constructor: Function) {
|
|
56
|
+
const grpcMethods: string[] = ["getDeliverySettings", "updateDeliverySettings"];
|
|
57
|
+
for (const method of grpcMethods) {
|
|
58
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
59
|
+
GrpcMethod("DeliverySettingsService", method)(constructor.prototype[method], method, descriptor);
|
|
60
|
+
}
|
|
61
|
+
const grpcStreamMethods: string[] = [];
|
|
62
|
+
for (const method of grpcStreamMethods) {
|
|
63
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
64
|
+
GrpcStreamMethod("DeliverySettingsService", method)(constructor.prototype[method], method, descriptor);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const DELIVERY_SETTINGS_SERVICE_NAME = "DeliverySettingsService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package promo.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
service BonusSettingsService {
|
|
7
|
+
rpc GetBonusSettings (GetBonusSettingsRequest) returns (BonusSettingsResponse);
|
|
8
|
+
rpc UpdateBonusSettings (UpdateBonusSettingsRequest) returns (BonusSettingsResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
message BonusSettingsResponse {
|
|
13
|
+
// Курс нарахування бонусів від суми замовлення (0.02 = 2%).
|
|
14
|
+
double earn_rate = 1;
|
|
15
|
+
// Курс списання бонусів (1 бонус = N грн, default 1.0).
|
|
16
|
+
double redeem_rate = 2;
|
|
17
|
+
// Мінімальна сума замовлення для нарахування бонусів (0 = без обмеження).
|
|
18
|
+
double min_order_for_earn = 3;
|
|
19
|
+
// Максимальний відсоток від суми замовлення, який можна оплатити бонусами
|
|
20
|
+
// (1.0 = до 100%, 0.5 = до 50%; 0 — без обмеження).
|
|
21
|
+
double max_redeem_share = 4;
|
|
22
|
+
|
|
23
|
+
string updated_at = 5;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
message GetBonusSettingsRequest {}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
message UpdateBonusSettingsRequest {
|
|
31
|
+
optional double earn_rate = 1;
|
|
32
|
+
optional double redeem_rate = 2;
|
|
33
|
+
optional double min_order_for_earn = 3;
|
|
34
|
+
optional double max_redeem_share = 4;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package delivery.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
service DeliverySettingsService {
|
|
7
|
+
rpc GetDeliverySettings (GetDeliverySettingsRequest) returns (DeliverySettingsResponse);
|
|
8
|
+
rpc UpdateDeliverySettings (UpdateDeliverySettingsRequest) returns (DeliverySettingsResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
message DeliverySettingsResponse {
|
|
13
|
+
// Дефолтна вага позиції у кг — fallback коли catalog не повертає weight.
|
|
14
|
+
double default_item_weight_kg = 1;
|
|
15
|
+
// Поріг безкоштовної доставки в грн (0 = вимкнено).
|
|
16
|
+
double free_shipping_threshold = 2;
|
|
17
|
+
// Дефолтна оголошена вартість на одиницю товару у грн (для страхування НП).
|
|
18
|
+
double default_declared_value = 3;
|
|
19
|
+
// Reference відправника у НП (вибране warehouse адміністратором у settings).
|
|
20
|
+
optional string np_sender_warehouse_ref = 4;
|
|
21
|
+
|
|
22
|
+
string updated_at = 5;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
message GetDeliverySettingsRequest {}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
message UpdateDeliverySettingsRequest {
|
|
30
|
+
optional double default_item_weight_kg = 1;
|
|
31
|
+
optional double free_shipping_threshold = 2;
|
|
32
|
+
optional double default_declared_value = 3;
|
|
33
|
+
optional string np_sender_warehouse_ref = 4;
|
|
34
|
+
bool clear_np_sender_warehouse_ref = 5;
|
|
35
|
+
}
|