@mamindom/contracts 1.0.124 → 1.0.126

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.
Files changed (64) hide show
  1. package/dist/events/auth/otp-requested.interface.d.ts +6 -2
  2. package/dist/events/index.d.ts +1 -0
  3. package/dist/events/index.js +1 -0
  4. package/dist/events/orders/order-cancelled.interface.d.ts +7 -0
  5. package/dist/events/orders/order-status-changed.interface.d.ts +9 -0
  6. package/dist/events/stock/index.d.ts +5 -0
  7. package/dist/events/stock/index.js +21 -0
  8. package/dist/events/stock/stock-confirm-requested.interface.d.ts +4 -0
  9. package/dist/events/stock/stock-confirm-requested.interface.js +2 -0
  10. package/dist/events/stock/stock-release-requested.interface.d.ts +9 -0
  11. package/dist/events/stock/stock-release-requested.interface.js +2 -0
  12. package/dist/events/stock/stock-reserve-failed.interface.d.ts +9 -0
  13. package/dist/events/stock/stock-reserve-failed.interface.js +2 -0
  14. package/dist/events/stock/stock-reserve-requested.interface.d.ts +10 -0
  15. package/dist/events/stock/stock-reserve-requested.interface.js +2 -0
  16. package/dist/events/stock/stock-reserved.interface.d.ts +11 -0
  17. package/dist/events/stock/stock-reserved.interface.js +2 -0
  18. package/dist/gen/audit.d.ts +65 -0
  19. package/dist/gen/audit.js +28 -0
  20. package/dist/gen/bonus_settings.d.ts +35 -0
  21. package/dist/gen/bonus_settings.js +28 -0
  22. package/dist/gen/delivery_settings.d.ts +33 -0
  23. package/dist/gen/delivery_settings.js +28 -0
  24. package/dist/gen/manager.d.ts +102 -0
  25. package/dist/gen/manager.js +39 -0
  26. package/dist/gen/notification.d.ts +279 -0
  27. package/dist/gen/notification.js +119 -0
  28. package/dist/gen/product.d.ts +16 -0
  29. package/dist/gen/rbac.d.ts +111 -0
  30. package/dist/gen/rbac.js +37 -0
  31. package/dist/proto/audit.proto +59 -0
  32. package/dist/proto/bonus_settings.proto +35 -0
  33. package/dist/proto/delivery_settings.proto +35 -0
  34. package/dist/proto/manager.proto +88 -0
  35. package/dist/proto/notification.proto +317 -0
  36. package/dist/proto/product.proto +26 -9
  37. package/dist/proto/rbac.proto +109 -0
  38. package/dist/src/proto/paths.d.ts +6 -0
  39. package/dist/src/proto/paths.js +7 -1
  40. package/events/auth/otp-requested.interface.ts +10 -2
  41. package/events/index.ts +1 -0
  42. package/events/orders/order-cancelled.interface.ts +9 -0
  43. package/events/orders/order-status-changed.interface.ts +14 -0
  44. package/events/stock/index.ts +5 -0
  45. package/events/stock/stock-confirm-requested.interface.ts +6 -0
  46. package/events/stock/stock-release-requested.interface.ts +11 -0
  47. package/events/stock/stock-reserve-failed.interface.ts +8 -0
  48. package/events/stock/stock-reserve-requested.interface.ts +16 -0
  49. package/events/stock/stock-reserved.interface.ts +13 -0
  50. package/gen/audit.ts +109 -0
  51. package/gen/bonus_settings.ts +71 -0
  52. package/gen/delivery_settings.ts +69 -0
  53. package/gen/manager.ts +192 -0
  54. package/gen/notification.ts +427 -0
  55. package/gen/product.ts +31 -5
  56. package/gen/rbac.ts +192 -0
  57. package/package.json +1 -1
  58. package/proto/audit.proto +59 -0
  59. package/proto/bonus_settings.proto +35 -0
  60. package/proto/delivery_settings.proto +35 -0
  61. package/proto/manager.proto +88 -0
  62. package/proto/notification.proto +317 -0
  63. package/proto/product.proto +26 -9
  64. package/proto/rbac.proto +109 -0
