Subversion Repositories SmartDukaan

Rev

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

Rev 1111 Rev 1115
Line 96... Line 96...
96
	**/
96
	**/
97
	23:i64 created_timestamp,
97
	23:i64 created_timestamp,
98
	24:i64 accepted_timestamp,
98
	24:i64 accepted_timestamp,
99
	25:i64 billing_timestamp,
99
	25:i64 billing_timestamp,
100
	26:i64 shipping_timestamp,
100
	26:i64 shipping_timestamp,
-
 
101
	27:i64 pickup_timestamp,
101
	27:i64 delivery_timestamp,
102
	28:i64 delivery_timestamp,
102
	28:i64 jacket_number,
103
	29:i64 jacket_number,
103
}
104
}
104
 
105
 
105
struct Transaction{
106
struct Transaction{
106
	1:i64 id,
107
	1:i64 id,
107
	2:list<Order> orders,
108
	2:list<Order> orders,
Line 153... Line 154...
153
	bool changeTransactionStatus(1:i64 transactionId, 2:TransactionStatus status, 3:string description) throws (1:TransactionServiceException ex),
154
	bool changeTransactionStatus(1:i64 transactionId, 2:TransactionStatus status, 3:string description) throws (1:TransactionServiceException ex),
154
	*/
155
	*/
155
	
156
	
156
	list<Order> getAllOrders(1:OrderStatus status, 2:i64 from_date, 3:i64 to_date, 4:i64 warehouse_id) throws (1:TransactionServiceException ex),
157
	list<Order> getAllOrders(1:OrderStatus status, 2:i64 from_date, 3:i64 to_date, 4:i64 warehouse_id) throws (1:TransactionServiceException ex),
157
	
158
	
-
 
159
	/**
158
	// Returns orders within a range of their billing dates
160
	Returns orders within a range of their billing dates
-
 
161
	*/
159
	list<Order> getOrdersByBillingDate(1:OrderStatus status, 2:i64 start_billing_date, 3:i64 end_billing_date, 4:i64 warehouse_id) throws (1:TransactionServiceException ex),
162
	list<Order> getOrdersByBillingDate(1:OrderStatus status, 2:i64 start_billing_date, 3:i64 end_billing_date, 4:i64 warehouse_id) throws (1:TransactionServiceException ex),
160
	
163
	
161
	bool changeOrderStatus(1:i64 orderId, 2:OrderStatus status, 3:string description) throws (1:TransactionServiceException ex),
164
	bool changeOrderStatus(1:i64 orderId, 2:OrderStatus status, 3:string description) throws (1:TransactionServiceException ex),
162
	bool addBillingDetails(1:i64 orderId, 2:string invoice_number, 3:i64 jacket_number, 4:string billed_by) throws (1:TransactionServiceException ex),
165
	bool addBillingDetails(1:i64 orderId, 2:string invoice_number, 3:i64 jacket_number, 4:string billed_by) throws (1:TransactionServiceException ex),
163
 
166
 
Line 172... Line 175...
172
	
175
	
173
	/**
176
	/**
174
	Marks all BILLED orders for a warehouse and a provider as SHIPPED_FROM_WH
177
	Marks all BILLED orders for a warehouse and a provider as SHIPPED_FROM_WH
175
	*/
178
	*/
176
	bool markOrdersAsManifested(1:i64 warehouseId, 2:i64 providerId) throws (1:TransactionServiceException ex),
179
	bool markOrdersAsManifested(1:i64 warehouseId, 2:i64 providerId) throws (1:TransactionServiceException ex),
-
 
180
	
-
 
181
	/**
-
 
182
	Marks all SHIPPED_FROM_WH orders of the previous day for a provider as SHIPPED_TO_LOGISTICS.
-
 
183
	Returns a list of orders that were shipped from warehouse but did not appear in the pick-up report.
-
 
184
	Raises an exception if we encounter report for an AWB number that we did not ship.
-
 
185
	*/
-
 
186
	list<Order> markOrdersAsPickedUp(1:i64 providerId, 2:map<string, i64> pickupDetails) throws (1:TransactionServiceException ex),
177
	//Alerts apis 
187
	//Alerts apis 
178
	list<Alert> getAlerts(1:i64 orderId, 2:bool valid),
188
	list<Alert> getAlerts(1:i64 orderId, 2:bool valid),
179
	void setAlert(1:i64 orderId, 2:bool unset, 3:i64 type, 4: string comment),
189
	void setAlert(1:i64 orderId, 2:bool unset, 3:i64 type, 4: string comment),
180
}
-
 
181
 
-
 
182
 
-
 
183
/*
-
 
184
 
-
 
185
enum PaymentStatus{
-
 
186
	FAILURE,
-
 
187
	SUCCESS
-
 
188
}
-
 
189
 
-
 
190
enum ShipmentStatus{
-
 
191
	YET_TO_SHIP,
-
 
192
	SHIPPED,
-
 
193
	IN_TRANSIT,
-
 
194
	DELIVERY_SUCCESS,
-
 
195
	DELIVERY_FAILED_FIRST_ATTEMPT,
-
 
196
	DELIVERY_FAILED_SECOND_ATTEMPT,
-
 
197
	DELIVERY_FAILED_THIRD_ATTEMPT,
-
 
198
	DELIVERY_FAILED_WORNG_ADDRESS
-
 
199
}
-
 
200
 
-
 
201
enum TransactionStatus{
-
 
202
	INCOMPLETE,
-
 
203
	INIT,
-
 
204
	SUBMITTED_FOR_PROCESSING,
-
 
205
	ORDER_FULFILLMENT,
-
 
206
	READY_FOR_SHIPPING,
-
 
207
	SHIPPED,
-
 
208
	COMPLETED,
-
 
209
	CANCELED,
-
 
210
	FAILED,	
-
 
211
	BILLED	
-
 
212
}
-
 
213
 
-
 
214
 
-
 
215
struct Item{
-
 
216
	1:i64 id,
-
 
217
	2:double price,
-
 
218
	3:double weight
-
 
219
}
-
 
220
 
-
 
221
struct LineItem{
-
 
222
	1:Item item,
-
 
223
	2:i64 id,
-
 
224
	3:i64 addedOn,
-
 
225
	4:map<string,string> additionalInfo
-
 
226
}
-
 
227
 
-
 
228
struct OrderInfo{
-
 
229
	1:i64 id,
-
 
230
	2:list<LineItem> lineitems
-
 
231
}
-
 
232
 
-
 
233
struct Billing{
-
 
234
	1:i64 id,
-
 
235
	2:string billNumber,
-
 
236
	3:list<LineItem> lineItem,
-
 
237
	4:i64 generatedTimestamp,
-
 
238
	5:string generatedBy
-
 
239
}
-
 
240
 
-
 
241
struct BillingInfo{
-
 
242
	1:i64 id,
-
 
243
	2:list<Billing> billings
-
 
244
}
-
 
245
 
-
 
246
struct Shipment{
-
 
247
	1:i64 id,
-
 
248
	2:string address,
-
 
249
	3:string trackingId,
-
 
250
	4:list<LineItem> lineItems,
-
 
251
	5:ShipmentStatus status,
-
 
252
	6:i64 shipmentTimestamp,
-
 
253
	7:i64 deliveryTimestamp,
-
 
254
	8:double value,
-
 
255
	9:double insurance,
-
 
256
	10:double weight,
-
 
257
	11:string airwayBillNo,
-
 
258
	12:string provider
-
 
259
}
-
 
260
 
-
 
261
struct ShipmentInfo{
-
 
262
	1:list<Shipment> shipments,
-
 
263
	2:i64 id
-
 
264
}
-
 
265
 
-
 
266
struct Payment{
-
 
267
	1:i64 id,
-
 
268
	2:string merchant_tx_id,
-
 
269
	3:string bank_tx_id,
-
 
270
	4:string mode,
-
 
271
	5:double amount,
-
 
272
	6:PaymentStatus status,
-
 
273
	7:string description,
-
 
274
	9:i64 submissionTimestamp,
-
 
275
	10:i64 completionTimestamp
-
 
276
}
-
 
277
 
-
 
278
struct PaymentInfo{
-
 
279
	1:i64 id,
-
 
280
	2:map<i64,Payment> payments
-
 
281
}
-
 
282
 
-
 
283
struct Transaction{
-
 
284
	1:i64 id,
-
 
285
	2:OrderInfo orderInfo,
-
 
286
	3:ShipmentInfo shipmentInfo,
-
 
287
	4:BillingInfo billingInfo,
-
 
288
	5:PaymentInfo paymentInfo,
-
 
289
	6:i64 createdOn,
-
 
290
	7:i64 expectedDeliveryTime,
-
 
291
	8:TransactionStatus transactionStatus,
-
 
292
	9:string statusDescription,
-
 
293
	10:i64 customer_id,
-
 
294
	11:i64 shoppingCartid,
-
 
295
	12:i64 warehouse_id
-
 
296
}
-
 
297
 
-
 
298
struct Alert{
-
 
299
	1:i64 id,
-
 
300
	2:i64 transaction_id,
-
 
301
	3:i64 type,
-
 
302
	4:i64 time_set,
-
 
303
	5:string comment,
-
 
304
	6:i64 time_unset
-
 
305
}
-
 
306
 
-
 
307
struct ExtraOrderInfo{
-
 
308
	1:i64 id,
-
 
309
	2:i64 transaction_id,
-
 
310
	3:i64 sku_id,
-
 
311
	4:string model_name,
-
 
312
	5:string vendor_info,
-
 
313
	6:string colour
-
 
314
}
-
 
315
 
-
 
316
 
-
 
317
 
-
 
318
exception TransactionServiceException{
-
 
319
	1:i32 errorCode,
-
 
320
	2:string message
-
 
321
}
-
 
322
 
-
 
323
service TransactionService{
-
 
324
	
-
 
325
	i64 createTransaction(1:Transaction transaction) throws (1:TransactionServiceException ex),
-
 
326
	
-
 
327
	//	Get transaction methods.
-
 
328
	
-
 
329
	Transaction getTransaction(1:i64 id) throws (1:TransactionServiceException ex),
-
 
330
	list<Transaction> getAllTransactions(1:TransactionStatus status, 2:i64 from_date, 3:i64 to_date, 4:i64 warehouse_id) throws (1:TransactionServiceException ex),
-
 
331
	list<Transaction> getTransactionsForShipmentStatus(1:ShipmentStatus status, 2:i64 from_date, 3:i64 to_date) throws (1:TransactionServiceException ex),
-
 
332
	list<Transaction> getTransactionsForCustomer(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:TransactionStatus status) throws (1:TransactionServiceException ex),
-
 
333
	list<Transaction> getTransactionsForCustomerAndShipmentStatus(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:ShipmentStatus status) throws (1:TransactionServiceException ex),
-
 
334
	list<Transaction> getTransactionsForShoppingCartId(1:i64 shoppingCartId) throws (1:TransactionServiceException ex),
-
 
335
	TransactionStatus getTransactionStatus(1:i64 transactionId) throws (1:TransactionServiceException ex),
-
 
336
	bool changeTransactionStatus(1:i64 transactionId, 2:TransactionStatus status, 3:string description) throws (1:TransactionServiceException ex),
-
 
337
	
-
 
338
	//	Get and set individual objects in it
-
 
339
	
-
 
340
	OrderInfo getOrderInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
-
 
341
	ShipmentInfo getShippingInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
-
 
342
	BillingInfo getBillingInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
-
 
343
	bool addBilling(1:i64 tranactionId,2: Billing billing) throws (1:TransactionServiceException ex),
-
 
344
	bool setShippingTracker(1:i64 transactionId, 2:i64 shippingId, 3:string trackingId, 4:string airwayBillNo, 5:string provider) throws (1:TransactionServiceException ex),
-
 
345
	bool setShippingDate(1:i64 transactionId, 2:i64 shippingId, 3:i64 timestamp) throws (1:TransactionServiceException ex),
-
 
346
	bool setDeliveryDate(1:i64 transactionId, 2:i64 shippingid, 3:i64 timestamp) throws (1:TransactionServiceException ex),
-
 
347
	bool changeShippingStatus(1:i64 transactionId, 2:i64 shippingId, 3:ShipmentStatus status, 4:string description) throws (1:TransactionServiceException ex),
-
 
348
	bool addTrail(1:i64 transactionId, 2:string description)throws (1:TransactionServiceException ex),
-
 
349
	//Alerts apis set on 5th June
-
 
350
	list<Alert> getAlerts(1:i64 transactionId, 2:bool valid),
-
 
351
	void setAlert(1:i64 transactionId, 2:bool unset, 3:i64 type, 4: string comment),
-
 
352
	//extra order info apis. added for demo
-
 
353
	ExtraOrderInfo getExtraInfo(1:i64 transaction_id),
-
 
354
	void setExtraInfo(1:i64 transaction_id, 2:i64 sku_id, 3:string model, 4:string colour, 5:string vendor)
-
 
355
}
-
 
356
*/
-
 
357
190
}
-
 
191
358
192