Rev 6322 | Rev 6467 | 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"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)SALE_RET_UNUSABLE = 6,LOST_IN_TRANSIT = 7,DOA_REPLACED = 8}struct InventoryItem {// primary fields1: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,10:i64 currentWarehouseId,11:ScanType lastScanType}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}struct DetailedPurchaseScan {1:i64 purchaseOrderId,2:i64 poCreatedAt,3:string supplierName,4:string invoiceNumbers,5:i64 itemId,6:string brand,7:string modelName,8:string modelNumber,9:string color,10:double unitPrice,11:i64 quantity,12:i64 purchaseId,13:i64 purchasedAt}struct InvoiceScan {1:string invoiceNumber,2:i64 numItems,3:string supplierName,4:i64 date,5:i64 scannedQuantity}struct InventoryAge {1:i64 itemId,2:string brand,3:string modelName,4:string modelNumber,5:string color,6:i64 freshCount,7:i64 oneToTwoCount,8:i64 TwoToThreeCount,9:i64 ThreeToFourCount,10:i64 FourPlusCount,11:i64 ZeroPlusCount,12:i64 OnePlusCount,13:i64 ZeroPlusCost,14:i64 OnePlusCost,15:string category}exception WarehouseServiceException {1:GenericService.ExceptionType exceptionType,2:string message}service WarehouseService extends GenericService.GenericService {/*** Retrieves serialized inventory item given a serial number*/InventoryItem getInventoryItem(1:string serialNumber) throws (1:WarehouseServiceException wex);/*** Retrieves non-serialized inventory item from a given supplier*/InventoryItem getNonSeralizedInventoryItem(1:string itemNumber, 2:i64 itemId, 3:i64 fulfilmentWarehouseId) throws (1:WarehouseServiceException wex);/*** Scan non-serialized items.*/void scan(1:InventoryItem inventoryItem, 2:ScanType type, 3:i64 quantity, 4:i64 billingWarehouseId) 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 fulfilmentWarehouseId, 5:double quantity, 6:i64 billingWarehouseId) throws (1:WarehouseServiceException wex);/*** Scan non-serialized items linked with an order.*/InventoryItem scanForOrder(1:InventoryItem inventoryItem, 2:ScanType type, 3:i64 quantity, 4:i64 orderId, 5:i64 fulfilmentWarehouseId, 6:i64 billingWarehouseId) 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);/*** Gets item ids for a given item number*/list<i64> getItemIds(1:string itemNumber);/*** Retrieves all inventory items given a last scan type*/list<InventoryItem> getInventoryItemsFromLastScanType(1:ScanType lastScanType) throws (1:WarehouseServiceException wex);/*** Retrieves inventory item given a inventoryItem id*/InventoryItem getInventoryItemFromId(1:i64 inventoryItemId) throws (1:WarehouseServiceException wex);/*** Returns the purchase scans grouped by items for Purchase register reconciliation*/list<DetailedPurchaseScan> getPurchaseScans(1:i64 startDate, 2:i64 endDate);/*** Returns the invoices and the count of scans against on a given day.*/list<InvoiceScan> fetchScansPerInvoiceNumber(1:i64 date);/*** Returns inventory item for a given order*/InventoryItem getInventoryItemFromOrder(1:i64 orderId) throws (1:WarehouseServiceException we);/*** Fetches the stock inventory age week-wise*/list<InventoryAge> getInventoryAge();/*** Fetches the scanRecords for a given item for a given time interval*/list<Scan> getInventoryScansForItem(1:i64 itemId, 2:i64 fromDate, 3:i64 toDate);/*** Fetches the scanRecords for a given serialNumber for a given time interval*/list<Scan> getScanRecordsForSerialNumber(1:i64 serialNumber);}