| 2820 |
chandransh |
1 |
namespace java in.shop2020.warehouse
|
|
|
2 |
namespace py shop2020.thriftpy.warehouse
|
|
|
3 |
|
| 3374 |
rajveer |
4 |
include "GenericService.thrift"
|
|
|
5 |
|
| 5185 |
mandeep.dh |
6 |
enum ScanType {
|
|
|
7 |
PURCHASE = 0, // Scan-in at the time of purchase
|
|
|
8 |
SALE = 1, // Scan-out for sale
|
|
|
9 |
SALE_RET = 2, // Scan-in when an item is returned undelivered
|
|
|
10 |
DOA_IN = 3, // Scan-in when an item is returned by the customer with the DOA certificate
|
|
|
11 |
DOA_OUT = 4, // Scan-out to return an item to the supplier
|
|
|
12 |
PURCHASE_RETURN = 5, // Scan-out to return an item to the supplier (a Non-DOA case)
|
|
|
13 |
SALE_RET_UNUSABLE = 6,
|
|
|
14 |
LOST_IN_TRANSIT = 7,
|
|
|
15 |
DOA_REPLACED = 8
|
|
|
16 |
}
|
|
|
17 |
|
| 4496 |
mandeep.dh |
18 |
struct InventoryItem {
|
| 5185 |
mandeep.dh |
19 |
// primary fields
|
| 4496 |
mandeep.dh |
20 |
1:i64 id,
|
|
|
21 |
2:i64 itemId,
|
|
|
22 |
3:string itemNumber,
|
|
|
23 |
4:string serialNumber,
|
|
|
24 |
5:i64 initialQuantity,
|
|
|
25 |
6:i64 currentQuantity,
|
| 4555 |
mandeep.dh |
26 |
7:i64 purchaseId,
|
|
|
27 |
|
|
|
28 |
// derived fields for efficient lookups
|
|
|
29 |
8:i64 supplierId,
|
| 5185 |
mandeep.dh |
30 |
9:double unitPrice,
|
|
|
31 |
10:i64 currentWarehouseId,
|
|
|
32 |
11:ScanType lastScanType
|
| 2820 |
chandransh |
33 |
}
|
|
|
34 |
|
| 4496 |
mandeep.dh |
35 |
struct Scan {
|
|
|
36 |
1:i64 id,
|
|
|
37 |
2:i64 inventoryItemId,
|
|
|
38 |
3:optional i64 quantity, // ignored in case of serialized items
|
|
|
39 |
4:optional i64 orderId, // The order that was fulfilled with thin scan!
|
|
|
40 |
5:i64 warehouseId,
|
|
|
41 |
6:ScanType type,
|
|
|
42 |
7:i64 scannedAt
|
| 2820 |
chandransh |
43 |
}
|
|
|
44 |
|
| 5372 |
mandeep.dh |
45 |
struct DetailedPurchaseScan {
|
|
|
46 |
1:i64 purchaseOrderId,
|
|
|
47 |
2:i64 poCreatedAt,
|
|
|
48 |
3:string supplierName,
|
|
|
49 |
4:string invoiceNumbers,
|
|
|
50 |
5:i64 itemId,
|
| 5545 |
mandeep.dh |
51 |
6:string brand,
|
|
|
52 |
7:string modelName,
|
|
|
53 |
8:string modelNumber,
|
|
|
54 |
9:string color,
|
|
|
55 |
10:double unitPrice,
|
|
|
56 |
11:i64 quantity
|
| 5372 |
mandeep.dh |
57 |
}
|
|
|
58 |
|
| 5496 |
mandeep.dh |
59 |
struct InvoiceScan {
|
|
|
60 |
1:string invoiceNumber,
|
|
|
61 |
2:i64 numItems,
|
|
|
62 |
3:string supplierName,
|
|
|
63 |
4:i64 date,
|
|
|
64 |
5:i64 scannedQuantity
|
|
|
65 |
}
|
|
|
66 |
|
| 5711 |
mandeep.dh |
67 |
struct InventoryAge {
|
|
|
68 |
1:i64 itemId,
|
|
|
69 |
2:string brand,
|
|
|
70 |
3:string modelName,
|
|
|
71 |
4:string modelNumber,
|
|
|
72 |
5:string color,
|
|
|
73 |
6:i64 freshCount,
|
|
|
74 |
7:i64 oneToTwoCount,
|
|
|
75 |
8:i64 TwoToThreeCount,
|
|
|
76 |
9:i64 ThreeToFourCount,
|
|
|
77 |
10:i64 FourPlusCount
|
|
|
78 |
}
|
|
|
79 |
|
| 4496 |
mandeep.dh |
80 |
exception WarehouseServiceException {
|
|
|
81 |
1:GenericService.ExceptionType exceptionType,
|
|
|
82 |
2:string message
|
| 2820 |
chandransh |
83 |
}
|
|
|
84 |
|
| 4496 |
mandeep.dh |
85 |
service WarehouseService extends GenericService.GenericService {
|
|
|
86 |
/**
|
|
|
87 |
* Retrieves serialized inventory item given a serial number
|
|
|
88 |
*/
|
| 4541 |
mandeep.dh |
89 |
InventoryItem getInventoryItem(1:string serialNumber) throws (1:WarehouseServiceException wex);
|
| 2820 |
chandransh |
90 |
|
| 4496 |
mandeep.dh |
91 |
/**
|
| 5361 |
mandeep.dh |
92 |
* Retrieves non-serialized inventory item from a given supplier
|
| 4496 |
mandeep.dh |
93 |
*/
|
| 5530 |
mandeep.dh |
94 |
InventoryItem getNonSeralizedInventoryItem(1:string itemNumber, 2:i64 itemId, 3:i64 fulfilmentWarehouseId) throws (1:WarehouseServiceException wex);
|
| 3383 |
chandransh |
95 |
|
| 4496 |
mandeep.dh |
96 |
/**
|
|
|
97 |
* Scan non-serialized items.
|
|
|
98 |
*/
|
| 5361 |
mandeep.dh |
99 |
void scan(1:InventoryItem inventoryItem, 2:ScanType type, 3:i64 quantity, 4:i64 billingWarehouseId) throws (1:WarehouseServiceException wex);
|
| 4496 |
mandeep.dh |
100 |
|
|
|
101 |
/**
|
|
|
102 |
* Scan serialized items linked with an order. Returns its price.
|
|
|
103 |
*/
|
| 5110 |
mandeep.dh |
104 |
InventoryItem scanSerializedItemForOrder(1:string serialNumber, 2:ScanType type, 3:i64 orderId, 4:i64 fulfilmentWarehouseId, 5:double quantity, 6:i64 billingWarehouseId) throws (1:WarehouseServiceException wex);
|
| 4496 |
mandeep.dh |
105 |
|
|
|
106 |
/**
|
|
|
107 |
* Scan non-serialized items linked with an order.
|
|
|
108 |
*/
|
| 5361 |
mandeep.dh |
109 |
InventoryItem scanForOrder(1:InventoryItem inventoryItem, 2:ScanType type, 3:i64 quantity, 4:i64 orderId, 5:i64 fulfilmentWarehouseId, 6:i64 billingWarehouseId) throws (1:WarehouseServiceException wex);
|
| 4496 |
mandeep.dh |
110 |
|
|
|
111 |
/**
|
|
|
112 |
* Created item number to item id mapping
|
|
|
113 |
*/
|
|
|
114 |
void createItemNumberMapping(1:string itemNumber, 2:i64 itemId);
|
| 4618 |
amit.gupta |
115 |
|
|
|
116 |
/**
|
|
|
117 |
* Get itemNumber mappings for itemId
|
|
|
118 |
*/
|
|
|
119 |
list<string> getItemNumbers(1:i64 itemId);
|
| 5110 |
mandeep.dh |
120 |
|
|
|
121 |
/**
|
|
|
122 |
* Gets item ids for a given item number
|
|
|
123 |
*/
|
|
|
124 |
list<i64> getItemIds(1:string itemNumber);
|
| 5185 |
mandeep.dh |
125 |
|
|
|
126 |
/**
|
|
|
127 |
* Retrieves all inventory items given a last scan type
|
|
|
128 |
*/
|
|
|
129 |
list<InventoryItem> getInventoryItemsFromLastScanType(1:ScanType lastScanType) throws (1:WarehouseServiceException wex);
|
|
|
130 |
|
|
|
131 |
/**
|
|
|
132 |
* Retrieves inventory item given a inventoryItem id
|
|
|
133 |
*/
|
| 5372 |
mandeep.dh |
134 |
InventoryItem getInventoryItemFromId(1:i64 inventoryItemId) throws (1:WarehouseServiceException wex);
|
|
|
135 |
|
|
|
136 |
/**
|
|
|
137 |
* Returns the purchase scans grouped by items for Purchase register reconciliation
|
|
|
138 |
*/
|
|
|
139 |
list<DetailedPurchaseScan> getPurchaseScans(1:i64 startDate, 2:i64 endDate);
|
| 5496 |
mandeep.dh |
140 |
|
|
|
141 |
/**
|
|
|
142 |
* Returns the invoices and the count of scans against on a given day.
|
|
|
143 |
*/
|
|
|
144 |
list<InvoiceScan> fetchScansPerInvoiceNumber(1:i64 date);
|
| 5620 |
mandeep.dh |
145 |
|
|
|
146 |
/**
|
|
|
147 |
* Returns inventory item for a given order
|
|
|
148 |
*/
|
|
|
149 |
InventoryItem getInventoryItemFromOrder(1:i64 orderId) throws (1:WarehouseServiceException we);
|
| 5711 |
mandeep.dh |
150 |
|
|
|
151 |
/**
|
|
|
152 |
* Fetches the stock inventory age week-wise
|
|
|
153 |
*/
|
|
|
154 |
list<InventoryAge> getInventoryAge();
|
| 4496 |
mandeep.dh |
155 |
}
|