Subversion Repositories SmartDukaan

Rev

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

Rev 95 Rev 103
Line 3... Line 3...
3
 
3
 
4
/**
4
/**
5
	Objects
5
	Objects
6
*/
6
*/
7
 
7
 
-
 
8
enum status{
-
 
9
	PHASED_OUT,
-
 
10
	DELETED,
-
 
11
	PAUSED,
-
 
12
	ACTIVE,
-
 
13
}
-
 
14
 
8
struct Category{
15
struct Category{
9
	1:i64 id,
16
	1:i64 id,
10
	2:string name,
17
	2:string name,
11
	3:list<i64> childCategories,
18
	3:list<i64> childCategories,
12
	4:i64 parent_id,
19
	4:i64 parent_id,
13
	5:bool isTopLevel,
20
	5:bool isTopLevel,
14
	6:i64 addedOn
21
	6:i64 addedOn,
-
 
22
	7:status categoryStatus
15
}
23
}
16
 
24
 
17
 
25
 
18
 
-
 
19
struct ItemAttribs{
-
 
20
//This is Naveen's struct
-
 
21
	1:i64 id
-
 
22
}
-
 
23
 
-
 
24
struct Vendor{
26
struct Vendor{
25
	1:i64 id,
27
	1:i64 id,
26
	2:string name
28
	2:string name
-
 
29
	3:status vendorStatus
-
 
30
	4:i64 addedOn
27
}
31
}
28
 
32
 
29
 
33
 
30
struct Warehouse{
34
struct Warehouse{
31
	1:i64 id,
35
	1:i64 id,
32
	2:string location,
36
	2:string location,
33
	3:i64 vendor_id
37
	3:i64 vendor_id
-
 
38
	4:status warehouseStatus
-
 
39
	5:i64 addedOn
34
}
40
}
35
 
41
 
36
struct ItemInventory{
42
struct ItemInventory{
37
	1:i64 id,
43
	1:i64 id,
38
	2:map<i64,i64> availability,
44
	2:map<i64,i64> availability,
39
	3:map<i64, double> priceMatrix,
-
 
40
	4:i64 lastCheckedOn
45
	3:i64 lastCheckedOn
41
}
46
}
42
 
47
 
43
struct ItemInventoryHistory{
48
struct ItemInventoryHistory{
44
	1:i64 item_id,
49
	1:i64 item_id,
45
	2:i64 warehouse_id,
50
	2:i64 warehouse_id,
Line 47... Line 52...
47
	4:i64 availability
52
	4:i64 availability
48
}
53
}
49
 
54
 
50
struct Item{
55
struct Item{
51
	1:i64 id,
56
	1:i64 id,
52
	2:i64 category_id,
57
	2:list<i64> categories,
53
	3:ItemAttribs itemAttribs,
58
	3:ItemInventory itemInventory,
-
 
59
	4:i64 addedOn,
-
 
60
	5:i64 startDate,
54
	4:ItemInventory itemInventory
61
	6:status itemStatus,
-
 
62
	7:map<string,string> otherInfo,
-
 
63
	8:double price
55
}
64
}
56
 
65
 