@@ -0,0 +1,109 @@
1
+ syntax = "proto3";
2
+
3
+ package rbac.v1;
4
+
5
+ service RbacService {
6
+ // Permissions catalog (read-only, seeded).
7
+ rpc ListPermissions(ListPermissionsRequest) returns (ListPermissionsResponse);
8
+
9
+ // Roles CRUD.
10
+ rpc ListRoles(ListRolesRequest) returns (ListRolesResponse);
11
+ rpc GetRole(GetRoleRequest) returns (RbacRole);
12
+ rpc CreateRole(CreateRoleRequest) returns (RbacRole);
13
+ rpc UpdateRole(UpdateRoleRequest) returns (RbacRole);
14
+ rpc DeleteRole(DeleteRoleRequest) returns (DeleteRoleResponse);
15
+
16
+ // Account ↔ role bindings.
17
+ rpc AssignAccountRole(AssignAccountRoleRequest) returns (AssignAccountRoleResponse);
18
+ rpc GetAccountPermissions(GetAccountPermissionsRequest) returns (GetAccountPermissionsResponse);
19
+ }
20
+
21
+ message RbacPermission {
22
+ string id = 1;
23
+ string key = 2;
24
+ string group_key = 3;
25
+ string label = 4;
26
+ string description = 5;
27
+ }
28
+
29
+ message RbacRole {
30
+ string id = 1;
31
+ string slug = 2;
32
+ string name = 3;
33
+ string description = 4;
34
+ string color = 5;
35
+ bool is_system = 6;
36
+ bool is_protected = 7;
37
+ int32 users_count = 8;
38
+ repeated string permission_keys = 9;
39
+ string created_at = 10;
40
+ string updated_at = 11;
41
+ }
42
+
43
+ message ListPermissionsRequest {}
44
+
45
+ message ListPermissionsResponse {
46
+ repeated RbacPermission items = 1;
47
+ }
48
+
49
+ message ListRolesRequest {
50
+ optional string search = 1;
51
+ }
52
+
53
+ message ListRolesResponse {
54
+ repeated RbacRole items = 1;
55
+ }
56
+
57
+ message GetRoleRequest {
58
+ string id = 1;
59
+ }
60
+
61
+ message CreateRoleRequest {
62
+ string slug = 1;
63
+ string name = 2;
64
+ string description = 3;
65
+ string color = 4;
66
+ repeated string permission_keys = 5;
67
+ }
68
+
69
+ message UpdateRoleRequest {
70
+ string id = 1;
71
+ optional string name = 2;
72
+ optional string description = 3;
73
+ optional string color = 4;
74
+ // Якщо передано — повна заміна; якщо не передано — без змін.
75
+ repeated string permission_keys = 5;
76
+ bool replace_permissions = 6;
77
+ }
78
+
79
+ message DeleteRoleRequest {
80
+ string id = 1;
81
+ }
82
+
83
+ message DeleteRoleResponse {
84
+ bool ok = 1;
85
+ }
86
+
87
+ message AssignAccountRoleRequest {
88
+ string account_id = 1;
89
+ // Якщо custom_role_id порожній — користувач відвʼязується від кастомної ролі,
90
+ // і дозволи беруться з системної.
91
+ optional string custom_role_id = 2;
92
+ }
93
+
94
+ message AssignAccountRoleResponse {
95
+ bool ok = 1;
96
+ }
97
+
98
+ message GetAccountPermissionsRequest {
99
+ string account_id = 1;
100
+ }
101
+
102
+ message GetAccountPermissionsResponse {
103
+ // Effective permissions з урахуванням system role + custom role override.
104
+ // Може містити "*" — повний доступ (ADMIN).
105
+ repeated string permission_keys = 1;
106
+ // Слаг ефективної ролі (для UI/labels).
107
+ string role_slug = 2;
108
+ string role_name = 3;
109
+ }
@@ -1,6 +1,8 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
+ readonly RBAC: string;
5
+ readonly AUDIT: string;
4
6
  readonly USERS: string;
