Subversion Repositories SmartDukaan

Rev

Rev 22715 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
48 ashish 1
namespace java in.shop2020.model.v1.user
95 ashish 2
namespace py shop2020.thriftpy.model.v1.user
48 ashish 3
 
3374 rajveer 4
include "GenericService.thrift"
5
 
48 ashish 6
/**
7
Exceptions
8
*/
9
exception AuthenticationException{
10
	1:string message,
11
	2:i32 errorCode
12
}
13
 
14
exception UserContextException{
15
	1:i32 errorCode,
16
	2:string message
17
}
18
 
552 chandransh 19
exception ShoppingCartException{
20
	1:i64 id,
21
	2:string message
22
}
23
 
1116 varun.gupt 24
exception UserCommunicationException{
25
	1:i64 id,
26
	2:string message
27
}
28
 
1995 vikas 29
exception UserAffiliateException{
1848 vikas 30
    1:i64 id,
31
    2:string message
32
}
33
 
1599 ankur.sing 34
enum UserType{
35
	USER = 0,
36
	ANONYMOUS = 1 
37
}
38
 
6367 amit.gupta 39
enum PromotionType{
40
	DISCOUNT_COUPON = 0,
41
	GIFT_VOUCHER = 1 
42
}
43
 
121 ashish 44
enum AddressType{
130 ashish 45
	WORK = 0,
46
	HOME = 1
48 ashish 47
}
48
 
8707 manish.sha 49
/** Added by Manish Sharma
50
*/
51
enum CouponCategory{
52
	CUSTOMER_SATISFACTION = 0,
53
	MARKETING = 1,
11653 amit.gupta 54
	REFUND = 2,
55
	CATEGORY = 3
8707 manish.sha 56
}
130 ashish 57
 
48 ashish 58
/**
1116 varun.gupt 59
Form types for Contact Us form
60
*/
61
enum UserCommunicationType{
62
	RETURN_FORM = 1,
63
	ORDER_CANCELLATION = 2,
64
	DELIVERY_PROBLEM = 3,
65
	PAYMENT_STATUS = 4,
66
	ORDER_STATUS = 5,
67
	PRODUCT_REQUEST = 6,
6176 amit.gupta 68
	RECHARGE_RELATED = 7,
11890 kshitij.so 69
	OTHER = 8,
70
	Bulk_Order_ENQUIRY = 21
6176 amit.gupta 71
 
1116 varun.gupt 72
}
73
 
74
/**
3379 vikas 75
Affiliate track log types for affiliate tracking
76
*/
77
enum TrackLogType{
78
    NEW_REGISTRATION = 1,
79
    PAYMENT_SUCCESS = 2
80
}
81
 
82
/**
121 ashish 83
Address
84
*/
85
struct Address{
552 chandransh 86
	1:i64 id,
87
	2:string line1,
88
	3:string line2,
89
	4:string landmark,
90
	5:string city,
91
	6:string state,
92
	7:string pin,
93
	8:string country,
48 ashish 94
	9:bool enabled,
123 ashish 95
	10:AddressType type,
414 ashish 96
	11:i64 addedOn,
97
	12:string name,
18735 manish.sha 98
	13:string phone,
99
	14:bool taxInvoiceAvailable,
100
	15:bool creditOptionAvailable
48 ashish 101
}
102
 
552 chandransh 103
enum Sex{
104
	MALE,
105
	FEMALE,
106
	WONT_SAY
107
}
108
 
121 ashish 109
/**
552 chandransh 110
The user structure holding the basic information that identifies the user.
121 ashish 111
**/
552 chandransh 112
struct User{
113
	1:i64 userId,
114
	2:string email,
115
	3:string password,
116
	4:string name,
566 rajveer 117
	5:string dateOfBirth,
1116 varun.gupt 118
	6:Sex sex,
3853 mandeep.dh 119
	7:optional string mobileNumber,
5326 rajveer 120
	8:i64 lastLogin,
121
	9:i64 lastLogout,
122
	10:i64 activeSince,
123
	11:list<Address> addresses,
124
	12:i64 defaultAddressId,
125
	13:string communicationEmail,
126
	14:i64 activeCartId,
127
	15:string jsessionId,
128
	16:bool isAnonymous,
129
	17:string source,
130
	18:i64 sourceStartTime,
7825 amar.kumar 131
	19:double trustLevel,
132
	20:bool isFacebookUser,
133
	21:string facebookAccessToken,
8201 rajveer 134
	22:string facebookId,
135
	23:i64 sourceId
48 ashish 136
}
137
 
