Subversion Repositories SmartDukaan

Rev

Rev 720 | Rev 763 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
720 chandransh 18
	CONTENT_COMPLETE = 5  //The content for this item has been completed. We can start selling the item now.
103 ashish 19
}
20
 
646 chandransh 21
enum WarehouseLocation{
22
	Delhi = 0,
23
	Mumbai = 1,
24
	Bangalore = 2,
25
	Kolkata = 3
26
}
27
 
483 rajveer 28
/* 
29
Warehouse fields details
30
location: it is full address
31
vendorString: some key for the warehouse
32
*/
85 ashish 33
struct Warehouse{
34
	1:i64 id,
752 chandransh 35
	2:string displayName,
36
	3:string location,
37
	4:status warehouseStatus,
38
	5:i64 addedOn,
39
	6:i64 lastCheckedOn,
40
	7:string tinNumber,
41
	8:string pincode,
42
	9:string vendorString,
43
	10:WarehouseLocation logisticsLocation
85 ashish 44
}
115 ashish 45
/* */
85 ashish 46
struct ItemInventory{
47
	1:i64 id,
483 rajveer 48
	2:map<i64,i64> availability
85 ashish 49
}
50
 
483 rajveer 51
 
85 ashish 52
struct ItemInventoryHistory{
53
	1:i64 item_id,
54
	2:i64 warehouse_id,
55
	3:i64 timestamp,
56
	4:i64 availability
57
}
58
 
59
struct Item{
60
	1:i64 id,
510 rajveer 61
	2:string manufacturerName,
483 rajveer 62
	3:string modelNumber,
63
	4:string modelName,
623 chandransh 64
	5:i64 category,
483 rajveer 65
	6:string comments,
66
	7:i64 catalogItemId,
67
	8:string vendorItemId
121 ashish 68
	10:i64 featureId,
69
	11:string featureDescription,
483 rajveer 70
	12:ItemInventory itemInventory,
71
	13:double mrp, //maxmimum retail price
72
	14:double mop, //market operative price
73
	15:double sellingPrice, //Selling price
720 chandransh 74
	16:double transferPrice
75
	17:double weight,
76
	18:i64 addedOn,
77
	19:i64 startDate,
78
	20:i64 retireDate,
79
	21:status itemStatus,
80
	22:map<string,string> otherInfo,
81
	23:string bestDealText,
82
	24:double bestDealValue,
83
	25:double dealerPrice,
84
	26:i64 updatedOn,
85
	27:string color
85 ashish 86
}
87
 
121 ashish 88
exception InventoryServiceException{
85 ashish 89
	1:i64 id,
90
	2:string message
91
}
92
 
121 ashish 93
service InventoryService{
85 ashish 94
/**
95
	Availability and inventory attributes	
96
*/
97
	//all add and update methods - added by Ashish
123 ashish 98
	i64 addItem(1:Item item) throws (1:InventoryServiceException cex),
99
	i64 updateItem(1:Item item) throws (1:InventoryServiceException cex),
121 ashish 100
	i64 addWarehouse(1:Warehouse warehouse) throws (1:InventoryServiceException cex),
632 rajveer 101
	bool isActive(1:i64 itemId) throws (1:InventoryServiceException isex),
483 rajveer 102
	void updateInventory(1:i64 warehouse_id, 2:string timestamp, 3:map<string, i64> availability) throws (1:InventoryServiceException cex),
103
	// commented right now. write on based of requirement
104
	// void updatePrice(1:i64 item_id, 2:i64 warehouse_id, 3:double price) throws (1:InventoryServiceException cex),
103 ashish 105
	//all delete methods
121 ashish 106
	void retireWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
103 ashish 107
 
108
	//Item management apis
121 ashish 109
	void startItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
110
	void retireItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
111
	void changeItemStatus(1:i64 item_id, 2:i64 timestamp, 3:status newstatus) throws (1:InventoryServiceException cex),
85 ashish 112
	//Other accessor methods - added by Ashish
121 ashish 113
	Item getItem(1:i64 item_id) throws (1:InventoryServiceException cex),
632 rajveer 114
	list<Item> getItemsByCatalogId(1:i64 catalog_item_id) throws  (1:InventoryServiceException cex),
121 ashish 115
	list<Item> getAllItems(1:bool isActive) throws (1:InventoryServiceException cex),
116
	list<Item> getAllItemsByStatus(1:status itemStatus) throws (1:InventoryServiceException cex),
117
	ItemInventory getItemInventory(1:i64 item_id) throws (1:InventoryServiceException cex),
632 rajveer 118
	ItemInventory getItemInventoryByItemId(1:i64 item_id) throws (1:InventoryServiceException cex),
119
	//ItemInventory getItemInventoryByCatalogId(1:i64 item_id) throws (1:InventoryServiceException cex),
121 ashish 120
	i64 getItemAvailibilityAtWarehouse(1:i64 warehouse_id, 2:i64 item_id) throws (1:InventoryServiceException cex),
720 chandransh 121
	bool markItemAsContentComplete(1:i64 entityId) throws (1:InventoryServiceException cex),
646 chandransh 122
 
123
	/**
124
	  Returns the id of the warehouse with the largest inventory of the item and the inventory size in the given locations.
125
	  The size of list will always be 2.
126
	 */
127
	list<i64> getItemAvailabilityAtLocation(1:i64 warehouse_loc, 2:i64 item_id) throws (1:InventoryServiceException isex),
121 ashish 128
	list<Warehouse> getAllWarehouses(1:bool isActive) throws (1:InventoryServiceException cex),
129
	Warehouse getWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
130
	list<Warehouse> getAllWarehousesForItem(1:i64 item_id) throws (1:InventoryServiceException cex),
502 rajveer 131
	list<Item> getAllItemsForWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
132
 
133
	// for home page .... best deals, best sellers and latest arrivals
588 chandransh 134
	list<Item> getBestSellers() throws (1:InventoryServiceException isex),
623 chandransh 135
	list<i64> getBestSellersCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:i64 category) throws (1:InventoryServiceException cex),
588 chandransh 136
	i64 getBestSellersCount() throws (1:InventoryServiceException cex),
137
 
138
	list<Item> getBestDeals() throws (1:InventoryServiceException isex),
623 chandransh 139
	list<i64> getBestDealsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:i64 category) throws (1:InventoryServiceException cex),
588 chandransh 140
	i64 getBestDealsCount() throws (1:InventoryServiceException cex),
141
 
142
	list<Item> getLatestArrivals() throws (1:InventoryServiceException isex),
623 chandransh 143
	list<i64> getLatestArrivalsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:i64 category) throws (1:InventoryServiceException cex),
632 rajveer 144
	i64 getLatestArrivalsCount() throws (1:InventoryServiceException cex),
145
 
146
	bool putCategoryObject(1:binary object),
147
	binary getCategoryObject()
85 ashish 148
}
149