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