| 2820 |
chandransh |
1 |
namespace java in.shop2020.warehouse
|
|
|
2 |
namespace py shop2020.thriftpy.warehouse
|
|
|
3 |
|
| 3374 |
rajveer |
4 |
include "GenericService.thrift"
|
|
|
5 |
|
| 4496 |
mandeep.dh |
6 |
struct Warehouse {
|
|
|
7 |
1:i64 id,
|
|
|
8 |
2:string displayName,
|
|
|
9 |
3:string location
|
| 2820 |
chandransh |
10 |
}
|
|
|
11 |
|
| 4496 |
mandeep.dh |
12 |
struct InventoryItem {
|
|
|
13 |
1:i64 id,
|
|
|
14 |
2:i64 itemId,
|
|
|
15 |
3:string itemNumber,
|
|
|
16 |
4:string serialNumber,
|
|
|
17 |
5:i64 initialQuantity,
|
|
|
18 |
6:i64 currentQuantity,
|
|
|
19 |
7:i64 purchaseId
|
| 2820 |
chandransh |
20 |
}
|
|
|
21 |
|
| 4496 |
mandeep.dh |
22 |
enum ScanType {
|
|
|
23 |
PURCHASE = 0, // Scan-in at the time of purchase
|
|
|
24 |
SALE = 1, // Scan-out for sale
|
|
|
25 |
SALE_RET = 2, // Scan-in when an item is returned undelivered
|
|
|
26 |
DOA_IN = 3, // Scan-in when an item is returned by the customer with the DOA certificate
|
|
|
27 |
DOA_OUT = 4, // Scan-out to return an item to the supplier
|
|
|
28 |
PURCHASE_RETURN = 5 // Scan-out to return an item to the supplier (a Non-DOA case)
|
| 2820 |
chandransh |
29 |
}
|
|
|
30 |
|
| 4496 |
mandeep.dh |
31 |
struct Scan {
|
|
|
32 |
1:i64 id,
|
|
|
33 |
2:i64 inventoryItemId,
|
|
|
34 |
3:optional i64 quantity, // ignored in case of serialized items
|
|
|
35 |
4:optional i64 orderId, // The order that was fulfilled with thin scan!
|
|
|
36 |
5:i64 warehouseId,
|
|
|
37 |
6:ScanType type,
|
|
|
38 |
7:i64 scannedAt
|
| 2820 |
chandransh |
39 |
}
|
|
|
40 |
|
| 4496 |
mandeep.dh |
41 |
exception WarehouseServiceException {
|
|
|
42 |
1:GenericService.ExceptionType exceptionType,
|
|
|
43 |
2:string message
|
| 2820 |
chandransh |
44 |
}
|
|
|
45 |
|
| 4496 |
mandeep.dh |
46 |
service WarehouseService extends GenericService.GenericService {
|
|
|
47 |
/**
|
|
|
48 |
* Creating inventory for a serialized item
|
|
|
49 |
*/
|
|
|
50 |
i64 createSerializedInventoryItem(1:i64 itemId, 2:string serialNumber, 3:i64 purchaseId) throws (1:WarehouseServiceException wex);
|
| 2820 |
chandransh |
51 |
|
| 4496 |
mandeep.dh |
52 |
/**
|
|
|
53 |
* Creating inventory for a serialized item using item number
|
|
|
54 |
*/
|
|
|
55 |
i64 createSerializedInventoryItemFromItemNumber(1:string itemNumber, 2:string serialNumber, 3:i64 purchaseId) throws (1:WarehouseServiceException wex);
|
| 2820 |
chandransh |
56 |
|
| 4496 |
mandeep.dh |
57 |
/**
|
|
|
58 |
* Creates inventory for an unserailized item
|
|
|
59 |
*/
|
|
|
60 |
i64 createInventoryItem(1:i64 itemId, 2:i64 quantity, 3:i64 purchaseId) throws (1:WarehouseServiceException wex);
|
| 2820 |
chandransh |
61 |
|
| 4496 |
mandeep.dh |
62 |
/**
|
|
|
63 |
* Retrieves serialized inventory item given a serial number
|
|
|
64 |
*/
|
|
|
65 |
InventoryItem getInventoryItem(1:string serialNumber);
|
| 2820 |
chandransh |
66 |
|
| 4496 |
mandeep.dh |
67 |
/**
|
|
|
68 |
* Retrieves non-serialized inventory items from a given supplier
|
|
|
69 |
*/
|
|
|
70 |
list<InventoryItem> getNonSeralizedInventoryItems(1:i64 itemId, 2:i64 quantity, 3:i64 supplierId);
|
| 3383 |
chandransh |
71 |
|
| 4496 |
mandeep.dh |
72 |
/**
|
|
|
73 |
* Retrieves inventory items for a given item
|
|
|
74 |
*/
|
|
|
75 |
list<InventoryItem> getInventoryItems(1:i64 itemId);
|
|
|
76 |
|
|
|
77 |
/**
|
|
|
78 |
* Retrieves scans for a given order
|
|
|
79 |
*/
|
|
|
80 |
list<Scan> getScanForOrder(1:i64 orderId);
|
|
|
81 |
|
|
|
82 |
/**
|
|
|
83 |
* Retrieves scans for a given inventory item
|
|
|
84 |
*/
|
|
|
85 |
list<Scan> getScan(1:i64 inventoryItemId);
|
|
|
86 |
|
|
|
87 |
/**
|
|
|
88 |
* Scan serialized items.
|
|
|
89 |
*/
|
|
|
90 |
void scanSerializedItem(1:i64 inventoryItemId, 2:ScanType type, 3:i64 warehouseId) throws (1:WarehouseServiceException wex);
|
|
|
91 |
|
|
|
92 |
/**
|
|
|
93 |
* Scan non-serialized items.
|
|
|
94 |
*/
|
|
|
95 |
void scan(1:i64 inventoryItemId, 2:ScanType type, 3:i64 quantity, 4:i64 warehouseId) throws (1:WarehouseServiceException wex);
|
|
|
96 |
|
|
|
97 |
/**
|
|
|
98 |
* Scan serialized items linked with an order. Returns its price.
|
|
|
99 |
*/
|
|
|
100 |
i64 scanSerializedItemForOrder(1:i64 inventoryItemId, 2:ScanType type, 3:i64 orderId, 4:i64 warehouseId) throws (1:WarehouseServiceException wex);
|
|
|
101 |
|
|
|
102 |
/**
|
|
|
103 |
* Scan non-serialized items linked with an order.
|
|
|
104 |
*/
|
|
|
105 |
void scanForOrder(1:i64 inventoryItemId, 2:ScanType type, 3:i64 quantity, 4:i64 orderId, 5:i64 warehouseId) throws (1:WarehouseServiceException wex);
|
|
|
106 |
|
|
|
107 |
/**
|
|
|
108 |
* Created item number to item id mapping
|
|
|
109 |
*/
|
|
|
110 |
void createItemNumberMapping(1:string itemNumber, 2:i64 itemId);
|
|
|
111 |
}
|