Subversion Repositories SmartDukaan

Rev

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

Rev 3530 Rev 3554
Line 245... Line 245...
245
	EXPIRED,
245
	EXPIRED,
246
	COMMITTED,
246
	COMMITTED,
247
	COMMIT_FAILED
247
	COMMIT_FAILED
248
}
248
}
249
 
249
 
-
 
250
struct Discount{
-
 
251
	1:i64 cart_id,
-
 
252
    2:i64 item_id,
-
 
253
    3:double discount,
-
 
254
    4:double quantity
-
 
255
}
-
 
256
 
250
struct Line{
257
struct Line{
251
	1:i64 cartId,				//identifier
258
	1:i64 cartId,				//identifier
252
	2:i64 itemId,			//item id added
259
	2:i64 itemId,			//item id added
253
	3:double quantity,		//quantity added 
260
	3:double quantity,		//quantity added 
254
	4:i64 createdOn,		//addition timestamp
261
	4:i64 createdOn,		//addition timestamp
255
	5:i64 updatedOn, 		//any updation in quantity or status
262
	5:i64 updatedOn, 		//any updation in quantity or status
256
	6:LineStatus lineStatus,	//current status
263
	6:LineStatus lineStatus,	//current status
257
	7:i32 estimate,			//delivery estimate in hours
264
	7:i32 estimate,			//delivery estimate in hours
258
	8:double actualPrice,
265
	8:double actualPrice,
259
	9:double discountedPrice
266
	9:double discountedPrice,
-
 
267
	10:list<Discount> discounts
260
}
268
}
261
 
269
 
262
struct Cart{
270
struct Cart{
263
	1:i64 id,				//identifier
271
	1:i64 id,				//identifier
264
	2:list<Line> lines,		//list of lines
272
	2:list<Line> lines,		//list of lines
Line 310... Line 318...
310
	5:i64 endOn,
318
	5:i64 endOn,
311
	6:i64 createdOn
319
	6:i64 createdOn
312
}
320
}
313
 
321
 
314
struct Coupon{
322
struct Coupon{
315
	1:string couponCode
323
	1:string couponCode,
316
	2:Promotion promotion
324
	2:Promotion promotion,
317
	3:string arguments
325
	3:string arguments
318
}
326
}
319
 
327
 
320
struct PromotionTracking{
328
struct PromotionTracking{
321
	1:string couponCode,
329
	1:string couponCode,
Line 413... Line 421...
413
	void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),
421
	void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),
414
	void applyCouponToCart(1:i64 cartId, 2:string couponCode, 3:double totalPrice, 4:double discountedPrice) throws (1:ShoppingCartException scx),
422
	void applyCouponToCart(1:i64 cartId, 2:string couponCode, 3:double totalPrice, 4:double discountedPrice) throws (1:ShoppingCartException scx),
415
	void removeCoupon(1:i64 cartId) throws (1:ShoppingCartException scx),
423
	void removeCoupon(1:i64 cartId) throws (1:ShoppingCartException scx),
416
	
424
	
417
	/**
425
	/**
-
 
426
	Deletes all the discounts associated with the cart
-
 
427
	*/
-
 
428
	void deleteDiscountsFromCart(1:i64 cartId) throws (1:ShoppingCartException scx),
-
 
429
	
-
 
430
	/**
-
 
431
	Accepts a list of thrift objects of Discount type and saves them
-
 
432
	*/
-
 
433
	void saveDiscounts(1:list<Discount> discounts) throws (1:ShoppingCartException scx),
-
 
434
	
-
 
435
	/**
418
	 Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.
436
	 Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.
419
	*/
437
	*/
420
	i64 createOrders(1:i64 cartId, 2:string sessionSource, 3:i64 sessionStartTime) throws (1:ShoppingCartException scx),
438
	i64 createOrders(1:i64 cartId, 2:string sessionSource, 3:i64 sessionStartTime) throws (1:ShoppingCartException scx),
421
	
439
	
422
	/**
440
	/**