1116 varun.gupt 138
struct UserCommunication{
139
	1:i64 id,
140
	2:i64 userId,
141
	3:UserCommunicationType communicationType,
142
	4:i64 orderId,
143
	5:string airwaybillNo,
144
	6:string replyTo,
145
	7:string productName,
146
	8:string subject,
147
	9:string message,
1299 varun.gupt 148
	10:i64 communication_timestamp
1116 varun.gupt 149
}
150
 
1848 vikas 151
struct MasterAffiliate{
152
    1:i64 id,
153
    2:string name,
1861 vikas 154
    3:i64 addedOn
1848 vikas 155
}
156
 
157
struct Affiliate{
158
    1:i64 id,
159
    2:string name,
160
    3:string url,
1861 vikas 161
    4:i64 masterAffiliateId,
162
    5:i64 addedOn
1848 vikas 163
}
164
 
165
struct Tracker{
166
    1:i64 id,
1861 vikas 167
    2:i64 affiliateId,
1848 vikas 168
}
169
 
170
struct TrackLog{
171
    1:i64 id,
1861 vikas 172
    2:i64 addedOn,
1995 vikas 173
    3:i64 affiliateId,
1861 vikas 174
    4:i64 userId,
3379 vikas 175
    5:TrackLogType eventType,
1861 vikas 176
    6:string url,
177
    7:string data
1848 vikas 178
}
179
 
17782 amit.gupta 180
struct ItemQuantity {
181
	1:i64 itemId,
182
	2:i64 qty,
183
}
184
 
22452 amit.gupta 185
struct ItemPriceQuantity {
186
	1:i64 itemId,
187
	2:double price,
188
	3:i64 qty
189
}
17782 amit.gupta 190
 
22452 amit.gupta 191
 
552 chandransh 192
//Various statuses for line items
193
enum LineStatus{
194
	LINE_ACTIVE,			//line is active
195
	LINE_DELETED,			//line is deleted
196
	LINE_EXPIRED,			//line is expired, on laspse of fixed amount of time
197
	LINE_COMMITED,			//line is committed, sent for processing.
198
	LINE_COMMIT_FAILED,		//line was committed, but commit failed due to some reason, possibly during cart validation.
199
	LINE_AUTO_DELETED,		//line was auto deleted internally due to some reason(item delisted, price changed etc).
200
}
201
 
202
//Various statuses for Cart
203
enum CartStatus{
204
	ACTIVE,					
205
	INACTIVE,
206
	EXPIRED,
207
	COMMITTED,
208
	COMMIT_FAILED
209
}
210
 
3554 varun.gupt 211
struct Discount{
212
	1:i64 cart_id,
213
    2:i64 item_id,
214
    3:double discount,
215
    4:double quantity
216
}
217
 
552 chandransh 218
struct Line{
646 chandransh 219
	1:i64 cartId,				//identifier
552 chandransh 220
	2:i64 itemId,			//item id added
221
	3:double quantity,		//quantity added 
222
	4:i64 createdOn,		//addition timestamp
223
	5:i64 updatedOn, 		//any updation in quantity or status
224
	6:LineStatus lineStatus,	//current status
1984 varun.gupt 225
	7:i32 estimate,			//delivery estimate in hours
226
	8:double actualPrice,
3554 varun.gupt 227
	9:double discountedPrice,
6903 anupam.sin 228
	10:list<Discount> discounts,
229
	11:i64 insurer,
9299 kshitij.so 230
	12:double insuranceAmount,
231
	13:i64 dataProtectionInsurer,
11653 amit.gupta 232
	14:double dataProtectionAmount,
233
	15:string dealText,
11738 amit.gupta 234
	16:i64 freebieId
552 chandransh 235
}
236
 
