Subversion Repositories SmartDukaan

Rev

Rev 121 | Rev 378 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 121 Rev 123
Line 3... Line 3...
3
 
3
 
4
/**
4
/**
5
	Objects
5
	Objects
6
*/
6
*/
7
 
7
 
-
 
8
/**
-
 
9
Caution :- Never ever change the numbers in it. Please confirm from @ashish before any changes in enuma dn other entries in file.
-
 
10
**/
-
 
11
 
8
enum status{
12
enum status{
9
	PHASED_OUT,		//Item is no longer selling
13
	PHASED_OUT = 0,		//Item is no longer selling
10
	DELETED,		//Item has been deliberately deleted 
14
	DELETED = 1,		//Item has been deliberately deleted 
11
	PAUSED,			//Item's sale is currently paused
15
	PAUSED = 2,			//Item's sale is currently paused
12
	ACTIVE,			//Item is available for sale as of now
16
	ACTIVE = 3,			//Item is available for sale as of now
13
	IN_PROCESS		//Item has been added, but content is not available for the same
17
	IN_PROCESS = 4		//Item has been added, but content is not available for the same
14
}
18
}
15
 
19
 
16
struct Warehouse{
20
struct Warehouse{
17
	1:i64 id,
21
	1:i64 id,
18
	2:string location,
22
	2:string location,
Line 33... Line 37...
33
	4:i64 availability
37
	4:i64 availability
34
}
38
}
35
 
39
 
36
struct Item{
40
struct Item{
37
	1:i64 id,
41
	1:i64 id,
38
	2:list<i64> catalogItemId,
42
	2:i64 catalogItemId,
39
	3:ItemInventory itemInventory,
43
	3:ItemInventory itemInventory,
40
	4:i64 addedOn,
44
	4:i64 addedOn,
41
	5:i64 startDate,
45
	5:i64 startDate,
42
	6:status itemStatus,
46
	6:status itemStatus,
43
	7:map<string,string> otherInfo,
47
	7:map<string,string> otherInfo,
44
	8:double price,
48
	8:map<i64, double> price, //price on each warehouse
45
	9:double weight,
49
	9:double weight,
46
	10:i64 featureId,
50
	10:i64 featureId,
47
	11:string featureDescription,
51
	11:string featureDescription,
48
	12:i64 vendorItemId
52
	12:i64 vendorItemId
49
}
53
}
Line 61... Line 65...
61
 
65
 
62
/**
66
/**
63
	Availability and inventory attributes	
67
	Availability and inventory attributes	
64
*/
68
*/
65
	//all add and update methods - added by Ashish
69
	//all add and update methods - added by Ashish
66
	//i64 addCategory(1:Category category) throws (1:InventoryServiceException cex),
70
	i64 addItem(1:Item item) throws (1:InventoryServiceException cex),
67
	i64 addItem(1:Item item) throws (1:InventoryServiceException cex), 
71
	i64 updateItem(1:Item item) throws (1:InventoryServiceException cex),
68
	//i64 addItemToCategory(1:i64 item_id, 2:i64 category_id) throws (1:InventoryServiceException cex),
-
 
69
	i64 addWarehouse(1:Warehouse warehouse) throws (1:InventoryServiceException cex),
72
	i64 addWarehouse(1:Warehouse warehouse) throws (1:InventoryServiceException cex),
70
	//i64 addVendor(1:Vendor vendor) throws (1:InventoryServiceException cex),
-
 
71
	void updateInventory(1:i64 item_id, 2:i64 warehouse_id, 3: i64 quantity, 4:i64 timestamp) throws (1:InventoryServiceException cex),
73
	void updateInventory(1:i64 item_id, 2:i64 warehouse_id, 3: i64 quantity, 4:i64 timestamp) throws (1:InventoryServiceException cex),
72
	
-
 
-
 
74
	void updatePrice(1:i64 item_id, 2:i64 warehouse_id, 3:double price) throws (1:InventoryServiceException cex),
73
	//all delete methods
75
	//all delete methods
74
	//void retireCategory(1:i64 category_id) throws (1:InventoryServiceException cex),
-
 
75
	//void retireVendor(1:i64 vendor_id) throws (1:InventoryServiceException cex),
-
 
76
	void retireWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
76
	void retireWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
77
	
77
	
78
	//Item management apis
78
	//Item management apis
79
	void startItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
79
	void startItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
80
	void retireItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
80
	void retireItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:InventoryServiceException cex),
81
	void changeItemStatus(1:i64 item_id, 2:i64 timestamp, 3:status newstatus) throws (1:InventoryServiceException cex),
81
	void changeItemStatus(1:i64 item_id, 2:i64 timestamp, 3:status newstatus) throws (1:InventoryServiceException cex),
82
	//Other accessor methods - added by Ashish
82
	//Other accessor methods - added by Ashish
83
	//Category getCategory(1:i64 id) throws (1:InventoryServiceException cex),
-
 
84
	//list<Category> getAllCategories(1:bool isActive) throws (1:InventoryServiceException cex),
-
 
85
	Item getItem(1:i64 item_id) throws (1:InventoryServiceException cex),
83
	Item getItem(1:i64 item_id) throws (1:InventoryServiceException cex),
86
	//list<Item> getAllItemsForCategory(1:i64 category_id,2:bool isActive) throws (1:InventoryServiceException cex),
-
 
87
	list<Item> getAllItems(1:bool isActive) throws (1:InventoryServiceException cex),
84
	list<Item> getAllItems(1:bool isActive) throws (1:InventoryServiceException cex),
88
	list<Item> getAllItemsByStatus(1:status itemStatus) throws (1:InventoryServiceException cex),
85
	list<Item> getAllItemsByStatus(1:status itemStatus) throws (1:InventoryServiceException cex),
89
	ItemInventory getItemInventory(1:i64 item_id) throws (1:InventoryServiceException cex),
86
	ItemInventory getItemInventory(1:i64 item_id) throws (1:InventoryServiceException cex),
90
	i64 getItemAvailibilityAtWarehouse(1:i64 warehouse_id, 2:i64 item_id) throws (1:InventoryServiceException cex),
87
	i64 getItemAvailibilityAtWarehouse(1:i64 warehouse_id, 2:i64 item_id) throws (1:InventoryServiceException 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),
-
 
92
	list<Warehouse> getAllWarehouses(1:bool isActive) throws (1:InventoryServiceException cex),
88
	list<Warehouse> getAllWarehouses(1:bool isActive) throws (1:InventoryServiceException cex),
93
	Warehouse getWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
89
	Warehouse getWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
94
	list<Warehouse> getAllWarehousesForItem(1:i64 item_id) throws (1:InventoryServiceException cex),
90
	list<Warehouse> getAllWarehousesForItem(1:i64 item_id) throws (1:InventoryServiceException cex),
95
	list<Item> getAllItemsForWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),
91
	list<Item> getAllItemsForWarehouse(1:i64 warehouse_id) throws (1:InventoryServiceException cex),		
96
	//Vendor getVendor(1:i64 vendor_id) throws (1:InventoryServiceException cex),
-
 
97
	//list<Vendor> getAllVendors(1:bool isActive) throws (1:InventoryServiceException cex),	
-
 
98
}
92
}
99
 
93