Subversion Repositories SmartDukaan

Rev

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

Rev 1898 Rev 1984
Line 233... Line 233...
233
	2:i64 itemId,			//item id added
233
	2:i64 itemId,			//item id added
234
	3:double quantity,		//quantity added 
234
	3:double quantity,		//quantity added 
235
	4:i64 createdOn,		//addition timestamp
235
	4:i64 createdOn,		//addition timestamp
236
	5:i64 updatedOn, 		//any updation in quantity or status
236
	5:i64 updatedOn, 		//any updation in quantity or status
237
	6:LineStatus lineStatus,	//current status
237
	6:LineStatus lineStatus,	//current status
238
	7:i32 estimate			//delivery estimate in hours
238
	7:i32 estimate,			//delivery estimate in hours
-
 
239
	8:double actualPrice,
-
 
240
	9:double discountedPrice
239
}
241
}
240
 
242
 
241
struct Cart{
243
struct Cart{
242
	1:i64 id,				//identifier
244
	1:i64 id,				//identifier
243
	2:list<Line> lines,		//list of lines
245
	2:list<Line> lines,		//list of lines
244
	3:CartStatus status,	//current status
246
	3:CartStatus status,	//current status
245
	4:i64 createdOn,		//creation timestamp
247
	4:i64 createdOn,		//creation timestamp
246
	5:i64 updatedOn,		//time of last update in cart (like addition/deletion/updation of cart items )
248
	5:i64 updatedOn,		//time of last update in cart (like addition/deletion/updation of cart items )
247
	6:i64 checkedOutOn,		//commited timestamp
249
	6:i64 checkedOutOn,		//commited timestamp
248
	7:i64 userId,			//user id to which it belongs
250
	7:i64 userId,			//user id to which it belongs
249
	8:i64 addressId,	    //address on which this will be shipped			
251
	8:i64 addressId,	    //address on which this will be shipped
-
 
252
	9:double totalPrice,
-
 
253
	10:double discountedPrice,
-
 
254
	11:string couponCode
250
}
255
}
251
 
256
 
252
enum WidgetType{
257
enum WidgetType{
253
	MY_RESEARCH,
258
	MY_RESEARCH,
254
	BROWSE_HISTORY
259
	BROWSE_HISTORY
Line 299... Line 304...
299
	1:i64 id,
304
	1:i64 id,
300
	2:string message
305
	2:string message
301
}
306
}
302
 
307
 
303
/**
308
/**
-
 
309
Exceptions for Promotion Service
-
 
310
*/
-
 
311
exception PromotionException{
-
 
312
	1:i64 id,
-
 
313
	2:string message
-
 
314
}
-
 
315
 
-
 
316
/**
-
 
317
Types for Promotion Service
-
 
318
*/
-
 
319
 
-
 
320
struct Promotion{
-
 
321
	1:i64 id,
-
 
322
	2:string name,
-
 
323
	3:string ruleExecutionSrc,
-
 
324
	4:i64 startOn,
-
 
325
	5:i64 endOn,
-
 
326
	6:i64 createdOn
-
 
327
}
-
 
328
 
-
 
329
struct Coupon{
-
 
330
	1:string couponCode
-
 
331
	2:i64 promotionId
-
 
332
	3:string arguments
-
 
333
}
-
 
334
 
-
 
335
struct PromotionTracking{
-
 
336
	1:string couponCode,
-
 
337
	2:i64 transactionId,
-
 
338
	3:i64 userId,
-
 
339
	4:bool appliedOn
-
 
340
}
-
 
341
 
-
 
342
/**
-
 
343
Promotion Service
-
 
344
*/
-
 
345
service PromotionService{
-
 
346
	/**
-
 
347
	* For closing the open session in sqlalchemy
-
 
348
	*/
-
 
349
	void closeSession(),
-
 
350
	
-
 
351
	void createPromotion(1:string name, 2:string ruleExecutionSrc, 3:i64 startOn, 4:i64 endOn) throws (1:PromotionException pex),
-
 
352
	list<Promotion> getAllPromotions() throws (1:PromotionException pex),
-
 
353
	Promotion getPromotionById(1:i64 promotionId) throws (1:PromotionException pex),
-
 
354
	void generateCouponsForPromotion(1:i64 promotionId, 2:string couponCode) throws (1:PromotionException pex),
-
 
355
	Cart applyCoupon(1:string couponCode, 2:i64 cartId) throws (1:PromotionException pex),
-
 
356
    void trackCouponUsage(1:string couponCode, 2:i64 transactionId, 3:i64 userId) throws (1:PromotionException pex),
-
 
357
    i64 getCouponUsageCountByUser(1:string couponCode, 2:i64 userId) throws (1:PromotionException pex)
-
 
358
}
-
 
359
 
-
 
360
/**
304
service
361
service
305
*/
362
*/
306
service UserContextService{
363
service UserContextService{
307
	/**
364
	/**
308
	* For closing the open session in sqlalchemy
365
	* For closing the open session in sqlalchemy
Line 362... Line 419...
362
	void addItemToCart(1:i64 cartId, 2:i64 itemId, 3:i64 quantity) throws (1:ShoppingCartException scx),
419
	void addItemToCart(1:i64 cartId, 2:i64 itemId, 3:i64 quantity) throws (1:ShoppingCartException scx),
363
	void deleteItemFromCart(1:i64 cartId, 2:i64 itemId) throws (1:ShoppingCartException scx),
420
	void deleteItemFromCart(1:i64 cartId, 2:i64 itemId) throws (1:ShoppingCartException scx),
364
	void changeQuantity(1:i64 cartId, 2:i64 itemId, 3:i64 quantity) throws (1:ShoppingCartException scx),
421
	void changeQuantity(1:i64 cartId, 2:i64 itemId, 3:i64 quantity) throws (1:ShoppingCartException scx),
365
	void changeItemStatus(1:i64 cartId, 2:i64 itemId, 3:LineStatus status) throws (1:ShoppingCartException scx),
422
	void changeItemStatus(1:i64 cartId, 2:i64 itemId, 3:LineStatus status) throws (1:ShoppingCartException scx),
366
	void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),
423
	void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),
-
 
424
	void applyCouponToCart(1:i64 cartId, 2:string couponCode, 3:double totalPrice, 4:double discountedPrice) throws (1:ShoppingCartException scx),
-
 
425
	void removeCoupon(1:i64 cartId) throws (1:ShoppingCartException scx),
367
	
426
	
368
	/**
427
	/**
369
	 Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.
428
	 Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.
370
	*/
429
	*/
371
	i64 createOrders(1:i64 cartId) throws (1:ShoppingCartException scx),
430
	i64 createOrders(1:i64 cartId) throws (1:ShoppingCartException scx),