237
struct Cart{
238
	1:i64 id,				//identifier
239
	2:list<Line> lines,		//list of lines
240
	3:CartStatus status,	//current status
241
	4:i64 createdOn,		//creation timestamp
242
	5:i64 updatedOn,		//time of last update in cart (like addition/deletion/updation of cart items )
687 chandransh 243
	6:i64 checkedOutOn,		//commited timestamp
5326 rajveer 244
	7:i64 addressId,	    //address on which this will be shipped
245
	8:double totalPrice,
246
	9:double discountedPrice,
5553 rajveer 247
	10:string couponCode,
6736 amit.gupta 248
	11:i64 pickupStoreId,
20873 kshitij.so 249
	12:string message,		//This is introduced to display custom message as and when required to the Website for user display.
250
	13:double wallet_amount
552 chandransh 251
}
252
 
11592 amit.gupta 253
struct CartPlus {
254
	1:Cart cart,
255
	2:string 	pinCode,
256
	3:bool needInsuranceInfo,
257
	4:list<string> validateCartMessages
258
}
259
 
552 chandransh 260
enum WidgetType{
770 rajveer 261
	MY_RESEARCH,
262
	BROWSE_HISTORY
263
}
264
 
2981 rajveer 265
struct UserWidgetItem{
266
	1:i64 userId,
267
	2:i64 widgetId,
268
	3:i64 itemId,
269
	4:i64 addedOn
552 chandransh 270
}
271
 
272
exception WidgetException{
273
	1:i64 id,
274
	2:string message
275
}
276
 
48 ashish 277
/**
1984 varun.gupt 278
Exceptions for Promotion Service
279
*/
12696 amit.gupta 280
 
1984 varun.gupt 281
exception PromotionException{
282
	1:i64 id,
283
	2:string message
284
}
285
 
286
/**
287
Types for Promotion Service
288
*/
289
 
290
struct Promotion{
291
	1:i64 id,
292
	2:string name,
293
	3:string ruleExecutionSrc,
294
	4:i64 startOn,
295
	5:i64 endOn,
296
	6:i64 createdOn
297
}
298
 
18634 manish.sha 299
enum CounterVerificationType{
300
	NOT_VERIFIED,
301
	OFFLINE,
302
	ONLINE
303
}
12696 amit.gupta 304
 
305
struct Counter {
306
	1:i64 id,
307
	2:string code,
308
	3:string name,
309
	4:string ownerName,
310
	5:string email,
311
	6:string mobile,
312
	7:string alternateMobile,
313
	8:bool striker,
314
	9:string tin,
315
	10:i64 spCounterSize,
316
	11:i64 fpCounterSize,
12722 amit.gupta 317
	12:string dob,
12696 amit.gupta 318
	13:i64 addedOn,
18634 manish.sha 319
	14:i64 address,
320
	15:bool documentVerified,
321
	16:CounterVerificationType verificationType,
21908 amit.gupta 322
	17:i64 verifiedOn,
21963 amit.gupta 323
	18:string gstin
12696 amit.gupta 324
}
325
 
18634 manish.sha 326
struct CounterOnlineInfo {
327
	1:i64 counterId,
328
	2:string tinNumber,
329
	3:string cstNumber,
330
	4:string dealerName,
331
	5:string dealerAddress,
332
	6:string state,
333
	7:string pan,
334
	8:i64 registrationDate,
335
	9:bool registrationStatus,
336
	10:i64 validatedTill,
337
	11:i64 created
338
}
339
 
1984 varun.gupt 340
struct Coupon{
12696 amit.gupta 341
	1:string couponCode, 
3554 varun.gupt 342
	2:Promotion promotion,
8707 manish.sha 343
	3:string arguments,
344
	4:CouponCategory coupon_category
1984 varun.gupt 345
}
346
 
347
struct PromotionTracking{
348
	1:string couponCode,
349
	2:i64 transactionId,
350
	3:i64 userId,
351
	4:bool appliedOn
352
}
353
 
4189 varun.gupt 354
struct ItemCouponDiscount{
355
	1:i64 itemId,
356
	2:string couponCode,
357
	3:double discount
358
}
359
 
5469 rajveer 360
enum VoucherType{
5492 rajveer 361
	SPICEDECK_MOBILE=1
5469 rajveer 362
}
363
 
