Rev 4618 | Rev 5110 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
namespace java in.shop2020.warehousenamespace py shop2020.thriftpy.warehouseinclude "GenericService.thrift"struct Warehouse {1:i64 id,2:string displayName,3:string location}struct InventoryItem {// fields in db1:i64 id,2:i64 itemId,3:string itemNumber,4:string serialNumber,5:i64 initialQuantity,6:i64 currentQuantity,7:i64 purchaseId,// derived fields for efficient lookups8:i64 supplierId,9:double unitPrice}enum ScanType {PURCHASE = 0, // Scan-in at the time of purchaseSALE = 1, // Scan-out for saleSALE_RET = 2, // Scan-in when an item is returned undeliveredDOA_IN = 3, // Scan-in when an item is returned by the customer with the DOA certificateDOA_OUT = 4, // Scan-out to return an item to the supplierPURCHASE_RETURN = 5 // Scan-out to return an item to the supplier (a Non-DOA case)}struct Scan {1:i64 id,2:i64 inventoryItemId,3:optional i64 quantity, // ignored in case of serialized items4:optional i64 orderId, // The order that was fulfilled with thin scan!5:i64 warehouseId,6:ScanType type,7:i64 scannedAt}exception WarehouseServiceException {1:GenericService.ExceptionType exceptionType,2:string message}service WarehouseService extends GenericService.GenericService {/*** Creating inventory for a serialized item*/InventoryItem createSerializedInventoryItem(1:i64 itemId, 2:string itemNumber, 3:string serialNumber, 4:i64 purchaseId) throws (1:WarehouseServiceException wex);/*** Creating inventory for a serialized item using item number*/InventoryItem createSerializedInventoryItemFromItemNumber(1:string itemNumber, 2:string serialNumber, 3:i64 purchaseId) throws (1:WarehouseServiceException wex);/*** Creates inventory for an unserailized item*/InventoryItem createInventoryItem(1:i64 itemId, 2:i64 quantity, 3:i64 purchaseId) throws (1:WarehouseServiceException wex);/*** Retrieves serialized inventory item given a serial number*/InventoryItem getInventoryItem(1:string serialNumber) throws (1:WarehouseServiceException wex);/*** Retrieves non-serialized inventory items from a given supplier*/list<InventoryItem> getNonSeralizedInventoryItems(1:i64 itemId, 2:i64 quantity, 3:i64 supplierId);/*** Retrieves inventory items for a given item*/list<InventoryItem> getInventoryItems(1:i64 itemId);/*** Retrieves scans for a given order*/list<Scan> getScanForOrder(1:i64 orderId);/*** Retrieves scans for a given inventory item*/list<Scan> getScan(1:i64 inventoryItemId);/*** Scan serialized items.*/void scanSerializedItem(1:i64 inventoryItemId, 2:ScanType type, 3:i64 warehouseId) throws (1:WarehouseServiceException wex);/*** Scan non-serialized items.*/void scan(1:i64 inventoryItemId, 2:ScanType type, 3:i64 quantity, 4:i64 warehouseId) throws (1:WarehouseServiceException wex);/*** Scan serialized items linked with an order. Returns its price.*/InventoryItem scanSerializedItemForOrder(1:string serialNumber, 2:ScanType type, 3:i64 orderId, 4:i64 warehouseId) throws (1:WarehouseServiceException wex);/*** Scan non-serialized items linked with an order.*/void scanForOrder(1:i64 inventoryItemId, 2:ScanType type, 3:i64 quantity, 4:i64 orderId, 5:i64 warehouseId) throws (1:WarehouseServiceException wex);/*** Created item number to item id mapping*/void createItemNumberMapping(1:string itemNumber, 2:i64 itemId);/*** Get itemNumber mappings for itemId*/list<string> getItemNumbers(1:i64 itemId);}