@sagebox-be/proto-contracts 1.0.17 → 1.0.19
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/interfaces/sagebox.d.ts +85 -1
- package/dist/interfaces/sagebox.js +526 -15
- package/dist/types/sagebox.d.ts +119 -1
- package/dist/types/sagebox.js +950 -124
- package/package.json +1 -1
- package/proto/sagebox.proto +70 -3
|
@@ -129,7 +129,6 @@ export interface ProductSkuInput {
|
|
|
129
129
|
attributeValues: AttributeValueInput[];
|
|
130
130
|
}
|
|
131
131
|
export interface AttributeValueInput {
|
|
132
|
-
attrId: string;
|
|
133
132
|
value: string;
|
|
134
133
|
name: string;
|
|
135
134
|
}
|
|
@@ -170,6 +169,62 @@ export interface RetryEsResponse {
|
|
|
170
169
|
success: boolean;
|
|
171
170
|
error: string;
|
|
172
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* ============================================
|
|
174
|
+
* Inventory Request Messages
|
|
175
|
+
* ============================================
|
|
176
|
+
*/
|
|
177
|
+
export interface CreateStockTransferRequest {
|
|
178
|
+
sourceWarehouseId: string;
|
|
179
|
+
targetWarehouseId: string;
|
|
180
|
+
items: StockTransferItemInput[];
|
|
181
|
+
note: string;
|
|
182
|
+
requestedBy: string;
|
|
183
|
+
}
|
|
184
|
+
export interface ApproveStockTransferRequest {
|
|
185
|
+
transferId: string;
|
|
186
|
+
approvedBy: string;
|
|
187
|
+
}
|
|
188
|
+
export interface RejectStockTransferRequest {
|
|
189
|
+
transferId: string;
|
|
190
|
+
reason: string;
|
|
191
|
+
rejectedBy: string;
|
|
192
|
+
}
|
|
193
|
+
export interface StockTransferItemInput {
|
|
194
|
+
skuId: string;
|
|
195
|
+
quantity: number;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* ============================================
|
|
199
|
+
* Inventory Response Messages
|
|
200
|
+
* ============================================
|
|
201
|
+
*/
|
|
202
|
+
export interface StockTransferResponse {
|
|
203
|
+
transfer: StockTransfer | undefined;
|
|
204
|
+
success: boolean;
|
|
205
|
+
error: string;
|
|
206
|
+
}
|
|
207
|
+
export interface StockTransfer {
|
|
208
|
+
id: string;
|
|
209
|
+
code: string;
|
|
210
|
+
sourceWarehouseId: string;
|
|
211
|
+
targetWarehouseId: string;
|
|
212
|
+
status: string;
|
|
213
|
+
note: string;
|
|
214
|
+
requestedBy: string;
|
|
215
|
+
approvedBy: string;
|
|
216
|
+
approvedAt: string;
|
|
217
|
+
rejectionReason: string;
|
|
218
|
+
createdAt: string;
|
|
219
|
+
updatedAt: string;
|
|
220
|
+
items: StockTransferItem[];
|
|
221
|
+
}
|
|
222
|
+
export interface StockTransferItem {
|
|
223
|
+
id: string;
|
|
224
|
+
transferId: string;
|
|
225
|
+
skuId: string;
|
|
226
|
+
quantity: number;
|
|
227
|
+
}
|
|
173
228
|
export declare const SAGEBOX_PACKAGE_NAME = "sagebox";
|
|
174
229
|
export declare const GetProductsByCategoryIdRequest: MessageFns<GetProductsByCategoryIdRequest>;
|
|
175
230
|
export declare const GetProductByIdRequest: MessageFns<GetProductByIdRequest>;
|
|
@@ -196,6 +251,13 @@ export declare const RetryEsRequest: MessageFns<RetryEsRequest>;
|
|
|
196
251
|
export declare const PublishOutboxResponse: MessageFns<PublishOutboxResponse>;
|
|
197
252
|
export declare const RetryOutboxResponse: MessageFns<RetryOutboxResponse>;
|
|
198
253
|
export declare const RetryEsResponse: MessageFns<RetryEsResponse>;
|
|
254
|
+
export declare const CreateStockTransferRequest: MessageFns<CreateStockTransferRequest>;
|
|
255
|
+
export declare const ApproveStockTransferRequest: MessageFns<ApproveStockTransferRequest>;
|
|
256
|
+
export declare const RejectStockTransferRequest: MessageFns<RejectStockTransferRequest>;
|
|
257
|
+
export declare const StockTransferItemInput: MessageFns<StockTransferItemInput>;
|
|
258
|
+
export declare const StockTransferResponse: MessageFns<StockTransferResponse>;
|
|
259
|
+
export declare const StockTransfer: MessageFns<StockTransfer>;
|
|
260
|
+
export declare const StockTransferItem: MessageFns<StockTransferItem>;
|
|
199
261
|
/**
|
|
200
262
|
* ============================================
|
|
201
263
|
* Product Service
|
|
@@ -268,6 +330,28 @@ export interface ProductOutboxServiceController {
|
|
|
268
330
|
}
|
|
269
331
|
export declare function ProductOutboxServiceControllerMethods(): (constructor: Function) => void;
|
|
270
332
|
export declare const PRODUCT_OUTBOX_SERVICE_NAME = "ProductOutboxService";
|
|
333
|
+
/**
|
|
334
|
+
* ============================================
|
|
335
|
+
* Inventory Service
|
|
336
|
+
* ============================================
|
|
337
|
+
*/
|
|
338
|
+
export interface InventoryServiceClient {
|
|
339
|
+
createStockTransfer(request: CreateStockTransferRequest, metadata?: Metadata): Observable<StockTransferResponse>;
|
|
340
|
+
approveStockTransfer(request: ApproveStockTransferRequest, metadata?: Metadata): Observable<StockTransferResponse>;
|
|
341
|
+
rejectStockTransfer(request: RejectStockTransferRequest, metadata?: Metadata): Observable<StockTransferResponse>;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* ============================================
|
|
345
|
+
* Inventory Service
|
|
346
|
+
* ============================================
|
|
347
|
+
*/
|
|
348
|
+
export interface InventoryServiceController {
|
|
349
|
+
createStockTransfer(request: CreateStockTransferRequest, metadata?: Metadata): Promise<StockTransferResponse> | Observable<StockTransferResponse> | StockTransferResponse;
|
|
350
|
+
approveStockTransfer(request: ApproveStockTransferRequest, metadata?: Metadata): Promise<StockTransferResponse> | Observable<StockTransferResponse> | StockTransferResponse;
|
|
351
|
+
rejectStockTransfer(request: RejectStockTransferRequest, metadata?: Metadata): Promise<StockTransferResponse> | Observable<StockTransferResponse> | StockTransferResponse;
|
|
352
|
+
}
|
|
353
|
+
export declare function InventoryServiceControllerMethods(): (constructor: Function) => void;
|
|
354
|
+
export declare const INVENTORY_SERVICE_NAME = "InventoryService";
|
|
271
355
|
export interface MessageFns<T> {
|
|
272
356
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
273
357
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
// protoc v6.33.2
|
|
6
6
|
// source: sagebox.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.PRODUCT_OUTBOX_SERVICE_NAME = exports.ADDRESS_SERVICE_NAME = exports.PRODUCT_SERVICE_NAME = exports.RetryEsResponse = exports.RetryOutboxResponse = exports.PublishOutboxResponse = exports.RetryEsRequest = exports.RetryOutboxRequest = exports.PublishOutboxRequest = exports.AddressUnit = exports.AttributeValueInput = exports.ProductSkuInput = exports.Media = exports.Sku = exports.Product = exports.GetWardsResponse = exports.GetDistrictsResponse = exports.GetProvincesResponse = exports.GetWardsRequest = exports.GetDistrictsRequest = exports.GetProvincesRequest = exports.SkuResponse = exports.ProductResponse = exports.GetProductsResponse = exports.UpdateSkuRequest = exports.CreateProductRequest = exports.GetProductByIdRequest = exports.GetProductsByCategoryIdRequest = exports.SAGEBOX_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
8
|
+
exports.INVENTORY_SERVICE_NAME = exports.PRODUCT_OUTBOX_SERVICE_NAME = exports.ADDRESS_SERVICE_NAME = exports.PRODUCT_SERVICE_NAME = exports.StockTransferItem = exports.StockTransfer = exports.StockTransferResponse = exports.StockTransferItemInput = exports.RejectStockTransferRequest = exports.ApproveStockTransferRequest = exports.CreateStockTransferRequest = exports.RetryEsResponse = exports.RetryOutboxResponse = exports.PublishOutboxResponse = exports.RetryEsRequest = exports.RetryOutboxRequest = exports.PublishOutboxRequest = exports.AddressUnit = exports.AttributeValueInput = exports.ProductSkuInput = exports.Media = exports.Sku = exports.Product = exports.GetWardsResponse = exports.GetDistrictsResponse = exports.GetProvincesResponse = exports.GetWardsRequest = exports.GetDistrictsRequest = exports.GetProvincesRequest = exports.SkuResponse = exports.ProductResponse = exports.GetProductsResponse = exports.UpdateSkuRequest = exports.CreateProductRequest = exports.GetProductByIdRequest = exports.GetProductsByCategoryIdRequest = exports.SAGEBOX_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
9
|
exports.ProductServiceControllerMethods = ProductServiceControllerMethods;
|
|
10
10
|
exports.AddressServiceControllerMethods = AddressServiceControllerMethods;
|
|
11
11
|
exports.ProductOutboxServiceControllerMethods = ProductOutboxServiceControllerMethods;
|
|
12
|
+
exports.InventoryServiceControllerMethods = InventoryServiceControllerMethods;
|
|
12
13
|
/* eslint-disable */
|
|
13
14
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
14
15
|
const microservices_1 = require("@nestjs/microservices");
|
|
@@ -1118,18 +1119,15 @@ exports.ProductSkuInput = {
|
|
|
1118
1119
|
},
|
|
1119
1120
|
};
|
|
1120
1121
|
function createBaseAttributeValueInput() {
|
|
1121
|
-
return {
|
|
1122
|
+
return { value: '', name: '' };
|
|
1122
1123
|
}
|
|
1123
1124
|
exports.AttributeValueInput = {
|
|
1124
1125
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1125
|
-
if (message.attrId !== '') {
|
|
1126
|
-
writer.uint32(10).string(message.attrId);
|
|
1127
|
-
}
|
|
1128
1126
|
if (message.value !== '') {
|
|
1129
|
-
writer.uint32(
|
|
1127
|
+
writer.uint32(10).string(message.value);
|
|
1130
1128
|
}
|
|
1131
1129
|
if (message.name !== '') {
|
|
1132
|
-
writer.uint32(
|
|
1130
|
+
writer.uint32(18).string(message.name);
|
|
1133
1131
|
}
|
|
1134
1132
|
return writer;
|
|
1135
1133
|
},
|
|
@@ -1144,20 +1142,13 @@ exports.AttributeValueInput = {
|
|
|
1144
1142
|
if (tag !== 10) {
|
|
1145
1143
|
break;
|
|
1146
1144
|
}
|
|
1147
|
-
message.
|
|
1145
|
+
message.value = reader.string();
|
|
1148
1146
|
continue;
|
|
1149
1147
|
}
|
|
1150
1148
|
case 2: {
|
|
1151
1149
|
if (tag !== 18) {
|
|
1152
1150
|
break;
|
|
1153
1151
|
}
|
|
1154
|
-
message.value = reader.string();
|
|
1155
|
-
continue;
|
|
1156
|
-
}
|
|
1157
|
-
case 3: {
|
|
1158
|
-
if (tag !== 26) {
|
|
1159
|
-
break;
|
|
1160
|
-
}
|
|
1161
1152
|
message.name = reader.string();
|
|
1162
1153
|
continue;
|
|
1163
1154
|
}
|
|
@@ -1411,6 +1402,507 @@ exports.RetryEsResponse = {
|
|
|
1411
1402
|
return message;
|
|
1412
1403
|
},
|
|
1413
1404
|
};
|
|
1405
|
+
function createBaseCreateStockTransferRequest() {
|
|
1406
|
+
return {
|
|
1407
|
+
sourceWarehouseId: '',
|
|
1408
|
+
targetWarehouseId: '',
|
|
1409
|
+
items: [],
|
|
1410
|
+
note: '',
|
|
1411
|
+
requestedBy: '',
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
exports.CreateStockTransferRequest = {
|
|
1415
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1416
|
+
if (message.sourceWarehouseId !== '') {
|
|
1417
|
+
writer.uint32(10).string(message.sourceWarehouseId);
|
|
1418
|
+
}
|
|
1419
|
+
if (message.targetWarehouseId !== '') {
|
|
1420
|
+
writer.uint32(18).string(message.targetWarehouseId);
|
|
1421
|
+
}
|
|
1422
|
+
for (const v of message.items) {
|
|
1423
|
+
exports.StockTransferItemInput.encode(v, writer.uint32(26).fork()).join();
|
|
1424
|
+
}
|
|
1425
|
+
if (message.note !== '') {
|
|
1426
|
+
writer.uint32(34).string(message.note);
|
|
1427
|
+
}
|
|
1428
|
+
if (message.requestedBy !== '') {
|
|
1429
|
+
writer.uint32(42).string(message.requestedBy);
|
|
1430
|
+
}
|
|
1431
|
+
return writer;
|
|
1432
|
+
},
|
|
1433
|
+
decode(input, length) {
|
|
1434
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1435
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1436
|
+
const message = createBaseCreateStockTransferRequest();
|
|
1437
|
+
while (reader.pos < end) {
|
|
1438
|
+
const tag = reader.uint32();
|
|
1439
|
+
switch (tag >>> 3) {
|
|
1440
|
+
case 1: {
|
|
1441
|
+
if (tag !== 10) {
|
|
1442
|
+
break;
|
|
1443
|
+
}
|
|
1444
|
+
message.sourceWarehouseId = reader.string();
|
|
1445
|
+
continue;
|
|
1446
|
+
}
|
|
1447
|
+
case 2: {
|
|
1448
|
+
if (tag !== 18) {
|
|
1449
|
+
break;
|
|
1450
|
+
}
|
|
1451
|
+
message.targetWarehouseId = reader.string();
|
|
1452
|
+
continue;
|
|
1453
|
+
}
|
|
1454
|
+
case 3: {
|
|
1455
|
+
if (tag !== 26) {
|
|
1456
|
+
break;
|
|
1457
|
+
}
|
|
1458
|
+
message.items.push(exports.StockTransferItemInput.decode(reader, reader.uint32()));
|
|
1459
|
+
continue;
|
|
1460
|
+
}
|
|
1461
|
+
case 4: {
|
|
1462
|
+
if (tag !== 34) {
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
message.note = reader.string();
|
|
1466
|
+
continue;
|
|
1467
|
+
}
|
|
1468
|
+
case 5: {
|
|
1469
|
+
if (tag !== 42) {
|
|
1470
|
+
break;
|
|
1471
|
+
}
|
|
1472
|
+
message.requestedBy = reader.string();
|
|
1473
|
+
continue;
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1477
|
+
break;
|
|
1478
|
+
}
|
|
1479
|
+
reader.skip(tag & 7);
|
|
1480
|
+
}
|
|
1481
|
+
return message;
|
|
1482
|
+
},
|
|
1483
|
+
};
|
|
1484
|
+
function createBaseApproveStockTransferRequest() {
|
|
1485
|
+
return { transferId: '', approvedBy: '' };
|
|
1486
|
+
}
|
|
1487
|
+
exports.ApproveStockTransferRequest = {
|
|
1488
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1489
|
+
if (message.transferId !== '') {
|
|
1490
|
+
writer.uint32(10).string(message.transferId);
|
|
1491
|
+
}
|
|
1492
|
+
if (message.approvedBy !== '') {
|
|
1493
|
+
writer.uint32(18).string(message.approvedBy);
|
|
1494
|
+
}
|
|
1495
|
+
return writer;
|
|
1496
|
+
},
|
|
1497
|
+
decode(input, length) {
|
|
1498
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1499
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1500
|
+
const message = createBaseApproveStockTransferRequest();
|
|
1501
|
+
while (reader.pos < end) {
|
|
1502
|
+
const tag = reader.uint32();
|
|
1503
|
+
switch (tag >>> 3) {
|
|
1504
|
+
case 1: {
|
|
1505
|
+
if (tag !== 10) {
|
|
1506
|
+
break;
|
|
1507
|
+
}
|
|
1508
|
+
message.transferId = reader.string();
|
|
1509
|
+
continue;
|
|
1510
|
+
}
|
|
1511
|
+
case 2: {
|
|
1512
|
+
if (tag !== 18) {
|
|
1513
|
+
break;
|
|
1514
|
+
}
|
|
1515
|
+
message.approvedBy = reader.string();
|
|
1516
|
+
continue;
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1520
|
+
break;
|
|
1521
|
+
}
|
|
1522
|
+
reader.skip(tag & 7);
|
|
1523
|
+
}
|
|
1524
|
+
return message;
|
|
1525
|
+
},
|
|
1526
|
+
};
|
|
1527
|
+
function createBaseRejectStockTransferRequest() {
|
|
1528
|
+
return { transferId: '', reason: '', rejectedBy: '' };
|
|
1529
|
+
}
|
|
1530
|
+
exports.RejectStockTransferRequest = {
|
|
1531
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1532
|
+
if (message.transferId !== '') {
|
|
1533
|
+
writer.uint32(10).string(message.transferId);
|
|
1534
|
+
}
|
|
1535
|
+
if (message.reason !== '') {
|
|
1536
|
+
writer.uint32(18).string(message.reason);
|
|
1537
|
+
}
|
|
1538
|
+
if (message.rejectedBy !== '') {
|
|
1539
|
+
writer.uint32(26).string(message.rejectedBy);
|
|
1540
|
+
}
|
|
1541
|
+
return writer;
|
|
1542
|
+
},
|
|
1543
|
+
decode(input, length) {
|
|
1544
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1545
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1546
|
+
const message = createBaseRejectStockTransferRequest();
|
|
1547
|
+
while (reader.pos < end) {
|
|
1548
|
+
const tag = reader.uint32();
|
|
1549
|
+
switch (tag >>> 3) {
|
|
1550
|
+
case 1: {
|
|
1551
|
+
if (tag !== 10) {
|
|
1552
|
+
break;
|
|
1553
|
+
}
|
|
1554
|
+
message.transferId = reader.string();
|
|
1555
|
+
continue;
|
|
1556
|
+
}
|
|
1557
|
+
case 2: {
|
|
1558
|
+
if (tag !== 18) {
|
|
1559
|
+
break;
|
|
1560
|
+
}
|
|
1561
|
+
message.reason = reader.string();
|
|
1562
|
+
continue;
|
|
1563
|
+
}
|
|
1564
|
+
case 3: {
|
|
1565
|
+
if (tag !== 26) {
|
|
1566
|
+
break;
|
|
1567
|
+
}
|
|
1568
|
+
message.rejectedBy = reader.string();
|
|
1569
|
+
continue;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1573
|
+
break;
|
|
1574
|
+
}
|
|
1575
|
+
reader.skip(tag & 7);
|
|
1576
|
+
}
|
|
1577
|
+
return message;
|
|
1578
|
+
},
|
|
1579
|
+
};
|
|
1580
|
+
function createBaseStockTransferItemInput() {
|
|
1581
|
+
return { skuId: '', quantity: 0 };
|
|
1582
|
+
}
|
|
1583
|
+
exports.StockTransferItemInput = {
|
|
1584
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1585
|
+
if (message.skuId !== '') {
|
|
1586
|
+
writer.uint32(10).string(message.skuId);
|
|
1587
|
+
}
|
|
1588
|
+
if (message.quantity !== 0) {
|
|
1589
|
+
writer.uint32(16).int32(message.quantity);
|
|
1590
|
+
}
|
|
1591
|
+
return writer;
|
|
1592
|
+
},
|
|
1593
|
+
decode(input, length) {
|
|
1594
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1595
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1596
|
+
const message = createBaseStockTransferItemInput();
|
|
1597
|
+
while (reader.pos < end) {
|
|
1598
|
+
const tag = reader.uint32();
|
|
1599
|
+
switch (tag >>> 3) {
|
|
1600
|
+
case 1: {
|
|
1601
|
+
if (tag !== 10) {
|
|
1602
|
+
break;
|
|
1603
|
+
}
|
|
1604
|
+
message.skuId = reader.string();
|
|
1605
|
+
continue;
|
|
1606
|
+
}
|
|
1607
|
+
case 2: {
|
|
1608
|
+
if (tag !== 16) {
|
|
1609
|
+
break;
|
|
1610
|
+
}
|
|
1611
|
+
message.quantity = reader.int32();
|
|
1612
|
+
continue;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1616
|
+
break;
|
|
1617
|
+
}
|
|
1618
|
+
reader.skip(tag & 7);
|
|
1619
|
+
}
|
|
1620
|
+
return message;
|
|
1621
|
+
},
|
|
1622
|
+
};
|
|
1623
|
+
function createBaseStockTransferResponse() {
|
|
1624
|
+
return { transfer: undefined, success: false, error: '' };
|
|
1625
|
+
}
|
|
1626
|
+
exports.StockTransferResponse = {
|
|
1627
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1628
|
+
if (message.transfer !== undefined) {
|
|
1629
|
+
exports.StockTransfer.encode(message.transfer, writer.uint32(10).fork()).join();
|
|
1630
|
+
}
|
|
1631
|
+
if (message.success !== false) {
|
|
1632
|
+
writer.uint32(16).bool(message.success);
|
|
1633
|
+
}
|
|
1634
|
+
if (message.error !== '') {
|
|
1635
|
+
writer.uint32(26).string(message.error);
|
|
1636
|
+
}
|
|
1637
|
+
return writer;
|
|
1638
|
+
},
|
|
1639
|
+
decode(input, length) {
|
|
1640
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1641
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1642
|
+
const message = createBaseStockTransferResponse();
|
|
1643
|
+
while (reader.pos < end) {
|
|
1644
|
+
const tag = reader.uint32();
|
|
1645
|
+
switch (tag >>> 3) {
|
|
1646
|
+
case 1: {
|
|
1647
|
+
if (tag !== 10) {
|
|
1648
|
+
break;
|
|
1649
|
+
}
|
|
1650
|
+
message.transfer = exports.StockTransfer.decode(reader, reader.uint32());
|
|
1651
|
+
continue;
|
|
1652
|
+
}
|
|
1653
|
+
case 2: {
|
|
1654
|
+
if (tag !== 16) {
|
|
1655
|
+
break;
|
|
1656
|
+
}
|
|
1657
|
+
message.success = reader.bool();
|
|
1658
|
+
continue;
|
|
1659
|
+
}
|
|
1660
|
+
case 3: {
|
|
1661
|
+
if (tag !== 26) {
|
|
1662
|
+
break;
|
|
1663
|
+
}
|
|
1664
|
+
message.error = reader.string();
|
|
1665
|
+
continue;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1669
|
+
break;
|
|
1670
|
+
}
|
|
1671
|
+
reader.skip(tag & 7);
|
|
1672
|
+
}
|
|
1673
|
+
return message;
|
|
1674
|
+
},
|
|
1675
|
+
};
|
|
1676
|
+
function createBaseStockTransfer() {
|
|
1677
|
+
return {
|
|
1678
|
+
id: '',
|
|
1679
|
+
code: '',
|
|
1680
|
+
sourceWarehouseId: '',
|
|
1681
|
+
targetWarehouseId: '',
|
|
1682
|
+
status: '',
|
|
1683
|
+
note: '',
|
|
1684
|
+
requestedBy: '',
|
|
1685
|
+
approvedBy: '',
|
|
1686
|
+
approvedAt: '',
|
|
1687
|
+
rejectionReason: '',
|
|
1688
|
+
createdAt: '',
|
|
1689
|
+
updatedAt: '',
|
|
1690
|
+
items: [],
|
|
1691
|
+
};
|
|
1692
|
+
}
|
|
1693
|
+
exports.StockTransfer = {
|
|
1694
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1695
|
+
if (message.id !== '') {
|
|
1696
|
+
writer.uint32(10).string(message.id);
|
|
1697
|
+
}
|
|
1698
|
+
if (message.code !== '') {
|
|
1699
|
+
writer.uint32(18).string(message.code);
|
|
1700
|
+
}
|
|
1701
|
+
if (message.sourceWarehouseId !== '') {
|
|
1702
|
+
writer.uint32(26).string(message.sourceWarehouseId);
|
|
1703
|
+
}
|
|
1704
|
+
if (message.targetWarehouseId !== '') {
|
|
1705
|
+
writer.uint32(34).string(message.targetWarehouseId);
|
|
1706
|
+
}
|
|
1707
|
+
if (message.status !== '') {
|
|
1708
|
+
writer.uint32(42).string(message.status);
|
|
1709
|
+
}
|
|
1710
|
+
if (message.note !== '') {
|
|
1711
|
+
writer.uint32(50).string(message.note);
|
|
1712
|
+
}
|
|
1713
|
+
if (message.requestedBy !== '') {
|
|
1714
|
+
writer.uint32(58).string(message.requestedBy);
|
|
1715
|
+
}
|
|
1716
|
+
if (message.approvedBy !== '') {
|
|
1717
|
+
writer.uint32(66).string(message.approvedBy);
|
|
1718
|
+
}
|
|
1719
|
+
if (message.approvedAt !== '') {
|
|
1720
|
+
writer.uint32(74).string(message.approvedAt);
|
|
1721
|
+
}
|
|
1722
|
+
if (message.rejectionReason !== '') {
|
|
1723
|
+
writer.uint32(82).string(message.rejectionReason);
|
|
1724
|
+
}
|
|
1725
|
+
if (message.createdAt !== '') {
|
|
1726
|
+
writer.uint32(90).string(message.createdAt);
|
|
1727
|
+
}
|
|
1728
|
+
if (message.updatedAt !== '') {
|
|
1729
|
+
writer.uint32(98).string(message.updatedAt);
|
|
1730
|
+
}
|
|
1731
|
+
for (const v of message.items) {
|
|
1732
|
+
exports.StockTransferItem.encode(v, writer.uint32(106).fork()).join();
|
|
1733
|
+
}
|
|
1734
|
+
return writer;
|
|
1735
|
+
},
|
|
1736
|
+
decode(input, length) {
|
|
1737
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1738
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1739
|
+
const message = createBaseStockTransfer();
|
|
1740
|
+
while (reader.pos < end) {
|
|
1741
|
+
const tag = reader.uint32();
|
|
1742
|
+
switch (tag >>> 3) {
|
|
1743
|
+
case 1: {
|
|
1744
|
+
if (tag !== 10) {
|
|
1745
|
+
break;
|
|
1746
|
+
}
|
|
1747
|
+
message.id = reader.string();
|
|
1748
|
+
continue;
|
|
1749
|
+
}
|
|
1750
|
+
case 2: {
|
|
1751
|
+
if (tag !== 18) {
|
|
1752
|
+
break;
|
|
1753
|
+
}
|
|
1754
|
+
message.code = reader.string();
|
|
1755
|
+
continue;
|
|
1756
|
+
}
|
|
1757
|
+
case 3: {
|
|
1758
|
+
if (tag !== 26) {
|
|
1759
|
+
break;
|
|
1760
|
+
}
|
|
1761
|
+
message.sourceWarehouseId = reader.string();
|
|
1762
|
+
continue;
|
|
1763
|
+
}
|
|
1764
|
+
case 4: {
|
|
1765
|
+
if (tag !== 34) {
|
|
1766
|
+
break;
|
|
1767
|
+
}
|
|
1768
|
+
message.targetWarehouseId = reader.string();
|
|
1769
|
+
continue;
|
|
1770
|
+
}
|
|
1771
|
+
case 5: {
|
|
1772
|
+
if (tag !== 42) {
|
|
1773
|
+
break;
|
|
1774
|
+
}
|
|
1775
|
+
message.status = reader.string();
|
|
1776
|
+
continue;
|
|
1777
|
+
}
|
|
1778
|
+
case 6: {
|
|
1779
|
+
if (tag !== 50) {
|
|
1780
|
+
break;
|
|
1781
|
+
}
|
|
1782
|
+
message.note = reader.string();
|
|
1783
|
+
continue;
|
|
1784
|
+
}
|
|
1785
|
+
case 7: {
|
|
1786
|
+
if (tag !== 58) {
|
|
1787
|
+
break;
|
|
1788
|
+
}
|
|
1789
|
+
message.requestedBy = reader.string();
|
|
1790
|
+
continue;
|
|
1791
|
+
}
|
|
1792
|
+
case 8: {
|
|
1793
|
+
if (tag !== 66) {
|
|
1794
|
+
break;
|
|
1795
|
+
}
|
|
1796
|
+
message.approvedBy = reader.string();
|
|
1797
|
+
continue;
|
|
1798
|
+
}
|
|
1799
|
+
case 9: {
|
|
1800
|
+
if (tag !== 74) {
|
|
1801
|
+
break;
|
|
1802
|
+
}
|
|
1803
|
+
message.approvedAt = reader.string();
|
|
1804
|
+
continue;
|
|
1805
|
+
}
|
|
1806
|
+
case 10: {
|
|
1807
|
+
if (tag !== 82) {
|
|
1808
|
+
break;
|
|
1809
|
+
}
|
|
1810
|
+
message.rejectionReason = reader.string();
|
|
1811
|
+
continue;
|
|
1812
|
+
}
|
|
1813
|
+
case 11: {
|
|
1814
|
+
if (tag !== 90) {
|
|
1815
|
+
break;
|
|
1816
|
+
}
|
|
1817
|
+
message.createdAt = reader.string();
|
|
1818
|
+
continue;
|
|
1819
|
+
}
|
|
1820
|
+
case 12: {
|
|
1821
|
+
if (tag !== 98) {
|
|
1822
|
+
break;
|
|
1823
|
+
}
|
|
1824
|
+
message.updatedAt = reader.string();
|
|
1825
|
+
continue;
|
|
1826
|
+
}
|
|
1827
|
+
case 13: {
|
|
1828
|
+
if (tag !== 106) {
|
|
1829
|
+
break;
|
|
1830
|
+
}
|
|
1831
|
+
message.items.push(exports.StockTransferItem.decode(reader, reader.uint32()));
|
|
1832
|
+
continue;
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1836
|
+
break;
|
|
1837
|
+
}
|
|
1838
|
+
reader.skip(tag & 7);
|
|
1839
|
+
}
|
|
1840
|
+
return message;
|
|
1841
|
+
},
|
|
1842
|
+
};
|
|
1843
|
+
function createBaseStockTransferItem() {
|
|
1844
|
+
return { id: '', transferId: '', skuId: '', quantity: 0 };
|
|
1845
|
+
}
|
|
1846
|
+
exports.StockTransferItem = {
|
|
1847
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1848
|
+
if (message.id !== '') {
|
|
1849
|
+
writer.uint32(10).string(message.id);
|
|
1850
|
+
}
|
|
1851
|
+
if (message.transferId !== '') {
|
|
1852
|
+
writer.uint32(18).string(message.transferId);
|
|
1853
|
+
}
|
|
1854
|
+
if (message.skuId !== '') {
|
|
1855
|
+
writer.uint32(26).string(message.skuId);
|
|
1856
|
+
}
|
|
1857
|
+
if (message.quantity !== 0) {
|
|
1858
|
+
writer.uint32(32).int32(message.quantity);
|
|
1859
|
+
}
|
|
1860
|
+
return writer;
|
|
1861
|
+
},
|
|
1862
|
+
decode(input, length) {
|
|
1863
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1864
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1865
|
+
const message = createBaseStockTransferItem();
|
|
1866
|
+
while (reader.pos < end) {
|
|
1867
|
+
const tag = reader.uint32();
|
|
1868
|
+
switch (tag >>> 3) {
|
|
1869
|
+
case 1: {
|
|
1870
|
+
if (tag !== 10) {
|
|
1871
|
+
break;
|
|
1872
|
+
}
|
|
1873
|
+
message.id = reader.string();
|
|
1874
|
+
continue;
|
|
1875
|
+
}
|
|
1876
|
+
case 2: {
|
|
1877
|
+
if (tag !== 18) {
|
|
1878
|
+
break;
|
|
1879
|
+
}
|
|
1880
|
+
message.transferId = reader.string();
|
|
1881
|
+
continue;
|
|
1882
|
+
}
|
|
1883
|
+
case 3: {
|
|
1884
|
+
if (tag !== 26) {
|
|
1885
|
+
break;
|
|
1886
|
+
}
|
|
1887
|
+
message.skuId = reader.string();
|
|
1888
|
+
continue;
|
|
1889
|
+
}
|
|
1890
|
+
case 4: {
|
|
1891
|
+
if (tag !== 32) {
|
|
1892
|
+
break;
|
|
1893
|
+
}
|
|
1894
|
+
message.quantity = reader.int32();
|
|
1895
|
+
continue;
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1899
|
+
break;
|
|
1900
|
+
}
|
|
1901
|
+
reader.skip(tag & 7);
|
|
1902
|
+
}
|
|
1903
|
+
return message;
|
|
1904
|
+
},
|
|
1905
|
+
};
|
|
1414
1906
|
function ProductServiceControllerMethods() {
|
|
1415
1907
|
return function (constructor) {
|
|
1416
1908
|
const grpcMethods = [
|
|
@@ -1467,6 +1959,25 @@ function ProductOutboxServiceControllerMethods() {
|
|
|
1467
1959
|
};
|
|
1468
1960
|
}
|
|
1469
1961
|
exports.PRODUCT_OUTBOX_SERVICE_NAME = 'ProductOutboxService';
|
|
1962
|
+
function InventoryServiceControllerMethods() {
|
|
1963
|
+
return function (constructor) {
|
|
1964
|
+
const grpcMethods = [
|
|
1965
|
+
'createStockTransfer',
|
|
1966
|
+
'approveStockTransfer',
|
|
1967
|
+
'rejectStockTransfer',
|
|
1968
|
+
];
|
|
1969
|
+
for (const method of grpcMethods) {
|
|
1970
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
1971
|
+
(0, microservices_1.GrpcMethod)('InventoryService', method)(constructor.prototype[method], method, descriptor);
|
|
1972
|
+
}
|
|
1973
|
+
const grpcStreamMethods = [];
|
|
1974
|
+
for (const method of grpcStreamMethods) {
|
|
1975
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
1976
|
+
(0, microservices_1.GrpcStreamMethod)('InventoryService', method)(constructor.prototype[method], method, descriptor);
|
|
1977
|
+
}
|
|
1978
|
+
};
|
|
1979
|
+
}
|
|
1980
|
+
exports.INVENTORY_SERVICE_NAME = 'InventoryService';
|
|
1470
1981
|
function longToNumber(int64) {
|
|
1471
1982
|
const num = globalThis.Number(int64.toString());
|
|
1472
1983
|
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|