364
struct Voucher{
365
	1:i64 id,
366
	2:string voucherCode,
367
	3:VoucherType voucherType,
368
	4:i64 issuedOn,
369
	5:double amount,
370
	6:i64 expiredOn,
371
	7:string userEmail
372
}
373
 
11890 kshitij.so 374
struct PrivateDealUser{
375
	1:i64 userId,
376
	2:i64 addedOn,
12696 amit.gupta 377
	3:bool isActive,
378
	4:i64 counterId,
13146 manish.sha 379
	5:string tin,
18634 manish.sha 380
	6:double bulkShipmentAmountLimit,
18735 manish.sha 381
	7:bool creditorAssigned,
22715 amit.gupta 382
	8:bool tinVerified,
383
	9:i64 isFofo
11890 kshitij.so 384
}
5469 rajveer 385
 
15251 manish.sha 386
struct AccessTokenizer{
387
	1:i64 id,
388
	2:i64 userId,
389
	3:string source,
390
	4:string tokenString,
391
	5:i64 expiredTime,
392
	6:bool expired
393
}
11890 kshitij.so 394
 
15251 manish.sha 395
 
1984 varun.gupt 396
/**
397
Promotion Service
398
*/
3374 rajveer 399
service PromotionService extends GenericService.GenericService{
1984 varun.gupt 400
	void createPromotion(1:string name, 2:string ruleExecutionSrc, 3:i64 startOn, 4:i64 endOn) throws (1:PromotionException pex),
7746 amit.gupta 401
	i64 removeAllCouponsByPromotionId(1:i64 promotionId) throws (1:PromotionException pex),
6301 amit.gupta 402
	Coupon getCoupon(1:string couponCode) throws (1:PromotionException pex),
403
	bool isGiftVoucher(1:string couponCode) throws (1:PromotionException pex),
11819 amit.gupta 404
	bool isCodApplicable(1:Cart cart) throws (1:PromotionException pex),
1984 varun.gupt 405
	list<Promotion> getAllPromotions() throws (1:PromotionException pex),
406
	Promotion getPromotionById(1:i64 promotionId) throws (1:PromotionException pex),
407
	void generateCouponsForPromotion(1:i64 promotionId, 2:string couponCode) throws (1:PromotionException pex),
408
	Cart applyCoupon(1:string couponCode, 2:i64 cartId) throws (1:PromotionException pex),
6736 amit.gupta 409
	map<i64,double>  getEmiDiscount(1:i64 cartId) throws (1:PromotionException pex),
6433 anupam.sin 410
	map<i64, string> applyRechargeCoupon(1:string couponCode, 2:i64 totalAmount, 3:i64 userId) throws (1:PromotionException pex),
13521 amit.gupta 411
    void trackCouponUsage(1:string couponCode, 2:i64 transactionId, 3:i64 userId, 4:i64 amount, 5:bool isDigital) throws (1:PromotionException pex),
3385 varun.gupt 412
    i64 getCouponUsageCountByUser(1:string couponCode, 2:i64 userId) throws (1:PromotionException pex),
6497 amit.gupta 413
    list<Coupon> getActiveCodes(1:i64 promotionId) throws (1:PromotionException pex),
414
    void deleteCoupon(1:string couponCode) throws (1:PromotionException pex),
7092 amit.gupta 415
    list<Coupon> getAllCouponsByPromotionId(1:i64 promotionId) throws (1:PromotionException pex),
3385 varun.gupt 416
 
417
    /**
418
     Returns a list of active coupons
419
     */
420
    list<Coupon> getActiveCoupons() throws (1:PromotionException pex),
421
 
422
    /**
6561 amit.gupta 423
     Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
6250 amit.gupta 424
     */
8707 manish.sha 425
    string createCoupon(1:i64 promotionId,2:i64 couponCategory, 3:string couponCode, 4:string arguments 5:bool isCod, 6:string prefix) throws (1:PromotionException pex),
6250 amit.gupta 426
 
427
    /**
3385 varun.gupt 428
     Returns the count of successful payments done using a given coupon
429
     */
430
    i64 getSuccessfulPaymentCountForCoupon(1:string couponCode) throws (1:PromotionException pex),
431
 
432
    /**
433
     Returns the doc string of the rule module
434
     */
4189 varun.gupt 435
    string getRuleDocString(1:string ruleName),
436
 
4494 varun.gupt 437
    list<ItemCouponDiscount> getItemDiscountMap(1:list<i64> itemIds) throws (1:PromotionException pex),
438
 
5469 rajveer 439
    map<string, double> getDiscountsForEntity(1:i64 entityId),
440
 
441
    void addVoucher(1:Voucher voucher),
442
    Voucher assignVoucher(1:i64 userId, 2:string userEmail, 3:VoucherType voucherType, 4:i64 amount),
443
    bool markVoucherAsRedeemed(1:string voucherCode, 2:i64 redeemedOn)
1984 varun.gupt 444
}
445
 
