Subversion Repositories SmartDukaan

Rev

Rev 115 | Rev 123 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

namespace java in.shop2020.model.v1.catalog
namespace py shop2020.thriftpy.model.v1.catalog

/**
        Objects
*/

enum status{
        PHASED_OUT,             //Item is no longer selling
        DELETED,                //Item has been deliberately deleted 
        PAUSED,                 //Item's sale is currently paused
        ACTIVE,                 //Item is available for sale as of now
        IN_PROCESS              //Item has been added, but content is not available for the same
}

struct Warehouse{
        1:i64 id,
        2:string location,
        4:status warehouseStatus
        5:i64 addedOn
}
/* */
struct ItemInventory{
        1:i64 id,
        2:map<i64,i64> availability,
        3:i64 lastCheckedOn
}

struct ItemInventoryHistory{
        1:i64 item_id,
        2:i64 warehouse_id,
        3:i64 timestamp,
        4:i64 availability
}

struct Item{
        1:i64 id,
        2:list<i64> catalogItemId,
        3:ItemInventory itemInventory,
        4:i64 addedOn,
        5:i64 startDate,
        6:status itemStatus,
        7:map<string,string> otherInfo,
        8:double price,
        9:double weight,
        10:i64 featureId,
        11:string featureDescription,
        12:i64 vendorItemId
}

exception InventoryServiceException{
        1:i64 id,
        2:string message
}

service InventoryService{

/**
        Content methods
*/

/**
        Availability and inventory attributes   
*/
        //all add and update methods - added by Ashish
        //i64 addCategory(1:Category category) throws (1:InventoryServiceException cex),
        i64 addItem(1:Item item) throws (1:InventoryServiceException cex), 
        //i64 addItemToCategory(1:i64 item_id, 2:i64 category_id) throws (1:InventoryServiceException cex),
        i64 addWarehouse(1:Warehouse warehouse) throws (1:InventoryServiceException cex),
        //i64 addVendor(1:Vendor vendor) throws (1:InventoryServiceException cex),
        void updateInventory(1:i64 item_id, 2:i64 warehouse_id, 3: i64 quantity, 4:i64 timestamp) throws (1:InventoryServiceException cex),
        
        //all delete methods
        //void retireCategory(1:i64 category_id) throws (1:InventoryServiceException cex),
        //void retireVendor(1:i64 vendor_id) throws (1:InventoryServiceException cex),
        void retireWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
        
        //Item management apis
        void startItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
        void retireItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
        void changeItemStatus(1:i64 item_id, 2:i64 timestamp, 3:status newstatus) throws (1:InventoryServiceException cex),
        //Other accessor methods - added by Ashish
        //Category getCategory(1:i64 id) throws (1:InventoryServiceException cex),
        //list<Category> getAllCategories(1:bool isActive) throws (1:InventoryServiceException cex),
        Item getItem(1:i64 item_id) throws (1:InventoryServiceException cex),
        //list<Item> getAllItemsForCategory(1:i64 category_id,2:bool isActive) throws (1:InventoryServiceException cex),
        list<Item> getAllItems(1:bool isActive) throws (1:InventoryServiceException cex),
        list<Item> getAllItemsByStatus(1:status itemStatus) throws (1:InventoryServiceException cex),
        ItemInventory getItemInventory(1:i64 item_id) throws (1:InventoryServiceException cex),
        i64 getItemAvailibilityAtWarehouse(1:i64 warehouse_id, 2:i64 item_id) throws (1:InventoryServiceException cex),
        ItemInventoryHistory getItemInventoryHistory(1:i64 id, 2:i64 item_id, 3:i64 warehouse_id, 4: i64 from_date, 5:i64 to_date ) throws (1:InventoryServiceException cex),
        list<Warehouse> getAllWarehouses(1:bool isActive) throws (1:InventoryServiceException cex),
        Warehouse getWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
        list<Warehouse> getAllWarehousesForItem(1:i64 item_id) throws (1:InventoryServiceException cex),
        list<Item> getAllItemsForWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
        //Vendor getVendor(1:i64 vendor_id) throws (1:InventoryServiceException cex),
        //list<Vendor> getAllVendors(1:bool isActive) throws (1:InventoryServiceException cex), 
}