Subversion Repositories SmartDukaan

Rev

Rev 95 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
85 ashish 1
namespace java in.shop2020.model.v1.catalog
2
namespace py model.v1.catalog
3
 
4
/**
5
	Objects
6
*/
7
 
8
struct ItemAttribs{
9
//This is Naveen's struct
10
	1:i64 id,
11
}
12
 
13
struct Vendor{
14
	1:i64 id,
15
	2:string name
16
}
17
 
18
 
19
struct Warehouse{
20
	1:i64 id,
21
	2:string location,
22
	3:i64 vendor_id,
23
}
24
 
25
struct ItemInventory{
26
	1:i64 id,
27
	2:map<i64,i64> availability,
28
	3:map<i64, double> priceMatrix,
29
	4:i64 lastCheckedOn
30
}
31
 
32
struct ItemInventoryHistory{
33
	1:i64 item_id,
34
	2:i64 warehouse_id,
35
	3:i64 timestamp,
36
	4:i64 availability
37
}
38
 
39
struct Item{
40
	1:i64 id,
41
	2:i64 category_id,
42
	3:ItemAttribs itemAttribs,
43
	4:ItemInventory itemInventory
44
}
45
 
46
struct Category{
47
	1:i64 id,
48
	2:string name,
49
	3:list<Category> children,
50
	4:Category parent,
51
	5:bool isTopLevel,
52
	6:i64 addedOn
53
}
54
 
55
exception CatalogServiceException{
56
	1:i64 id,
57
	2:string message
58
}
59
 
60
 
61
 
62
 
63
service CatalogService{
64
 
65
/**
66
	Content methods
67
*/
68
 
69
/**
70
	Availability and inventory attributes	
71
*/
72
	//all add and update methods - added by Ashish
73
	void addCategory(1:Category category) throws (1:CatalogServiceException cex),
74
	void addItemToCategory(1:Item item, 2:i64 category_id) throws (1:CatalogServiceException cex),
75
	void addItemAttribsToItem(1:ItemAttribs, 2:i64 item_id) throws (1:CatalogServiceException cex),
76
	void addItemInventoryToItem(1:ItemInventory, 2:i64 item_id) throws (1:CatalogServiceException cex),
77
	void addWarehouse(1:Warehouse warehouse) throws (1:CatalogServiceException cex),
78
	void addVendor(1:Vendor vendor) throws (1:CatalogServiceException cex),
79
	void updateInventory(1:i64 item_id, 2:i64 warehouse_id, 3: i64 quantity, 4:i64 timestamp) throws (1:CatalogServiceException cex),
80
 
81
	//Other accessor methods - added by Ashish
82
	Category getCategory(1:i64id) throws (1:CatalogServiceException cex),
83
	list<Category> getAllCategories() throws (1:CatalogServiceException cex),
84
	Item getItem(1:i64 item_id) throws (1:CatalogServiceException cex),
85
	list<Item> getAllItemsForCategory(1:i64 category_id) throws (1:CatalogServiceException cex),
86
	ItemAttribs getItemAtttribs(1:i64 item_id) throws (1:CatalogServiceException cex),
87
	ItemInventory getItemInventory(1:i64 item_id) throws (1:CatalogServiceException cex),
88
	ItemInventoryHistory getItemInventoryHistory(1:i64 id, 2:i64 item_id, 3:i64 warehousr_id, 4: i64 from, 5:i64 to ) throws (1:CatalogServiceException cex),
89
	Warehouse getWarehouse(1:i64 warehouse_id) throws (1:CatalogServiceException cex),
90
	list<Warehouse> getAllWarehousesForItem(1:i64 item_is) throws (1:CatalogServiceException cex),
91
	i64 getExpectedDeliveryTime(1:i64 item_id) throws (1:CatalogServiceException cex),
92
 
93
 
94
 
95
}
96