Subversion Repositories SmartDukaan

Rev

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