446
/**
48 ashish 447
service
448
*/
3374 rajveer 449
service UserContextService extends GenericService.GenericService{
763 rajveer 450
 
552 chandransh 451
	User createAnonymousUser(1:string jsessionId) throws (1:UserContextException ucex),
452
	User getUserById(1:i64 userId) throws (1:UserContextException ucex),
5326 rajveer 453
	User getUserByCartId(1:i64 cartId) throws (1:UserContextException ucex),
1491 vikas 454
	User getUserByEmail(1:string email) throws (1:UserContextException ucex),
3026 mandeep.dh 455
    User getUserByMobileNumber(1:i64 mobileNumber) throws (1:UserContextException ucex),
552 chandransh 456
	User createUser(1:User user) throws (1:UserContextException ucex),
457
	User updateUser(1:User user) throws (1:UserContextException ucex),
458
	User authenticateUser(1:string email, 2:string password) throws (1:AuthenticationException auex),
459
	bool userExists(1:string email) throws (1:UserContextException ucx),
566 rajveer 460
	i64 addAddressForUser(1:i64 userId, 2:Address address, 3:bool setDefault)throws (1:UserContextException ucx),
48 ashish 461
	bool removeAddressForUser(1:i64 userid, 2:i64 addressId)throws (1:UserContextException ucx),
22360 ashik.ali 462
	bool updateAddress(1:Address address)throws (1:UserContextException ucx),
22366 ashik.ali 463
	bool updateCounter(1:Counter counter)throws (1:UserContextException ucx),
48 ashish 464
	bool setUserAsLoggedIn(1:i64 userId, 2:i64 timestamp)throws (1:UserContextException ucx),
465
	bool setUserAsLoggedOut(1:i64 userid, 2:i64 timestamp)throws (1:UserContextException ucx),
506 rajveer 466
	bool setDefaultAddress(1:i64 userid, 2:i64 addressId)throws (1:UserContextException ucx),
592 rajveer 467
	bool updatePassword(1:i64 userid, 2:string oldPassword, 3:string newPassword)throws (1:UserContextException ucx),
895 rajveer 468
	bool forgotPassword(1:string email, 2:string newPassword)throws (1:UserContextException ucx),
592 rajveer 469
	list<Address> getAllAddressesForUser(1:i64 userId)throws (1:UserContextException ucx),
1892 vikas 470
	Address getAddressById(1:i64 addressId)throws (1:UserContextException ucx),
592 rajveer 471
	i64 getDefaultAddressId(1:i64 userId)throws (1:UserContextException ucx),
783 rajveer 472
	string getDefaultPincode(1:i64 userId)throws (1:UserContextException ucx),
552 chandransh 473
 
1167 varun.gupt 474
	bool saveUserCommunication(1:i64 userId, 2:string replyTo, 3:i64 communicationType, 4:i64 orderId, 5:string airwaybillNo, 6:string productName, 7:string subject, 8:string message)throws (1:UserCommunicationException ucx)
1590 varun.gupt 475
	UserCommunication getUserCommunicationById(1:i64 id) throws (1:UserCommunicationException ucx)
476
	list<UserCommunication> getUserCommunicationByUser(1:i64 userId) throws (1:UserCommunicationException ucx)
477
	list<UserCommunication> getAllUserCommunications() throws (1:UserCommunicationException ucx)
5407 amar.kumar 478
	void removeUserCommunication(1:i64 id) throws (1:UserCommunicationException ucx)
1116 varun.gupt 479
 
1995 vikas 480
	MasterAffiliate createMasterAffiliate(1:string name, 2:i64 addedOn) throws (1:UserAffiliateException utx)
481
	list<MasterAffiliate> getAllMasterAffiliates() throws (1:UserAffiliateException utx)
482
	MasterAffiliate getMasterAffiliateById(1:i64 id) throws (1:UserAffiliateException utx)
483
    MasterAffiliate getMasterAffiliateByName(1:string name) throws (1:UserAffiliateException utx)
484
	Affiliate createAffiliate(1:string name, 2:string url, 3:i64 masterAffiliateId, 4:i64 addedOn) throws (1:UserAffiliateException utx)
485
	Affiliate getAffiliateById(1:i64 id) throws (1:UserAffiliateException utx)
486
	Affiliate getAffiliateByName(1:string name) throws (1:UserAffiliateException utx)
487
	Tracker getTrackerById(1:i64 id) throws (1:UserAffiliateException utx)
488
	list<Affiliate> getAffiliatesByMasterAffiliate(1:i64 id) throws (1:UserAffiliateException utx)
3379 vikas 489
	i64 addTrackLog(1:i64 affiliateId, 2:i64 userId, 3:TrackLogType event, 4:string url, 5:string data, 6:i64 addedOn) throws (1:UserAffiliateException utx)
1995 vikas 490
	TrackLog getTrackLogById(1:i64 id) throws (1:UserAffiliateException utx)
3293 vikas 491
	list<TrackLog> getTrackLogsByAffiliate(1:i64 affiliateId, 2:i64 startDate, 3:i64 endDate) throws (1:UserAffiliateException utx)
1995 vikas 492
	list<TrackLog> getTrackLogsByUser(1:i64 userId) throws (1:UserAffiliateException utx)
493
	list<TrackLog> getTrackLogs(1:i64 userId, 2:string event, 3:string url) throws (1:UserAffiliateException utx)
1848 vikas 494
 
552 chandransh 495
	Cart getCurrentCart(1:i64 userId) throws (1:ShoppingCartException scx),	
496
	Cart getCart(1:i64 cartId) throws (1:ShoppingCartException scx),
497
	list<Cart> getCartsByTime(1:i64 from_time, 2:i64 to_time, 3:CartStatus status) throws (1:ShoppingCartException scx),
3556 rajveer 498
	string addItemToCart(1:i64 cartId, 2:i64 itemId, 3:i64 quantity, 4:i64 sourceId) throws (1:ShoppingCartException scx),
552 chandransh 499
	void deleteItemFromCart(1:i64 cartId, 2:i64 itemId) throws (1:ShoppingCartException scx),
577 chandransh 500
	void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),
