@mamindom/contracts 1.0.119 → 1.0.122

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 (76) hide show
  1. package/dist/events/auth/index.d.ts +1 -0
  2. package/dist/events/auth/index.js +17 -0
  3. package/dist/events/auth/otp-requested.interface.d.ts +5 -0
  4. package/dist/events/auth/otp-requested.interface.js +2 -0
  5. package/dist/events/delivery/index.d.ts +2 -0
  6. package/dist/events/delivery/index.js +18 -0
  7. package/dist/events/delivery/shipment-created.interface.d.ts +10 -0
  8. package/dist/events/delivery/shipment-created.interface.js +2 -0
  9. package/dist/events/delivery/shipment-tracked.interface.d.ts +11 -0
  10. package/dist/events/delivery/shipment-tracked.interface.js +2 -0
  11. package/dist/events/index.d.ts +4 -0
  12. package/dist/events/index.js +20 -0
  13. package/dist/events/orders/index.d.ts +3 -0
  14. package/dist/events/orders/index.js +19 -0
  15. package/dist/events/orders/order-cancelled.interface.d.ts +10 -0
  16. package/dist/events/orders/order-cancelled.interface.js +2 -0
  17. package/dist/events/orders/order-created.interface.d.ts +37 -0
  18. package/dist/events/orders/order-created.interface.js +2 -0
  19. package/dist/events/orders/order-status-changed.interface.d.ts +10 -0
  20. package/dist/events/orders/order-status-changed.interface.js +2 -0
  21. package/dist/events/payments/index.d.ts +5 -0
  22. package/dist/events/payments/index.js +21 -0
  23. package/dist/events/payments/payment-cancelled.interface.d.ts +9 -0
  24. package/dist/events/payments/payment-cancelled.interface.js +2 -0
  25. package/dist/events/payments/payment-captured.interface.d.ts +10 -0
  26. package/dist/events/payments/payment-captured.interface.js +2 -0
  27. package/dist/events/payments/payment-failed.interface.d.ts +9 -0
  28. package/dist/events/payments/payment-failed.interface.js +2 -0
  29. package/dist/events/payments/payment-held.interface.d.ts +9 -0
  30. package/dist/events/payments/payment-held.interface.js +2 -0
  31. package/dist/events/payments/payment-refunded.interface.d.ts +12 -0
  32. package/dist/events/payments/payment-refunded.interface.js +2 -0
  33. package/dist/gen/cart.d.ts +248 -0
  34. package/dist/gen/cart.js +49 -0
  35. package/dist/gen/delivery.d.ts +165 -0
  36. package/dist/gen/delivery.js +36 -0
  37. package/dist/gen/order.d.ts +275 -0
  38. package/dist/gen/order.js +45 -0
  39. package/dist/gen/payment.d.ts +146 -0
  40. package/dist/gen/payment.js +39 -0
  41. package/dist/gen/site_settings.d.ts +33 -0
  42. package/dist/gen/site_settings.js +28 -0
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.js +17 -0
  45. package/dist/proto/cart.proto +269 -0
  46. package/dist/proto/delivery.proto +184 -0
  47. package/dist/proto/order.proto +308 -0
  48. package/dist/proto/payment.proto +153 -0
  49. package/dist/proto/site_settings.proto +38 -0
  50. package/dist/src/proto/paths.d.ts +5 -0
  51. package/dist/src/proto/paths.js +6 -1
  52. package/events/delivery/index.ts +2 -0
  53. package/events/delivery/shipment-created.interface.ts +10 -0
  54. package/events/delivery/shipment-tracked.interface.ts +11 -0
  55. package/events/index.ts +3 -0
  56. package/events/orders/index.ts +3 -0
  57. package/events/orders/order-cancelled.interface.ts +10 -0
  58. package/events/orders/order-created.interface.ts +37 -0
  59. package/events/orders/order-status-changed.interface.ts +10 -0
  60. package/events/payments/index.ts +5 -0
  61. package/events/payments/payment-cancelled.interface.ts +9 -0
  62. package/events/payments/payment-captured.interface.ts +10 -0
  63. package/events/payments/payment-failed.interface.ts +9 -0
  64. package/events/payments/payment-held.interface.ts +9 -0
  65. package/events/payments/payment-refunded.interface.ts +12 -0
  66. package/gen/cart.ts +376 -0
  67. package/gen/delivery.ts +241 -0
  68. package/gen/order.ts +392 -0
  69. package/gen/payment.ts +239 -0
  70. package/gen/site_settings.ts +69 -0
  71. package/package.json +1 -1
  72. package/proto/cart.proto +269 -0
  73. package/proto/delivery.proto +184 -0
  74. package/proto/order.proto +308 -0
  75. package/proto/payment.proto +153 -0
  76. package/proto/site_settings.proto +38 -0
