| 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 |
|
| 95 |
ashish |
8 |
struct Category{
|
|
|
9 |
1:i64 id,
|
|
|
10 |
2:string name,
|
|
|
11 |
3:list<i64> childCategories,
|
|
|
12 |
4:i64 parent_id,
|
|
|
13 |
5:bool isTopLevel,
|
|
|
14 |
6:i64 addedOn
|
|
|
15 |
}
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
| 85 |
ashish |
19 |
struct ItemAttribs{
|
|
|
20 |
//This is Naveen's struct
|
| 95 |
ashish |
21 |
1:i64 id
|
| 85 |
ashish |
22 |
}
|
|
|
23 |
|
|
|
24 |
struct Vendor{
|
|
|
25 |
1:i64 id,
|
|
|
26 |
2:string name
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
struct Warehouse{
|
|
|
31 |
1:i64 id,
|
|
|
32 |
2:string location,
|
| 95 |
ashish |
33 |
3:i64 vendor_id
|
| 85 |
ashish |
34 |
}
|
|
|
35 |
|
|
|
36 |
struct ItemInventory{
|
|
|
37 |
1:i64 id,
|
|
|
38 |
2:map<i64,i64> availability,
|
|
|
39 |
3:map<i64, double> priceMatrix,
|
|
|
40 |
4:i64 lastCheckedOn
|
|
|
41 |
}
|
|
|
42 |
|
|
|
43 |
struct ItemInventoryHistory{
|
|
|
44 |
1:i64 item_id,
|
|
|
45 |
2:i64 warehouse_id,
|
|
|
46 |
3:i64 timestamp,
|
|
|
47 |
4:i64 availability
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
struct Item{
|
|
|
51 |
1:i64 id,
|
|
|
52 |
2:i64 category_id,
|
|
|
53 |
3:ItemAttribs itemAttribs,
|
|
|
54 |
4:ItemInventory itemInventory
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
exception CatalogServiceException{
|
|
|
58 |
1:i64 id,
|
|
|
59 |
2:string message
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
service CatalogService{
|
|
|
66 |
|
|
|
67 |
/**
|
|
|
68 |
Content methods
|
|
|
69 |
*/
|
|
|
70 |
|
|
|
71 |
/**
|
|
|
72 |
Availability and inventory attributes
|
|
|
73 |
*/
|
|
|
74 |
//all add and update methods - added by Ashish
|
|
|
75 |
void addCategory(1:Category category) throws (1:CatalogServiceException cex),
|
|
|
76 |
void addItemToCategory(1:Item item, 2:i64 category_id) throws (1:CatalogServiceException cex),
|
| 95 |
ashish |
77 |
void addItemAttribsToItem(1:ItemAttribs itemattribs, 2:i64 item_id) throws (1:CatalogServiceException cex),
|
|
|
78 |
void addItemInventoryToItem(1:ItemInventory iteminventory, 2:i64 item_id) throws (1:CatalogServiceException cex),
|
| 85 |
ashish |
79 |
void addWarehouse(1:Warehouse warehouse) throws (1:CatalogServiceException cex),
|
|
|
80 |
void addVendor(1:Vendor vendor) throws (1:CatalogServiceException cex),
|
|
|
81 |
void updateInventory(1:i64 item_id, 2:i64 warehouse_id, 3: i64 quantity, 4:i64 timestamp) throws (1:CatalogServiceException cex),
|
|
|
82 |
|
|
|
83 |
//Other accessor methods - added by Ashish
|
| 95 |
ashish |
84 |
Category getCategory(1:i64 id) throws (1:CatalogServiceException cex),
|
| 85 |
ashish |
85 |
list<Category> getAllCategories() throws (1:CatalogServiceException cex),
|
|
|
86 |
Item getItem(1:i64 item_id) throws (1:CatalogServiceException cex),
|
|
|
87 |
list<Item> getAllItemsForCategory(1:i64 category_id) throws (1:CatalogServiceException cex),
|
|
|
88 |
ItemAttribs getItemAtttribs(1:i64 item_id) throws (1:CatalogServiceException cex),
|
|
|
89 |
ItemInventory getItemInventory(1:i64 item_id) throws (1:CatalogServiceException cex),
|
| 95 |
ashish |
90 |
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),
|
| 85 |
ashish |
91 |
Warehouse getWarehouse(1:i64 warehouse_id) throws (1:CatalogServiceException cex),
|
|
|
92 |
list<Warehouse> getAllWarehousesForItem(1:i64 item_is) throws (1:CatalogServiceException cex),
|
|
|
93 |
i64 getExpectedDeliveryTime(1:i64 item_id) throws (1:CatalogServiceException cex),
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
}
|
|
|
98 |
|