5553 rajveer 501
	void addStoreToCart(1:i64 cartId, 2:i64 storeId) throws (1:ShoppingCartException scx),
6922 anupam.sin 502
	void applyCouponToCart(1:Cart cart, 2:string couponCode) throws (1:ShoppingCartException scx),
1984 varun.gupt 503
	void removeCoupon(1:i64 cartId) throws (1:ShoppingCartException scx),
687 chandransh 504
 
505
	/**
3554 varun.gupt 506
	Deletes all the discounts associated with the cart
507
	*/
508
	void deleteDiscountsFromCart(1:i64 cartId) throws (1:ShoppingCartException scx),
509
 
510
	/**
511
	Accepts a list of thrift objects of Discount type and saves them
512
	*/
513
	void saveDiscounts(1:list<Discount> discounts) throws (1:ShoppingCartException scx),
514
 
515
	/**
687 chandransh 516
	 Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.
517
	*/
21840 amit.gupta 518
	i64 createOrders(1:i64 cartId, 2:string sessionSource, 3:i64 sessionStartTime, 4:string firstSource, 5:i64 firstSourceTime, 6:i64 userId, 7:i64 schemeId, 8:i64 orderSource, 9:bool selfPickup) throws (1:ShoppingCartException scx),
687 chandransh 519
 
520
	/**
521
	 Validates that:
522
	 1. The checkout timestamp is greater than the updatedOn timestamp.
1466 ankur.sing 523
	 2. All of the lines in the cart are active items.
687 chandransh 524
	 3. The estimate for any of the lines in cart doesn't change.
1466 ankur.sing 525
	 If all three are true, returns empty string; else returns appropriate message.
687 chandransh 526
	*/