5
7
  readonly COMMON: string;
6
8
  readonly CATEGORY: string;
@@ -19,6 +21,7 @@ export declare const PROTO_PATHS: {
19
21
  readonly CALCULATION: string;
20
22
  readonly COUPON: string;
21
23
  readonly PROMOTION: string;
24
+ readonly BONUS_SETTINGS: string;
22
25
  readonly COMMON_POST: string;
23
26
  readonly POST: string;
24
27
  readonly POST_CATEGORY: string;
@@ -31,6 +34,9 @@ export declare const PROTO_PATHS: {
31
34
  readonly SITE_SETTINGS: string;
32
35
  readonly CART: string;
33
36
  readonly ORDER: string;
37
+ readonly MANAGER: string;
34
38
  readonly PAYMENT: string;
35
39
  readonly DELIVERY: string;
40
+ readonly DELIVERY_SETTINGS: string;
41
+ readonly NOTIFICATION: string;
36
42
  };
@@ -5,6 +5,8 @@ const node_path_1 = require("node:path");
5
5
  exports.PROTO_PATHS = {
6
6
  AUTH: (0, node_path_1.join)(__dirname, '../../proto/auth.proto'),
7
7
  ACCOUNT: (0, node_path_1.join)(__dirname, '../../proto/account.proto'),
8
+ RBAC: (0, node_path_1.join)(__dirname, '../../proto/rbac.proto'),
9
+ AUDIT: (0, node_path_1.join)(__dirname, '../../proto/audit.proto'),
8
10
  USERS: (0, node_path_1.join)(__dirname, '../../proto/users.proto'),
9
11
  COMMON: (0, node_path_1.join)(__dirname, '../../proto/common.proto'),
10
12
  CATEGORY: (0, node_path_1.join)(__dirname, '../../proto/category.proto'),
@@ -23,6 +25,7 @@ exports.PROTO_PATHS = {
23
25
  CALCULATION: (0, node_path_1.join)(__dirname, '../../proto/calculation.proto'),
24
26
  COUPON: (0, node_path_1.join)(__dirname, '../../proto/coupon.proto'),
25
27
  PROMOTION: (0, node_path_1.join)(__dirname, '../../proto/promotion.proto'),
28
+ BONUS_SETTINGS: (0, node_path_1.join)(__dirname, '../../proto/bonus_settings.proto'),
26
29
  COMMON_POST: (0, node_path_1.join)(__dirname, '../../proto/common_post.proto'),
27
30
  POST: (0, node_path_1.join)(__dirname, '../../proto/post.proto'),
28
31
  POST_CATEGORY: (0, node_path_1.join)(__dirname, '../../proto/post_category.proto'),
@@ -35,6 +38,9 @@ exports.PROTO_PATHS = {
35
38
  SITE_SETTINGS: (0, node_path_1.join)(__dirname, '../../proto/site_settings.proto'),
36
39
  CART: (0, node_path_1.join)(__dirname, '../../proto/cart.proto'),
37
40
  ORDER: (0, node_path_1.join)(__dirname, '../../proto/order.proto'),
41
+ MANAGER: (0, node_path_1.join)(__dirname, '../../proto/manager.proto'),
38
42
  PAYMENT: (0, node_path_1.join)(__dirname, '../../proto/payment.proto'),
39
- DELIVERY: (0, node_path_1.join)(__dirname, '../../proto/delivery.proto')
43
+ DELIVERY: (0, node_path_1.join)(__dirname, '../../proto/delivery.proto'),
44
+ DELIVERY_SETTINGS: (0, node_path_1.join)(__dirname, '../../proto/delivery_settings.proto'),
45
+ NOTIFICATION: (0, node_path_1.join)(__dirname, '../../proto/notification.proto')
40
46
  };
@@ -1,5 +1,13 @@
1
1
  export interface OtpRequestedEvent {
2
- identifier: string
3
- type: string
2
+ // Target: email або phone (визначається за наявності '@').
3
+ target: string
4
+ // Категорія: 'login' | 'verify' | 'password_reset'.
5
+ purpose: string
4
6
  code: string
7
+ // TTL (ms epoch).
8
+ expiresAt: number
9
+ userId?: string
10
+ // Backward-compat: deprecated alias для target.
11
+ identifier?: string
12
+ type?: string
5
13
  }
package/events/index.ts CHANGED
@@ -2,3 +2,4 @@ export * from './auth'
2
2
  export * from './delivery'
3
3
  export * from './orders'
4
4
  export * from './payments'
5
+ export * from './stock'
@@ -7,4 +7,13 @@ export interface OrderCancelledEvent {
7
7
  wasPaid: boolean
8
8
  releaseStock: boolean
9
9
  cancelledAt: number
10
+
11
+ // Опціональний customer-snapshot для нотифікацій.
12
+ userId?: string
13
+ customer?: {
14
+ firstName: string
15
+ lastName: string
16
+ email: string
17
+ phone: string
18
+ }
10
19
  }
@@ -7,4 +7,18 @@ export interface OrderStatusChangedEvent {
7
7
  actorId?: string
8
8
  actorName?: string
9
9
  changedAt: number
10
+
11
+ // Опціональний customer-snapshot для нотифікацій (щоб
12
+ // notification-service не робив додатковий lookup в order-service).
13
+ userId?: string
14
+ customer?: {
15
+ firstName: string
16
+ lastName: string
17
+ email: string
18
+ phone: string
19
+ }
20
+
21
+ // На переходах у shipped — ТТН + tracking URL.
22
+ trackingNumber?: string
23
+ trackingUrl?: string
10
24
  }
@@ -0,0 +1,5 @@
1
+ export * from './stock-confirm-requested.interface'
2
+ export * from './stock-release-requested.interface'
3
+ export * from './stock-reserve-failed.interface'
4
+ export * from './stock-reserve-requested.interface'
5
+ export * from './stock-reserved.interface'
@@ -0,0 +1,6 @@
1
+ // Подія від order-service: замовлення переходить у packing → catalog
2
+ // списує резерв у реальний OUTGOING рух (підтверджує продаж).
3
+ export interface StockConfirmRequestedEvent {
4
+ orderId: string
5
+ orderNumber: string
6
+ }
@@ -0,0 +1,11 @@
1
+ // Подія від order-service: cancel/відмова → catalog скасовує всі резерви
2
+ // замовлення (по reference_type='order', reference_id=orderId).
3
+ export interface StockReleaseRequestedEvent {
4
+ orderId: string
5
+ orderNumber: string
6
+ items: Array<{
7
+ productId: string
8
+ variantId?: string
9
+ quantity: number
10
+ }>
11
+ }
@@ -0,0 +1,8 @@
1
+ // Подія від catalog-service: catalog НЕ зміг зарезервувати (insufficient
2
+ // stock, product disappeared). Order-service кенселить замовлення з reason.
3
+ export interface StockReserveFailedEvent {
4
+ orderId: string
5
+ orderNumber: string
6
+ reason: string
7
+ missing?: Array<{ productId: string; needed: number }>
8
+ }
@@ -0,0 +1,16 @@
1
+ // Подія від order-service: catalog має зарезервувати stock для замовлення.
2
+ // Catalog сам обирає warehouse(и) (auto-pick first-available, greedy
3
+ // fill через product_warehouses ORDER BY created_at).
4
+ //
5
+ // TTL у мс — після його закінчення UnpaidOrdersCron у order-service
6
+ // автоматично скасує замовлення → catalog отримає stock.release_requested.
7
+ export interface StockReserveRequestedEvent {
8
+ orderId: string
9
+ orderNumber: string
10
+ ttlMs: number
11
+ items: Array<{
12
+ productId: string
13
+ variantId?: string
14
+ quantity: number
15
+ }>
16
+ }
@@ -0,0 +1,13 @@
1
+ // Подія від catalog-service: успішний резерв → order-service зберігає
2
+ // reservationId/reservedUntil у OrderItem (для admin UI і traceability).
3
+ export interface StockReservedEvent {
4
+ orderId: string
5
+ orderNumber: string
6
+ reservedUntil: number
7
+ allocations: Array<{
8
+ productId: string
9
+ variantId?: string
10
+ warehouseId: string
11
+ quantity: number
12
+ }>
13
+ }
package/gen/audit.ts ADDED
@@ -0,0 +1,109 @@
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: audit.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "audit.v1";
12
+
13
+ export interface LogActionRequest {
14
+ actorId?: string | undefined;
15
+ actorName?: string | undefined;
16
+ actorEmail?:
17
+ | string
18
+ | undefined;
19
+ /** e.g. "order.cancelled", "product.price_changed" */
20
+ action: string;
21
+ /** e.g. "order", "product", "role" */
22
+ targetType: string;
23
+ targetId?:
24
+ | string
25
+ | undefined;
26
+ /** human-readable summary */
27
+ summary?:
28
+ | string
29
+ | undefined;
30
+ /** serialized JSON snapshot (small!) */
31
+ beforeJson?: string | undefined;
32
+ afterJson?: string | undefined;
33
+ ip?: string | undefined;
34
+ userAgent?: string | undefined;
35
+ }
36
+
37
+ export interface LogActionResponse {
38
+ ok: boolean;
39
+ }
40
+
41
+ export interface ListAuditRequest {
42
+ page?: number | undefined;
43
+ limit?: number | undefined;
44
+ actorId?: string | undefined;
45
+ targetType?: string | undefined;
46
+ targetId?: string | undefined;
47
+ action?:
48
+ | string
49
+ | undefined;
50
+ /** "orders" matches order.* etc */
51
+ actionGroup?:
52
+ | string
53
+ | undefined;
54
+ /** ISO date */
55
+ from?: string | undefined;
56
+ to?: string | undefined;
57
+ }
58
+
59
+ export interface AuditEntry {
60
+ id: string;
61
+ actorId: string;
62
+ actorName: string;
63
+ actorEmail: string;
64
+ action: string;
65
+ targetType: string;
66
+ targetId: string;
67
+ summary: string;
68
+ beforeJson: string;
69
+ afterJson: string;
70
+ ip: string;
71
+ userAgent: string;
72
+ createdAt: string;
73
+ }
74
+
75
+ export interface ListAuditResponse {
76
+ items: AuditEntry[];
77
+ total: number;
78
+ }
79
+
80
+ export const AUDIT_V1_PACKAGE_NAME = "audit.v1";
81
+
82
+ export interface AuditServiceClient {
83
+ logAction(request: LogActionRequest): Observable<LogActionResponse>;
84
+
85
+ listAudit(request: ListAuditRequest): Observable<ListAuditResponse>;
86
+ }
87
+
88
+ export interface AuditServiceController {
89
+ logAction(request: LogActionRequest): Promise<LogActionResponse> | Observable<LogActionResponse> | LogActionResponse;
90
+
91
+ listAudit(request: ListAuditRequest): Promise<ListAuditResponse> | Observable<ListAuditResponse> | ListAuditResponse;
92
+ }
93
+
94
+ export function AuditServiceControllerMethods() {
95
+ return function (constructor: Function) {
96
+ const grpcMethods: string[] = ["logAction", "listAudit"];
97
+ for (const method of grpcMethods) {
98
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
99
+ GrpcMethod("AuditService", method)(constructor.prototype[method], method, descriptor);
100
+ }
101
+ const grpcStreamMethods: string[] = [];
102
+ for (const method of grpcStreamMethods) {
103
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
104
+ GrpcStreamMethod("AuditService", method)(constructor.prototype[method], method, descriptor);
105
+ }
106
+ };
107
+ }
108
+
109
+ export const AUDIT_SERVICE_NAME = "AuditService";
@@ -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";