Subversion Repositories SmartDukaan

Rev

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

Rev 3374 Rev 3383
Line 79... Line 79...
79
	1:i64 id,
79
	1:i64 id,
80
	2:string displayName,
80
	2:string displayName,
81
	3:string location
81
	3:string location
82
}
82
}
83
 
83
 
84
enum StockLedgerStatus{
-
 
85
	PRESENT = 0,
-
 
86
	CHECKED_OUT = 1,
-
 
87
	SALES_RETURNED = 2,
-
 
88
	DOA = 3,
-
 
89
	DOA_RETURNED = 4
-
 
90
}
-
 
91
 
-
 
92
struct StockLedger{
-
 
93
	1:i64 id,
-
 
94
	2:i64 itemId,
-
 
95
	3:i64 warehouseId,
-
 
96
	4:i64 purchaseId,
-
 
97
	5:string itemNumber,
-
 
98
	6:string imeiNumber,
-
 
99
	7:StockLedgerStatus status	
-
 
100
}
-
 
101
 
-
 
102
enum ScanType{
84
enum ScanType{
103
	PURCHASE = 0,	//Scan-in at the time of purchase
85
	PURCHASE = 0,	//Scan-in at the time of purchase
104
	SALE = 1,		//Scan-out for sale
86
	SALE = 1,		//Scan-out for sale
105
	SALE_RET = 2,	//Scan-in when an item is returned undelivered
87
	SALE_RET = 2,	//Scan-in when an item is returned undelivered
106
	DOA_IN = 3,		//Scan-in when an item is returned by the customer with the DOA certificate
88
	DOA_IN = 3,		//Scan-in when an item is returned by the customer with the DOA certificate
Line 108... Line 90...
108
}
90
}
109
 
91
 
110
struct Scan{
92
struct Scan{
111
	1:i64 id,
93
	1:i64 id,
112
	2:i64 itemId,
94
	2:i64 itemId,
113
	3:i64 stockLedgerId,
95
	3:i64 warehouseId,
-
 
96
	4:i64 purchaseId,
-
 
97
	5:string itemNumber,
-
 
98
	6:string imeiNumber,
114
	4:ScanType type,
99
	7:ScanType type,
115
	5:i64 scannedAt
100
	8:i64 scannedAt
116
}
101
}
117
 
102
 
118
exception WarehouseServiceException{
103
exception WarehouseServiceException{
119
	1:i64 id,
104
	1:i64 id,
120
	2:string message
105
	2:string message
Line 129... Line 114...
129
	
114
	
130
	/**
115
	/**
131
	Returns the purchase order with the given id. Throws an exception if there is no such purchase order.
116
	Returns the purchase order with the given id. Throws an exception if there is no such purchase order.
132
	*/
117
	*/
133
	PurchaseOrder getPurchaseOrder(1:i64 id) throws (1:WarehouseServiceException wex),
118
	PurchaseOrder getPurchaseOrder(1:i64 id) throws (1:WarehouseServiceException wex),
-
 
119
 
-
 
120
	/**
-
 
121
	Returns a list of all the purchase orders in the given state
-
 
122
	*/
-
 
123
	list<PurchaseOrder> getAllPurchaseOrders(1:POStatus status) throws(1:WarehouseServiceException wex),
134
	
124
	
135
	/**
125
	/**
136
	Returns the supplier with the given order id. Throws an exception if there is no such supplier.
126
	Returns the supplier with the given order id. Throws an exception if there is no such supplier.
137
	*/
127
	*/
138
	Supplier getSupplier(1:i64 id) throws (1:WarehouseServiceException wex),
128
	Supplier getSupplier(1:i64 id) throws (1:WarehouseServiceException wex),
Line 148... Line 138...
148
	Throws an exception if no such purchase exists.
138
	Throws an exception if no such purchase exists.
149
	*/
139
	*/
150
	i64 closePurchase(1:i64 purchaseId) throws (1:WarehouseServiceException wex),
140
	i64 closePurchase(1:i64 purchaseId) throws (1:WarehouseServiceException wex),
151
	
141
	
152
	/**
142
	/**
-
 
143
	Returns all open or closed purchases for the given purchase order. Throws an exception if no such purchase order exists
-
 
144
	*/
-
 
145
	list<Purchase> getAllPurchases(1:i64 purchaseOrderId, 2:bool open) throws(1:WarehouseServiceException wex),
-
 
146
	
-
 
147
	/**
153
	Creates a StockLedger and a Scan object using the given details.
148
	Creates a Scan object using the given details.
154
	Raises an exception if no more of the given item can be scanned in against the purchase order of the given purchase.
149
	Raises an exception if no more of the given item can be scanned in against the purchase order of the given purchase.
155
	*/
150
	*/
156
	void scanIn(1:i64 purchaseId, 2:i64 itemId, 3:string itemNumber, 4:string imeiNumber, 5:ScanType type) throws (1:WarehouseServiceException wex),
151
	void scanIn(1:i64 purchaseId, 2:string itemNumber, 3:string imeiNumber, 4:ScanType type) throws (1:WarehouseServiceException wex),
157
	
152
	
158
	/**
153
	/**
159
	Marks the StockLedger object with the given details as scanned out. In case, the imeiNumber is not given,
154
	Marks the Scan object with the given details as scanned out. In case, the imeiNumber is not given,
160
	marks the oldest ItemInventory object as being scanned out.
155
	marks the oldest ItemInventory object as being scanned out.
161
	Creats a Scan object for this action.
-
 
162
	Raises an exception if:
156
	Raises an exception if:
163
	1. There is no stock present corresponding to the given item details.
157
	1. There is no stock present corresponding to the given item details.
164
	2. An older stock is present corresponding to the itemNumber which has not been scanned out.
158
	2. An older stock is present corresponding to the itemNumber which has not been scanned out.
165
	*/
159
	*/
166
	void scanOut(1:i64 itemNumber, 2:i64 imeiNumber, 3:ScanType type) throws (1:WarehouseServiceException wex)
160
	void scanOut(1:i64 itemNumber, 2:i64 imeiNumber, 3:ScanType type) throws (1:WarehouseServiceException wex)