57
exception CatalogServiceException{
66
exception CatalogServiceException{
58
	1:i64 id,
67
	1:i64 id,
59
	2:string message
68
	2:string message
Line 70... Line 79...
70
 
79
 
71
/**
80
/**
72
	Availability and inventory attributes	
81
	Availability and inventory attributes	
73
*/
82
*/
74
	//all add and update methods - added by Ashish
83
	//all add and update methods - added by Ashish
75
	void addCategory(1:Category category) throws (1:CatalogServiceException cex),
84
	i64 addCategory(1:Category category) throws (1:CatalogServiceException cex),
76
	void addItemToCategory(1:Item item, 2:i64 category_id) throws (1:CatalogServiceException cex),
85
	i64 addItem(1:Item item) throws (1:CatalogServiceException cex), 
77
	void addItemAttribsToItem(1:ItemAttribs itemattribs, 2:i64 item_id) throws (1:CatalogServiceException cex),
86
	i64 addItemToCategory(1:i64 item_id, 2:i64 category_id) throws (1:CatalogServiceException cex),
78
	void addItemInventoryToItem(1:ItemInventory iteminventory, 2:i64 item_id) throws (1:CatalogServiceException cex),
-
 
79
	void addWarehouse(1:Warehouse warehouse) throws (1:CatalogServiceException cex),
87
	i64 addWarehouse(1:Warehouse warehouse) throws (1:CatalogServiceException cex),
80
	void addVendor(1:Vendor vendor) throws (1:CatalogServiceException cex),
88
	i64 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),
89
	void updateInventory(1:i64 item_id, 2:i64 warehouse_id, 3: i64 quantity, 4:i64 timestamp) throws (1:CatalogServiceException cex),
82
	
90
	
-
 
91
	//all delete methods
-
 
92
	void retireCategory(1:i64 category_id) throws (1:CatalogServiceException cex),
-
 
93
	void retireVendor(1:i64 vendor_id) throws (1:CatalogServiceException cex),
-
 
94
	void retireWarehouse(1:i64 warehouse_id) throws (1:CatalogServiceException cex),
-
 
95
	
-
 
96
	//Item management apis
-
 
97
	void startItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:CatalogServiceException cex),
-
 
98
	void retireItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:CatalogServiceException cex),
-
 
99
	void changeItemStatus(1:i64 item_id, 2:i64 timestamp, 3:status newstatus) throws (1:CatalogServiceException cex),
83
	//Other accessor methods - added by Ashish
100
	//Other accessor methods - added by Ashish
84
	Category getCategory(1:i64 id) throws (1:CatalogServiceException cex),
101
	Category getCategory(1:i64 id) throws (1:CatalogServiceException cex),
85
	list<Category> getAllCategories() throws (1:CatalogServiceException cex),
102
	list<Category> getAllCategories(1:bool isActive) throws (1:CatalogServiceException cex),
86
	Item getItem(1:i64 item_id) throws (1:CatalogServiceException cex),
103
	Item getItem(1:i64 item_id) throws (1:CatalogServiceException cex),
87
	list<Item> getAllItemsForCategory(1:i64 category_id) throws (1:CatalogServiceException cex),
104
	list<Item> getAllItemsForCategory(1:i64 category_id,2:bool isActive) throws (1:CatalogServiceException cex),
-
 
105
	list<Item> getAllItems(1:bool isActive) throws (1:CatalogServiceException cex),
88
	ItemAttribs getItemAtttribs(1:i64 item_id) throws (1:CatalogServiceException cex),
106
	list<Item> getAllItemsByStatus(1:status itemStatus) throws (1:CatalogServiceException cex),
89
	ItemInventory getItemInventory(1:i64 item_id) throws (1:CatalogServiceException cex),
107
	ItemInventory getItemInventory(1:i64 item_id) throws (1:CatalogServiceException cex),
-
 
108
	i64 getItemAvailibilityAtWarehouse(1:i64 warehouse_id, 2:i64 item_id) throws (1:CatalogServiceException cex),
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),
109
	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),
-
 
110
	list<Warehouse> getAllWarehouses(1:bool isActive) throws (1:CatalogServiceException cex),
91
	Warehouse getWarehouse(1:i64 warehouse_id) throws (1:CatalogServiceException cex),
111
	Warehouse getWarehouse(1:i64 warehouse_id) throws (1:CatalogServiceException cex),
92
	list<Warehouse> getAllWarehousesForItem(1:i64 item_is) throws (1:CatalogServiceException cex),
112
	list<Warehouse> getAllWarehousesForItem(1:i64 item_id) throws (1:CatalogServiceException cex),
-
 
113
	list<Item> getAllItemsForWarehouse(1:i64 warehouse_id) throws (1:CatalogServiceException cex),
-
 
114
	Vendor getVendor(1:i64 vendor_id) throws (1:CatalogServiceException cex),
-
 
115
	list<Vendor> getAllVendors(1:bool isActive) throws (1:CatalogServiceException cex),
93
	i64 getExpectedDeliveryTime(1:i64 item_id) throws (1:CatalogServiceException cex),
116
	//i64 getExpectedDeliveryTime(1:i64 item_id) throws (1:CatalogServiceException cex)
94
	
-
 
95
	
-
 
96
 
-
 
97
}
117
}
98
 
118