| 85 |
ashish |
1 |
namespace java in.shop2020.model.v1.catalog
|
| 95 |
ashish |
2 |
namespace py shop2020.thriftpy.model.v1.catalog
|
| 85 |
ashish |
3 |
|
|
|
4 |
/**
|
|
|
5 |
Objects
|
|
|
6 |
*/
|
|
|
7 |
|
| 103 |
ashish |
8 |
enum status{
|
| 121 |
ashish |
9 |
PHASED_OUT, //Item is no longer selling
|
|
|
10 |
DELETED, //Item has been deliberately deleted
|
|
|
11 |
PAUSED, //Item's sale is currently paused
|
|
|
12 |
ACTIVE, //Item is available for sale as of now
|
|
|
13 |
IN_PROCESS //Item has been added, but content is not available for the same
|
| 103 |
ashish |
14 |
}
|
|
|
15 |
|
| 85 |
ashish |
16 |
struct Warehouse{
|
|
|
17 |
1:i64 id,
|
|
|
18 |
2:string location,
|
| 103 |
ashish |
19 |
4:status warehouseStatus
|
|
|
20 |
5:i64 addedOn
|
| 85 |
ashish |
21 |
}
|
| 115 |
ashish |
22 |
/* */
|
| 85 |
ashish |
23 |
struct ItemInventory{
|
|
|
24 |
1:i64 id,
|
|
|
25 |
2:map<i64,i64> availability,
|
| 103 |
ashish |
26 |
3:i64 lastCheckedOn
|
| 85 |
ashish |
27 |
}
|
|
|
28 |
|
|
|
29 |
struct ItemInventoryHistory{
|
|
|
30 |
1:i64 item_id,
|
|
|
31 |
2:i64 warehouse_id,
|
|
|
32 |
3:i64 timestamp,
|
|
|
33 |
4:i64 availability
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
struct Item{
|
|
|
37 |
1:i64 id,
|
| 121 |
ashish |
38 |
2:list<i64> catalogItemId,
|
| 103 |
ashish |
39 |
3:ItemInventory itemInventory,
|
|
|
40 |
4:i64 addedOn,
|
|
|
41 |
5:i64 startDate,
|
|
|
42 |
6:status itemStatus,
|
|
|
43 |
7:map<string,string> otherInfo,
|
| 121 |
ashish |
44 |
8:double price,
|
|
|
45 |
9:double weight,
|
|
|
46 |
10:i64 featureId,
|
|
|
47 |
11:string featureDescription,
|
|
|
48 |
12:i64 vendorItemId
|
| 85 |
ashish |
49 |
}
|
|
|
50 |
|
| 121 |
ashish |
51 |
exception InventoryServiceException{
|
| 85 |
ashish |
52 |
1:i64 id,
|
|
|
53 |
2:string message
|
|
|
54 |
}
|
|
|
55 |
|
| 121 |
ashish |
56 |
service InventoryService{
|
| 85 |
ashish |
57 |
|
|
|
58 |
/**
|
|
|
59 |
Content methods
|
|
|
60 |
*/
|
|
|
61 |
|
|
|
62 |
/**
|
|
|
63 |
Availability and inventory attributes
|
|
|
64 |
*/
|
|
|
65 |
//all add and update methods - added by Ashish
|
| 121 |
ashish |
66 |
//i64 addCategory(1:Category category) throws (1:InventoryServiceException cex),
|
|
|
67 |
i64 addItem(1:Item item) throws (1:InventoryServiceException cex),
|
|
|
68 |
//i64 addItemToCategory(1:i64 item_id, 2:i64 category_id) throws (1:InventoryServiceException cex),
|
|
|
69 |
i64 addWarehouse(1:Warehouse warehouse) throws (1:InventoryServiceException cex),
|
|
|
70 |
//i64 addVendor(1:Vendor vendor) throws (1:InventoryServiceException cex),
|
|
|
71 |
void updateInventory(1:i64 item_id, 2:i64 warehouse_id, 3: i64 quantity, 4:i64 timestamp) throws (1:InventoryServiceException cex),
|
| 85 |
ashish |
72 |
|
| 103 |
ashish |
73 |
//all delete methods
|
| 121 |
ashish |
74 |
//void retireCategory(1:i64 category_id) throws (1:InventoryServiceException cex),
|
|
|
75 |
//void retireVendor(1:i64 vendor_id) throws (1:InventoryServiceException cex),
|
|
|
76 |
void retireWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
|
| 103 |
ashish |
77 |
|
|
|
78 |
//Item management apis
|
| 121 |
ashish |
79 |
void startItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
|
|
|
80 |
void retireItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
|
|
|
81 |
void changeItemStatus(1:i64 item_id, 2:i64 timestamp, 3:status newstatus) throws (1:InventoryServiceException cex),
|
| 85 |
ashish |
82 |
//Other accessor methods - added by Ashish
|
| 121 |
ashish |
83 |
//Category getCategory(1:i64 id) throws (1:InventoryServiceException cex),
|
|
|
84 |
//list<Category> getAllCategories(1:bool isActive) throws (1:InventoryServiceException cex),
|
|
|
85 |
Item getItem(1:i64 item_id) throws (1:InventoryServiceException cex),
|
|
|
86 |
//list<Item> getAllItemsForCategory(1:i64 category_id,2:bool isActive) throws (1:InventoryServiceException cex),
|
|
|
87 |
list<Item> getAllItems(1:bool isActive) throws (1:InventoryServiceException cex),
|
|
|
88 |
list<Item> getAllItemsByStatus(1:status itemStatus) throws (1:InventoryServiceException cex),
|
|
|
89 |
ItemInventory getItemInventory(1:i64 item_id) throws (1:InventoryServiceException cex),
|
|
|
90 |
i64 getItemAvailibilityAtWarehouse(1:i64 warehouse_id, 2:i64 item_id) throws (1:InventoryServiceException cex),
|
|
|
91 |
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),
|
|
|
92 |
list<Warehouse> getAllWarehouses(1:bool isActive) throws (1:InventoryServiceException cex),
|
|
|
93 |
Warehouse getWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
|
|
|
94 |
list<Warehouse> getAllWarehousesForItem(1:i64 item_id) throws (1:InventoryServiceException cex),
|
|
|
95 |
list<Item> getAllItemsForWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
|
|
|
96 |
//Vendor getVendor(1:i64 vendor_id) throws (1:InventoryServiceException cex),
|
|
|
97 |
//list<Vendor> getAllVendors(1:bool isActive) throws (1:InventoryServiceException cex),
|
| 85 |
ashish |
98 |
}
|
|
|
99 |
|