6736 amit.gupta 527
	list<string> validateCart(1:i64 cartId, 2:i64 sourceId) throws (1:ShoppingCartException scex),
11980 amit.gupta 528
 
529
	/**
530
	 Validates that:
531
	 1. The checkout timestamp is greater than the updatedOn timestamp.
532
	 2. All of the lines in the cart are active items.
533
	 3. The estimate for any of the lines in cart doesn't change.
534
	 If all three are true, returns empty string; else returns appropriate message.
535
	*/
536
	list<string> validateCartWithDealerCoupon(1:i64 cartId, 2:i64 sourceId, 3:string dealCoupon) throws (1:ShoppingCartException scex),
552 chandransh 537
 
687 chandransh 538
	/**
539
	 Merges the lines from the first cart into the second cart. Lines with duplicate items are removed.
540
	*/
541
	void mergeCart(1:i64 fromCartId, 2:i64 toCartId),
542
 
543
	/**
544
	 Sets the checkedOutOn timestamp of the cart. Raises an exception if the specified cart can't be found.
545
	*/
546
	bool checkOut(1:i64 cartId) throws (1:ShoppingCartException scex),
547
 
548
	/**
549
	 The second parameter is a map of item ids and their quantities which have been successfully processed.
23839 amit.gupta 550
	 This methods removes the specified quantity of the specified item from the cart.
770 rajveer 551
	 */
552
	bool resetCart(1:i64 cartId, 2:map<i64, double> items) throws (1:ShoppingCartException scex),
553
 
687 chandransh 554
 
1599 ankur.sing 555
	/**
556
	Returns number of registered users.
557
	If userType = null, then it returns count of all users, including anonymous
558
	If userType = UserType.ANONYMOUS, then it returns count of anonymous users only
559
	If userType = UserType.USER, then it returns count of non-anonymous users only
560
	*/
1672 ankur.sing 561
	i64 getUserCount(1:UserType userType),
1599 ankur.sing 562
 
1672 ankur.sing 563
	/**
1891 ankur.sing 564
	Returns list of users of type userType who registered between startDate and endDate (both inclusive).
565
	If any of startDate or endDate is -1, then that filter is ignored. 
566
	If userType is null, then returns all the users, irrespective of anonymous flag
567
 
1672 ankur.sing 568
	*/
2642 varun.gupt 569
	list<User> getAllUsers(1:UserType userType, 2:i64 startDate, 3:i64 endDate),
2717 varun.gupt 570
 
1599 ankur.sing 571
 
2981 rajveer 572
 
573
	/**
574
	Returns list of item ids in myresearch for the user
575
	*/
576
	list<i64> getMyResearchItems(1:i64 userId) throws (1:WidgetException scx),
577
	/**
578
	add item to my research for a user
579
	*/
580
	bool updateMyResearch(1:i64 userId, 2:i64 itemId) throws (1:WidgetException scx),
581
	/**
582
	delete item from my research for a user
583
	*/
584
	void deleteItemFromMyResearch(1:i64 userId, 2:i64 itemId) throws (1:WidgetException scx),
585
	/**
586
	Returns list of item ids in browse history for the user. It will return maximum 10 items.
587
	*/
588
	list<i64> getBrowseHistoryItems(1:i64 userId) throws (1:WidgetException scx),
589
	/**
590
	add item to browse history for a user
591
	*/
3385 varun.gupt 592
	void updateBrowseHistory(1:i64 userId, 2:i64 itemId),
593
 
594
	/**
595
	Returns count of Carts with given coupon applied
596
	*/
3499 mandeep.dh 597
	i64 getCartsWithCouponCount(1:string couponCode),
598
 
599
	/**
600
	 * Updates COD trust level of a user
601
	 */
4668 varun.gupt 602
	oneway void increaseTrustLevel(1:i64 userId, 2:double trustLevelDelta),
5407 amar.kumar 603
 
604
	/**
605
	 * Get trust level of a user
606
	 */	
607
	double getTrustLevel(1:i64 userId),
4668 varun.gupt 608
 
609
	/**
610
	 * Returns true/false depending on wether COD is allowed for a cart or not
611
	 */
6903 anupam.sin 612
	bool showCODOption(1:i64 cartId, 2:i64 sourceId, 3:string pincode),
