| 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 |
|
| 123 |
ashish |
8 |
/**
|
| 606 |
chandransh |
9 |
Caution :- Never ever change the numbers in it. Please confirm from @ashish before any changes in enum and other entries in file.
|
| 123 |
ashish |
10 |
**/
|
|
|
11 |
|
| 103 |
ashish |
12 |
enum status{
|
| 123 |
ashish |
13 |
PHASED_OUT = 0, //Item is no longer selling
|
|
|
14 |
DELETED = 1, //Item has been deliberately deleted
|
|
|
15 |
PAUSED = 2, //Item's sale is currently paused
|
|
|
16 |
ACTIVE = 3, //Item is available for sale as of now
|
|
|
17 |
IN_PROCESS = 4 //Item has been added, but content is not available for the same
|
| 103 |
ashish |
18 |
}
|
|
|
19 |
|
| 483 |
rajveer |
20 |
/*
|
|
|
21 |
Warehouse fields details
|
|
|
22 |
location: it is full address
|
|
|
23 |
vendorString: some key for the warehouse
|
|
|
24 |
*/
|
| 85 |
ashish |
25 |
struct Warehouse{
|
|
|
26 |
1:i64 id,
|
|
|
27 |
2:string location,
|
| 483 |
rajveer |
28 |
3:status warehouseStatus,
|
|
|
29 |
4:i64 addedOn,
|
|
|
30 |
5:i64 lastCheckedOn,
|
|
|
31 |
6:string tinNumber,
|
|
|
32 |
7:string pincode,
|
|
|
33 |
8:string vendorString
|
| 85 |
ashish |
34 |
}
|
| 115 |
ashish |
35 |
/* */
|
| 85 |
ashish |
36 |
struct ItemInventory{
|
|
|
37 |
1:i64 id,
|
| 483 |
rajveer |
38 |
2:map<i64,i64> availability
|
| 85 |
ashish |
39 |
}
|
|
|
40 |
|
| 483 |
rajveer |
41 |
|
| 85 |
ashish |
42 |
struct ItemInventoryHistory{
|
|
|
43 |
1:i64 item_id,
|
|
|
44 |
2:i64 warehouse_id,
|
|
|
45 |
3:i64 timestamp,
|
|
|
46 |
4:i64 availability
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
struct Item{
|
|
|
50 |
1:i64 id,
|
| 510 |
rajveer |
51 |
2:string manufacturerName,
|
| 483 |
rajveer |
52 |
3:string modelNumber,
|
|
|
53 |
4:string modelName,
|
| 623 |
chandransh |
54 |
5:i64 category,
|
| 483 |
rajveer |
55 |
6:string comments,
|
|
|
56 |
7:i64 catalogItemId,
|
|
|
57 |
8:string vendorItemId
|
| 121 |
ashish |
58 |
10:i64 featureId,
|
|
|
59 |
11:string featureDescription,
|
| 483 |
rajveer |
60 |
12:ItemInventory itemInventory,
|
|
|
61 |
13:double mrp, //maxmimum retail price
|
|
|
62 |
14:double mop, //market operative price
|
|
|
63 |
15:double sellingPrice, //Selling price
|
|
|
64 |
16:double weight,
|
|
|
65 |
17:i64 addedOn,
|
|
|
66 |
18:i64 startDate,
|
|
|
67 |
19:i64 retireDate,
|
|
|
68 |
20:status itemStatus,
|
| 606 |
chandransh |
69 |
21:map<string,string> otherInfo,
|
|
|
70 |
22:string bestDealText,
|
|
|
71 |
23:double bestDealValue,
|
|
|
72 |
24:double dealerPrice,
|
|
|
73 |
25:i64 updatedOn,
|
|
|
74 |
26:string color
|
| 85 |
ashish |
75 |
}
|
|
|
76 |
|
| 121 |
ashish |
77 |
exception InventoryServiceException{
|
| 85 |
ashish |
78 |
1:i64 id,
|
|
|
79 |
2:string message
|
|
|
80 |
}
|
|
|
81 |
|
| 121 |
ashish |
82 |
service InventoryService{
|
| 85 |
ashish |
83 |
/**
|
|
|
84 |
Availability and inventory attributes
|
|
|
85 |
*/
|
|
|
86 |
//all add and update methods - added by Ashish
|
| 123 |
ashish |
87 |
i64 addItem(1:Item item) throws (1:InventoryServiceException cex),
|
|
|
88 |
i64 updateItem(1:Item item) throws (1:InventoryServiceException cex),
|
| 121 |
ashish |
89 |
i64 addWarehouse(1:Warehouse warehouse) throws (1:InventoryServiceException cex),
|
| 577 |
chandransh |
90 |
bool isActive(1:i64 catalogItemId) throws (1:InventoryServiceException isex),
|
| 483 |
rajveer |
91 |
void updateInventory(1:i64 warehouse_id, 2:string timestamp, 3:map<string, i64> availability) throws (1:InventoryServiceException cex),
|
|
|
92 |
// commented right now. write on based of requirement
|
|
|
93 |
// void updatePrice(1:i64 item_id, 2:i64 warehouse_id, 3:double price) throws (1:InventoryServiceException cex),
|
| 103 |
ashish |
94 |
//all delete methods
|
| 121 |
ashish |
95 |
void retireWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
|
| 103 |
ashish |
96 |
|
|
|
97 |
//Item management apis
|
| 121 |
ashish |
98 |
void startItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
|
|
|
99 |
void retireItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
|
|
|
100 |
void changeItemStatus(1:i64 item_id, 2:i64 timestamp, 3:status newstatus) throws (1:InventoryServiceException cex),
|
| 85 |
ashish |
101 |
//Other accessor methods - added by Ashish
|
| 121 |
ashish |
102 |
Item getItem(1:i64 item_id) throws (1:InventoryServiceException cex),
|
| 378 |
ashish |
103 |
Item getItemByCatalogId(1:i64 catalog_item_id) throws (1:InventoryServiceException cex),
|
| 121 |
ashish |
104 |
list<Item> getAllItems(1:bool isActive) throws (1:InventoryServiceException cex),
|
|
|
105 |
list<Item> getAllItemsByStatus(1:status itemStatus) throws (1:InventoryServiceException cex),
|
|
|
106 |
ItemInventory getItemInventory(1:i64 item_id) throws (1:InventoryServiceException cex),
|
| 378 |
ashish |
107 |
ItemInventory getItemInventoryByCatalogId(1:i64 item_id) throws (1:InventoryServiceException cex),
|
| 121 |
ashish |
108 |
i64 getItemAvailibilityAtWarehouse(1:i64 warehouse_id, 2:i64 item_id) throws (1:InventoryServiceException cex),
|
|
|
109 |
list<Warehouse> getAllWarehouses(1:bool isActive) throws (1:InventoryServiceException cex),
|
|
|
110 |
Warehouse getWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
|
|
|
111 |
list<Warehouse> getAllWarehousesForItem(1:i64 item_id) throws (1:InventoryServiceException cex),
|
| 502 |
rajveer |
112 |
list<Item> getAllItemsForWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
|
|
|
113 |
|
|
|
114 |
// for home page .... best deals, best sellers and latest arrivals
|
| 588 |
chandransh |
115 |
list<Item> getBestSellers() throws (1:InventoryServiceException isex),
|
| 623 |
chandransh |
116 |
list<i64> getBestSellersCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:i64 category) throws (1:InventoryServiceException cex),
|
| 588 |
chandransh |
117 |
i64 getBestSellersCount() throws (1:InventoryServiceException cex),
|
|
|
118 |
|
|
|
119 |
list<Item> getBestDeals() throws (1:InventoryServiceException isex),
|
| 623 |
chandransh |
120 |
list<i64> getBestDealsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:i64 category) throws (1:InventoryServiceException cex),
|
| 588 |
chandransh |
121 |
i64 getBestDealsCount() throws (1:InventoryServiceException cex),
|
|
|
122 |
|
|
|
123 |
list<Item> getLatestArrivals() throws (1:InventoryServiceException isex),
|
| 623 |
chandransh |
124 |
list<i64> getLatestArrivalsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:i64 category) throws (1:InventoryServiceException cex),
|
| 588 |
chandransh |
125 |
i64 getLatestArrivalsCount() throws (1:InventoryServiceException cex)
|
| 85 |
ashish |
126 |
}
|
|
|
127 |
|