@@ -0,0 +1,39 @@
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: payment.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PAYMENT_SERVICE_NAME = exports.PAYMENT_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.PaymentServiceControllerMethods = PaymentServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "payment.v1";
13
+ exports.PAYMENT_V1_PACKAGE_NAME = "payment.v1";
14
+ function PaymentServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = [
17
+ "createInvoice",
18
+ "getPayment",
19
+ "getPaymentByOrder",
20
+ "listPayments",
21
+ "capture",
22
+ "cancel",
23
+ "refund",
24
+ "syncStatus",
25
+ "listProviders",
26
+ "toggleProvider",
27
+ ];
28
+ for (const method of grpcMethods) {
29
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
30
+ (0, microservices_1.GrpcMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
31
+ }
32
+ const grpcStreamMethods = [];
33
+ for (const method of grpcStreamMethods) {
34
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
35
+ (0, microservices_1.GrpcStreamMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
36
+ }
37
+ };
38
+ }
39
+ exports.PAYMENT_SERVICE_NAME = "PaymentService";
@@ -0,0 +1,33 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "content.v1";
3
+ export interface SiteSettingsResponse {
4
+ supportEmail: string;
5
+ phone: string;
6
+ instagramUrl?: string | undefined;
7
+ facebookUrl?: string | undefined;
8
+ telegramUrl?: string | undefined;
9
+ updatedAt: string;
10
+ }
11
+ export interface GetSiteSettingsRequest {
12
+ }
13
+ export interface UpdateSiteSettingsRequest {
14
+ supportEmail?: string | undefined;
15
+ phone?: string | undefined;
16
+ instagramUrl?: string | undefined;
17
+ facebookUrl?: string | undefined;
18
+ telegramUrl?: string | undefined;
19
+ clearInstagramUrl: boolean;
20
+ clearFacebookUrl: boolean;
21
+ clearTelegramUrl: boolean;
22
+ }
23
+ export declare const CONTENT_V1_PACKAGE_NAME = "content.v1";
24
+ export interface SettingsServiceClient {
25
+ getSiteSettings(request: GetSiteSettingsRequest): Observable<SiteSettingsResponse>;
26
+ updateSiteSettings(request: UpdateSiteSettingsRequest): Observable<SiteSettingsResponse>;
27
+ }
28
+ export interface SettingsServiceController {
29
+ getSiteSettings(request: GetSiteSettingsRequest): Promise<SiteSettingsResponse> | Observable<SiteSettingsResponse> | SiteSettingsResponse;
30
+ updateSiteSettings(request: UpdateSiteSettingsRequest): Promise<SiteSettingsResponse> | Observable<SiteSettingsResponse> | SiteSettingsResponse;
31
+ }
32
+ export declare function SettingsServiceControllerMethods(): (constructor: Function) => void;
33
+ export declare const SETTINGS_SERVICE_NAME = "SettingsService";
@@ -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: site_settings.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.SETTINGS_SERVICE_NAME = exports.CONTENT_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.SettingsServiceControllerMethods = SettingsServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "content.v1";
13
+ exports.CONTENT_V1_PACKAGE_NAME = "content.v1";
14
+ function SettingsServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["getSiteSettings", "updateSiteSettings"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("SettingsService", 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)("SettingsService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.SETTINGS_SERVICE_NAME = "SettingsService";
@@ -0,0 +1 @@
1
+ export * from './events';
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./events"), exports);
@@ -0,0 +1,269 @@
1
+ syntax = "proto3";
2
+
3
+ package cart.v1;
4
+
5
+ service CartService {
6
+ rpc GetCart(GetCartRequest) returns (CartResponse);
7
+
8
+ rpc AddItem(AddItemRequest) returns (CartResponse);
9
+ rpc UpdateItemQty(UpdateItemQtyRequest) returns (CartResponse);
10
+ rpc RemoveItem(RemoveItemRequest) returns (CartResponse);
11
+ rpc ClearCart(ClearCartRequest) returns (SuccessResponse);
12
+
13
+ rpc ApplyPromo(ApplyPromoRequest) returns (CartResponse);
14
+ rpc RemovePromo(RemovePromoRequest) returns (CartResponse);
15
+
16
+ // ApplyCertificate — поки stub. Реальна перевірка номіналу/балансу
17
+ // потребує синхронізації з 1С (фаза інтеграцій).
18
+ rpc ApplyCertificate(ApplyCertificateRequest) returns (CartResponse);
19
+ rpc RemoveCertificate(RemoveCertificateRequest) returns (CartResponse);
20
+
21
+ rpc ApplyBonuses(ApplyBonusesRequest) returns (CartResponse);
22
+ rpc RemoveBonuses(RemoveBonusesRequest) returns (CartResponse);
23
+
24
+ rpc SetRecipient(SetRecipientRequest) returns (CartResponse);
25
+ rpc SetDeliveryDraft(SetDeliveryDraftRequest) returns (CartResponse);
26
+ rpc SetPaymentDraft(SetPaymentDraftRequest) returns (CartResponse);
27
+ rpc SetComment(SetCommentRequest) returns (CartResponse);
28
+
29
+ rpc Recalculate(RecalculateRequest) returns (CartResponse);
30
+
31
+ rpc MergeGuestToUser(MergeGuestToUserRequest) returns (CartResponse);
32
+
33
+ rpc AddToWishlist(WishlistItemRequest) returns (WishlistResponse);
34
+ rpc RemoveFromWishlist(WishlistItemRequest) returns (WishlistResponse);
35
+ rpc GetWishlist(WishlistOwnerRequest) returns (WishlistResponse);
36
+ }
37
+
38
+ // ─── Cart core ──────────────────────────────────────────────────
39
+
40
+ message CartItem {
41
+ string product_id = 1;
42
+ string variant_id = 2;
43
+ string color_id = 3;
44
+ string sku = 4;
45
+ string name = 5;
46
+ string image_url = 6;
47
+ string slug = 7;
48
+ string category_id = 8;
49
+ string brand_id = 9;
50
+ int32 quantity = 10;
51
+ double price = 11;
52
+ double price_old = 12;
53
+ double line_subtotal = 13;
54
+ double line_discount = 14;
55
+ double line_total = 15;
56
+ }
57
+
58
+ message AppliedPromotion {
59
+ string promotion_id = 1;
60
+ string promotion_name = 2;
61
+ double discount_amount = 3;
62
+ }
63
+
64
+ message AppliedCoupon {
65
+ string coupon_id = 1;
66
+ string code = 2;
67
+ string promotion_id = 3;
68
+ double discount_amount = 4;
69
+ }
70
+
71
+ message AppliedCertificate {
72
+ string code = 1;
73
+ double nominal = 2;
74
+ double balance = 3;
75
+ double applied = 4;
76
+ bool verified = 5;
77
+ string error = 6;
78
+ }
79
+
80
+ message AppliedBonuses {
81
+ double available = 1;
82
+ double applied = 2;
83
+ }
84
+
85
+ message Recipient {
86
+ bool is_different_from_customer = 1;
87
+ string first_name = 2;
88
+ string last_name = 3;
89
+ string phone = 4;
90
+ string email = 5;
91
+ }
92
+
93
+ message DeliveryDraft {
94
+ string method = 1;
95
+ string city_ref = 2;
96
+ string city_name = 3;
97
+ string warehouse_ref = 4;
98
+ string warehouse_name = 5;
99
+ string address = 6;
100
+ string pickup_point_id = 7;
101
+ double cost = 8;
102
+ bool free_shipping = 9;
103
+ }
104
+
105
+ message PaymentDraft {
106
+ string provider = 1;
107
+ }
108
+
109
+ message CartTotals {
110
+ double items_subtotal = 1;
111
+ double promo_discount = 2;
112
+ double coupon_discount = 3;
113
+ double certificate_applied = 4;
114
+ double bonuses_applied = 5;
115
+ double shipping_cost = 6;
116
+ double grand_total = 7;
117
+ double bonuses_to_earn = 8;
118
+ }
119
+
120
+ message Cart {
121
+ string cart_id = 1;
122
+ string user_id = 2;
123
+ string guest_id = 3;
124
+ repeated CartItem items = 4;
125
+ repeated AppliedPromotion applied_promotions = 5;
126
+ repeated AppliedCoupon applied_coupons = 6;
127
+ repeated string promo_codes = 7;
128
+ AppliedCertificate certificate = 8;
129
+ AppliedBonuses bonuses = 9;
130
+ Recipient recipient = 10;
131
+ DeliveryDraft delivery = 11;
132
+ PaymentDraft payment = 12;
133
+ string comment = 13;
134
+ bool do_not_call = 14;
135
+ CartTotals totals = 15;
136
+ int64 updated_at = 16;
137
+ int64 expires_at = 17;
138
+ }
139
+
140
+ // ─── Wishlist ───────────────────────────────────────────────────
141
+
142
+ message WishlistItem {
143
+ string product_id = 1;
144
+ string variant_id = 2;
145
+ string sku = 3;
146
+ string name = 4;
147
+ string image_url = 5;
148
+ string slug = 6;
149
+ double price = 7;
150
+ bool in_stock = 8;
151
+ int64 added_at = 9;
152
+ }
153
+
154
+ message WishlistResponse {
155
+ repeated WishlistItem items = 1;
156
+ }
157
+
158
+ // ─── Requests ───────────────────────────────────────────────────
159
+
160
+ message CartOwner {
161
+ string user_id = 1;
162
+ string guest_id = 2;
163
+ }
164
+
165
+ message GetCartRequest {
166
+ CartOwner owner = 1;
167
+ }
168
+
169
+ message ClearCartRequest {
170
+ CartOwner owner = 1;
171
+ }
172
+
173
+ message AddItemRequest {
174
+ CartOwner owner = 1;
175
+ string product_id = 2;
176
+ string variant_id = 3;
177
+ int32 quantity = 4;
178
+ }
179
+
180
+ message UpdateItemQtyRequest {
181
+ CartOwner owner = 1;
182
+ string variant_id = 2;
183
+ int32 quantity = 3;
184
+ }
185
+
186
+ message RemoveItemRequest {
187
+ CartOwner owner = 1;
188
+ string variant_id = 2;
189
+ }
190
+
191
+ message ApplyPromoRequest {
192
+ CartOwner owner = 1;
193
+ string code = 2;
194
+ }
195
+
196
+ message RemovePromoRequest {
197
+ CartOwner owner = 1;
198
+ string code = 2;
199
+ }
200
+
201
+ message ApplyCertificateRequest {
202
+ CartOwner owner = 1;
203
+ string code = 2;
204
+ }
205
+
206
+ message RemoveCertificateRequest {
207
+ CartOwner owner = 1;
208
+ }
209
+
210
+ message ApplyBonusesRequest {
211
+ CartOwner owner = 1;
212
+ double amount = 2;
213
+ }
214
+
215
+ message RemoveBonusesRequest {
216
+ CartOwner owner = 1;
217
+ }
218
+
219
+ message SetRecipientRequest {
220
+ CartOwner owner = 1;
221
+ Recipient recipient = 2;
222
+ }
223
+
224
+ message SetDeliveryDraftRequest {
225
+ CartOwner owner = 1;
226
+ DeliveryDraft delivery = 2;
227
+ }
228
+
229
+ message SetPaymentDraftRequest {
230
+ CartOwner owner = 1;
231
+ PaymentDraft payment = 2;
232
+ }
233
+
234
+ message SetCommentRequest {
235
+ CartOwner owner = 1;
236
+ string comment = 2;
237
+ bool do_not_call = 3;
238
+ }
239
+
240
+ message RecalculateRequest {
241
+ CartOwner owner = 1;
242
+ }
243
+
244
+ message MergeGuestToUserRequest {
245
+ string guest_id = 1;
246
+ string user_id = 2;
247
+ }
248
+
249
+ message WishlistOwnerRequest {
250
+ string user_id = 1;
251
+ }
252
+
253
+ message WishlistItemRequest {
254
+ string user_id = 1;
255
+ string product_id = 2;
256
+ string variant_id = 3;
257
+ }
258
+
259
+ // ─── Responses ──────────────────────────────────────────────────
260
+
261
+ message CartResponse {
262
+ bool ok = 1;
263
+ Cart cart = 2;
264
+ string error_message = 3;
265
+ }
266
+
267
+ message SuccessResponse {
268
+ bool ok = 1;
269
+ }
@@ -0,0 +1,184 @@
1
+ syntax = "proto3";
2
+
3
+ package delivery.v1;
4
+
5
+ service DeliveryService {
6
+ rpc SearchCities(SearchCitiesRequest) returns (SearchCitiesResponse);
7
+ rpc ListWarehouses(ListWarehousesRequest) returns (ListWarehousesResponse);
8
+
9
+ rpc CalculateShippingCost(CalculateRequest) returns (CalculateResponse);
10
+
11
+ rpc CreateShipment(CreateShipmentRequest) returns (ShipmentResponse);
12
+ rpc CancelShipment(CancelShipmentRequest) returns (ShipmentResponse);
13
+ rpc TrackShipment(TrackRequest) returns (TrackResponse);
14
+
15
+ rpc ListShipments(ListShipmentsRequest) returns (ListShipmentsResponse);
16
+ }
17
+
18
+ // ─── Domain ────────────────────────────────────────────────────
19
+
20
+ // carrier: nova_poshta | ukrposhta | pickup | courier
21
+ // method: warehouse | postomat | address | pickup
22
+
23
+ message City {
24
+ string ref = 1;
25
+ string carrier = 2;
26
+ string name = 3;
27
+ string name_ru = 4;
28
+ string region = 5;
29
+ string area_ref = 6;
30
+ string settlement_type = 7;
31
+ }
32
+
33
+ message Warehouse {
34
+ string ref = 1;
35
+ string carrier = 2;
36
+ string city_ref = 3;
37
+ string number = 4;
38
+ string name = 5;
39
+ string short_address = 6;
40
+ string type = 7;
41
+ string schedule = 8;
42
+ double max_weight_kg = 9;
43
+ bool postomat = 10;
44
+ double lat = 11;
45
+ double lng = 12;
46
+ }
47
+
48
+ message Shipment {
49
+ string id = 1;
50
+ string order_id = 2;
51
+ string carrier = 3;
52
+ string method = 4;
53
+ string ttn = 5;
54
+ string status = 6;
55
+ string tracking_url = 7;
56
+ string sender_city = 8;
57
+ string sender_warehouse = 9;
58
+ string recipient_name = 10;
59
+ string recipient_phone = 11;
60
+ string recipient_city_ref = 12;
61
+ string recipient_warehouse_ref = 13;
62
+ string recipient_address = 14;
63
+ double cost = 15;
64
+ double weight_kg = 16;
65
+ string description = 17;
66
+ string estimated_date = 18;
67
+ int64 created_at = 19;
68
+ int64 updated_at = 20;
69
+ }
70
+
71
+ message ShipmentParcelItem {
72
+ string sku = 1;
73
+ string name = 2;
74
+ int32 qty = 3;
75
+ double price = 4;
76
+ double weight_kg = 5;
77
+ }
78
+
79
+ // ─── Requests ──────────────────────────────────────────────────
80
+
81
+ message SearchCitiesRequest {
82
+ string carrier = 1;
83
+ string query = 2;
84
+ int32 limit = 3;
85
+ }
86
+
87
+ message SearchCitiesResponse {
88
+ repeated City items = 1;
89
+ }
90
+
91
+ message ListWarehousesRequest {
92
+ string carrier = 1;
93
+ string city_ref = 2;
94
+ string type = 3; // warehouse | postomat | both
95
+ string query = 4;
96
+ int32 limit = 5;
97
+ }
98
+
99
+ message ListWarehousesResponse {
100
+ repeated Warehouse items = 1;
101
+ }
102
+
103
+ message CalculateRequest {
104
+ string carrier = 1;
105
+ string method = 2;
106
+ string sender_city = 3;
107
+ string recipient_city = 4;
108
+ double weight_kg = 5;
109
+ double declared_value = 6;
110
+ string service_type = 7;
111
+ }
112
+
113
+ message CalculateResponse {
114
+ bool ok = 1;
115
+ double cost = 2;
116
+ string currency = 3;
117
+ string estimated_date = 4;
118
+ string error_message = 5;
119
+ }
120
+
121
+ message CreateShipmentRequest {
122
+ string order_id = 1;
123
+ string carrier = 2;
124
+ string method = 3;
125
+
126
+ string recipient_name = 4;
127
+ string recipient_phone = 5;
128
+ string recipient_email = 6;
129
+ string recipient_city_ref = 7;
130
+ string recipient_city_name = 8;
131
+ string recipient_warehouse_ref = 9;
132
+ string recipient_warehouse_name = 10;
133
+ string recipient_address = 11;
134
+
135
+ string description = 12;
136
+ double weight_kg = 13;
137
+ double declared_value = 14;
138
+ bool cash_on_delivery = 15;
139
+ double cod_amount = 16;
140
+
141
+ repeated ShipmentParcelItem items = 17;
142
+ }
143
+
144
+ message CancelShipmentRequest {
145
+ string id = 1;
146
+ string reason = 2;
147
+ }
148
+
149
+ message TrackRequest {
150
+ string carrier = 1;
151
+ string ttn = 2;
152
+ }
153
+
154
+ message TrackResponse {
155
+ bool ok = 1;
156
+ string status = 2;
157
+ string status_label = 3;
158
+ string last_event = 4;
159
+ int64 last_event_at = 5;
160
+ string tracking_url = 6;
161
+ string error_message = 7;
162
+ }
163
+
164
+ message ListShipmentsRequest {
165
+ int32 page = 1;
166
+ int32 limit = 2;
167
+ string carrier = 3;
168
+ string status = 4;
169
+ string order_id = 5;
170
+ }
171
+
172
+ message ListShipmentsResponse {
173
+ repeated Shipment items = 1;
174
+ int32 total_items = 2;
175
+ int32 total_pages = 3;
176
+ int32 current_page = 4;
177
+ int32 per_page = 5;
178
+ }
179
+
180
+ message ShipmentResponse {
181
+ bool ok = 1;
182
+ Shipment shipment = 2;
183
+ string error_message = 3;
184
+ }