5623 anupam.sin 613
 
614
	/**
615
	 * Get email addresses for users activated within a given date range
616
	 */
6903 anupam.sin 617
	list<string> getUserEmails(1:i64 startDate, 2:i64 endDate),
6821 amar.kumar 618
 
619
	/**
6903 anupam.sin 620
	 * Mark a cart lineitem as insured. Returns true/false. 
621
	 */
9299 kshitij.so 622
	 bool insureItem(1:i64 itemId, 2:i64 cartId, 3:bool toInsure, 4:i32 insurerType),
6903 anupam.sin 623
 
624
	 /**
625
	 * Cancel insurance for all items in the cart
626
	 */
627
	 bool cancelInsurance(1:i64 cartId),
628
 
629
	 /**
630
	 * Stores insurance specific details like date of birth and guardianName
631
	 */
632
	 bool storeInsuranceSpecificDetails(1:i64 addressId, 2:string dob, 3:string guardianName),
633
 
634
	 /**
635
	 * Return true or false based on whether the user has stored any insurance info corresponding to the given addressId
636
	 */
637
	 bool isInsuranceDetailPresent(1:i64 addressId)
638
 
639
	/**
9791 rajveer 640
	 * Returns list of item ids which added to cart from startDate to endDate 
6821 amar.kumar 641
	 */
9791 rajveer 642
	list<i64> getProductsAddedToCart(1:i64 startDate, 2:i64 endDate)
11592 amit.gupta 643
 
644
	/**
645
	* This method is speciically used to avoid overloadaed calls to userClient
646
	*/
11980 amit.gupta 647
	CartPlus validateCartPlus(1:i64 cartId, 2:i64 sourceId, 3:string dealerCoupon) throws (1:ShoppingCartException scex)
11592 amit.gupta 648
 
11679 vikram.rag 649
	bool isPrivateDealUser(1:i64 userId)
11592 amit.gupta 650
 
11890 kshitij.so 651
	bool addPrivateDealUser(1:i64 userId)
11592 amit.gupta 652
 
11890 kshitij.so 653
	bool changePrivateDealUserStatus(1:i64 userId,2:bool isActive)
654
 
655
	PrivateDealUser getPrivateDealUser(1:i64 userId)
11679 vikram.rag 656
 
12722 amit.gupta 657
	map<string,string> registerCounter(1:Counter counter, 2:i64 userId)
11890 kshitij.so 658
 
12722 amit.gupta 659
	list<Counter> searchCounter(1:string type1,  2:string searchString)
11890 kshitij.so 660
 
18977 amit.gupta 661
	Counter getCounterByUserId(1:i64 userId)
662
 
12722 amit.gupta 663
	list<User> getAllUsersByCounter(1:i64 counterId)
11890 kshitij.so 664
 
15251 manish.sha 665
	string getActiveAccessTokenForUser(1:i64 userId, 2:string source)
666
 
667
	bool validateAccessToken(1:string accessToken)
17782 amit.gupta 668
	bool addItemsToCart(1:i64 cartId, 2:list<ItemQuantity> itemQty, 3:string couponCode)
669
	string validateCartNew(1:i64 cartId, 2:string pinCode, 3:i64 sourceId)
15251 manish.sha 670
 
18634 manish.sha 671
	bool isAddressEditableForCounter(1:i64 userId)
672
 
673
	Address getBillingAddressForUser(1:i64 userId)
674
 
675
	bool isCreditorAssigned(1:i64 userId)
18735 manish.sha 676
 
677
	bool isTaxInvoiceEnabledUser(1:i64 userId)
19182 amit.gupta 678
 
679
	bool taxInvoiceAvailable(1:i64 addressId)
18764 kshitij.so 680
 
681
	map<i64, list<Line>> getCartByValue(1:list<i64> cartIds)
19888 manas 682
 
683
	map<i64, string> getCounterName(1:list<i64> userIds)
20873 kshitij.so 684
 
685
	bool setWalletAmountInCart(1:i64 cartId, 2:double wallet_amount)
22452 amit.gupta 686
 
687
	bool addItemPricingToCart(1:i64 cartId, 2:list<ItemPriceQuantity> itemPriceQuantityList)
19888 manas 688
 
2642 varun.gupt 689
}