Subversion Repositories SmartDukaan

Rev

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

Rev 4668 Rev 5326
Line 75... Line 75...
75
    NEW_REGISTRATION = 1,
75
    NEW_REGISTRATION = 1,
76
    PAYMENT_SUCCESS = 2
76
    PAYMENT_SUCCESS = 2
77
}
77
}
78
 
78
 
79
/**
79
/**
80
All the social handles
-
 
81
*/
-
 
82
struct SocialHandles{
-
 
83
	1:string facebook,
-
 
84
	2:string opensocial,
-
 
85
	3:string twitter
-
 
86
}
-
 
87
 
-
 
88
/**
-
 
89
Address
80
Address
90
*/
81
*/
91
struct Address{
82
struct Address{
92
	1:i64 id,
83
	1:i64 id,
93
	2:string line1,
84
	2:string line1,
Line 102... Line 93...
102
	11:i64 addedOn,
93
	11:i64 addedOn,
103
	12:string name,
94
	12:string name,
104
	13:string phone
95
	13:string phone
105
}
96
}
106
 
97
 
107
/**Phone
-
 
108
**/
-
 
109
struct Phone{
-
 
110
	1:i64 id,
-
 
111
	2:string countryCode,
-
 
112
	3:string areaCode,
-
 
113
	4:string number,
-
 
114
	5:string extension,
-
 
115
	6:PhoneType type
-
 
116
}
-
 
117
 
-
 
118
/**
-
 
119
Internal information to be used by system. various variables which aid in serving the user are identified and put here
-
 
120
**/
-
 
121
struct UserInternalInfo{
-
 
122
	1:i64 userId,
-
 
123
	2:i64 geoZone,
-
 
124
	3:i64 shipmentZone,
-
 
125
	4:i64 taxZone,
-
 
126
	5:double userRankScore
-
 
127
}
-
 
128
 
-
 
129
/**
-
 
130
structure representing timestamp and ip at which user logged into the system
-
 
131
**/
-
 
132
struct IPMap{
-
 
133
	1:i64 timestamp
-
 
134
	2:string ip
-
 
135
}
-
 
136
 
-
 
137
/**
-
 
138
dynamic user state 
-
 
139
**/
-
 
140
struct UserState{
-
 
141
	1:i64 userId,
-
 
142
	2:i64 lastLogin,
-
 
143
	3:i64 lastLogout,
-
 
144
	4:i64 emailVerificationSentOn,
-
 
145
	5:i64 smsVerificationSentOn,
-
 
146
	6:bool isEmailVerified,
-
 
147
	7:bool isSMSVerified,
-
 
148
	8:i64 activeSince,
-
 
149
	9:list<IPMap> ips,
-
 
150
	10:AccountStatus status
-
 
151
}
-
 
152
 
-
 
153
enum Sex{
98
enum Sex{
154
	MALE,
99
	MALE,
155
	FEMALE,
100
	FEMALE,
156
	WONT_SAY
101
	WONT_SAY
157
}
102
}
Line 165... Line 110...
165
	3:string password,
110
	3:string password,
166
	4:string name,
111
	4:string name,
167
	5:string dateOfBirth,
112
	5:string dateOfBirth,
168
	6:Sex sex,
113
	6:Sex sex,
169
	7:optional string mobileNumber,
114
	7:optional string mobileNumber,
170
	8:SocialHandles socialHandles,
115
	8:i64 lastLogin,
-
 
116
	9:i64 lastLogout,
-
 
117
	10:i64 activeSince,
171
	9:list<Address> addresses,
118
	11:list<Address> addresses,
172
	10:i64 defaultAddressId,
119
	12:i64 defaultAddressId,
173
	11:string communicationEmail,
120
	13:string communicationEmail,
174
	12:i64 activeCartId,
121
	14:i64 activeCartId,
175
	13:string jsessionId,
122
	15:string jsessionId,
176
	14:bool isAnonymous,
123
	16:bool isAnonymous,
177
	15:string source,
124
	17:string source,
178
	16:i64 sourceStartTime,
125
	18:i64 sourceStartTime,
179
	17:double trustLevel
126
	19:double trustLevel
180
}
127
}
181
 
128
 
182
struct UserCommunication{
129
struct UserCommunication{
183
	1:i64 id,
130
	1:i64 id,
184
	2:i64 userId,
131
	2:i64 userId,
Line 272... Line 219...
272
	2:list<Line> lines,		//list of lines
219
	2:list<Line> lines,		//list of lines
273
	3:CartStatus status,	//current status
220
	3:CartStatus status,	//current status
274
	4:i64 createdOn,		//creation timestamp
221
	4:i64 createdOn,		//creation timestamp
275
	5:i64 updatedOn,		//time of last update in cart (like addition/deletion/updation of cart items )
222
	5:i64 updatedOn,		//time of last update in cart (like addition/deletion/updation of cart items )
276
	6:i64 checkedOutOn,		//commited timestamp
223
	6:i64 checkedOutOn,		//commited timestamp
277
	7:i64 userId,			//user id to which it belongs
-
 
278
	8:i64 addressId,	    //address on which this will be shipped
224
	7:i64 addressId,	    //address on which this will be shipped
279
	9:double totalPrice,
225
	8:double totalPrice,
280
	10:double discountedPrice,
226
	9:double discountedPrice,
281
	11:string couponCode
227
	10:string couponCode
282
}
228
}
283
 
229
 
284
enum WidgetType{
230
enum WidgetType{
285
	MY_RESEARCH,
231
	MY_RESEARCH,
286
	BROWSE_HISTORY
232
	BROWSE_HISTORY
Line 375... Line 321...
375
*/
321
*/
376
service UserContextService extends GenericService.GenericService{
322
service UserContextService extends GenericService.GenericService{
377
	
323
	
378
	User createAnonymousUser(1:string jsessionId) throws (1:UserContextException ucex),
324
	User createAnonymousUser(1:string jsessionId) throws (1:UserContextException ucex),
379
	User getUserById(1:i64 userId) throws (1:UserContextException ucex),
325
	User getUserById(1:i64 userId) throws (1:UserContextException ucex),
-
 
326
	User getUserByCartId(1:i64 cartId) throws (1:UserContextException ucex),
380
	User getUserByEmail(1:string email) throws (1:UserContextException ucex),
327
	User getUserByEmail(1:string email) throws (1:UserContextException ucex),
381
    User getUserByMobileNumber(1:i64 mobileNumber) throws (1:UserContextException ucex),
328
    User getUserByMobileNumber(1:i64 mobileNumber) throws (1:UserContextException ucex),
382
	User createUser(1:User user) throws (1:UserContextException ucex),
329
	User createUser(1:User user) throws (1:UserContextException ucex),
383
	User updateUser(1:User user) throws (1:UserContextException ucex),
330
	User updateUser(1:User user) throws (1:UserContextException ucex),
384
	bool deleteUser(1:i64 userId) throws (1:UserContextException ucex),
-
 
385
	UserState getUserState(1:i64 userId) throws (1:UserContextException ucex),
-
 
386
	User authenticateUser(1:string email, 2:string password) throws (1:AuthenticationException auex),
331
	User authenticateUser(1:string email, 2:string password) throws (1:AuthenticationException auex),
387
	bool userExists(1:string email) throws (1:UserContextException ucx),
332
	bool userExists(1:string email) throws (1:UserContextException ucx),
388
	i64 addAddressForUser(1:i64 userId, 2:Address address, 3:bool setDefault)throws (1:UserContextException ucx),
333
	i64 addAddressForUser(1:i64 userId, 2:Address address, 3:bool setDefault)throws (1:UserContextException ucx),
389
	bool removeAddressForUser(1:i64 userid, 2:i64 addressId)throws (1:UserContextException ucx),
334
	bool removeAddressForUser(1:i64 userid, 2:i64 addressId)throws (1:UserContextException ucx),
390
	bool setUserAsLoggedIn(1:i64 userId, 2:i64 timestamp)throws (1:UserContextException ucx),
335
	bool setUserAsLoggedIn(1:i64 userId, 2:i64 timestamp)throws (1:UserContextException ucx),
Line 418... Line 363...
418
	list<TrackLog> getTrackLogs(1:i64 userId, 2:string event, 3:string url) throws (1:UserAffiliateException utx)
363
	list<TrackLog> getTrackLogs(1:i64 userId, 2:string event, 3:string url) throws (1:UserAffiliateException utx)
419
    
364
    
420
	i64 createCart(1:i64 userId) throws (1:ShoppingCartException scx),
365
	i64 createCart(1:i64 userId) throws (1:ShoppingCartException scx),
421
	Cart getCurrentCart(1:i64 userId) throws (1:ShoppingCartException scx),	
366
	Cart getCurrentCart(1:i64 userId) throws (1:ShoppingCartException scx),	
422
	Cart getCart(1:i64 cartId) throws (1:ShoppingCartException scx),
367
	Cart getCart(1:i64 cartId) throws (1:ShoppingCartException scx),
423
	list<Cart> getCartsForUser(1:i64 userId, 2:CartStatus status) throws (1:ShoppingCartException scx),
-
 
424
	list<Cart> getCartsByStatus(1:CartStatus status) throws (1:ShoppingCartException scx),
-
 
425
	list<Cart> getCartsByTime(1:i64 from_time, 2:i64 to_time, 3:CartStatus status) throws (1:ShoppingCartException scx),
368
	list<Cart> getCartsByTime(1:i64 from_time, 2:i64 to_time, 3:CartStatus status) throws (1:ShoppingCartException scx),
426
	void changeCartStatus(1:i64 cartId, 2:CartStatus status) throws (1:ShoppingCartException scx),
-
 
427
	string addItemToCart(1:i64 cartId, 2:i64 itemId, 3:i64 quantity, 4:i64 sourceId) throws (1:ShoppingCartException scx),
369
	string addItemToCart(1:i64 cartId, 2:i64 itemId, 3:i64 quantity, 4:i64 sourceId) throws (1:ShoppingCartException scx),
428
	void deleteItemFromCart(1:i64 cartId, 2:i64 itemId) throws (1:ShoppingCartException scx),
370
	void deleteItemFromCart(1:i64 cartId, 2:i64 itemId) throws (1:ShoppingCartException scx),
429
	void changeItemStatus(1:i64 cartId, 2:i64 itemId, 3:LineStatus status) throws (1:ShoppingCartException scx),
-
 
430
	void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),
371
	void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),
431
	void applyCouponToCart(1:i64 cartId, 2:string couponCode, 3:double totalPrice, 4:double discountedPrice) throws (1:ShoppingCartException scx),
372
	void applyCouponToCart(1:i64 cartId, 2:string couponCode, 3:double totalPrice, 4:double discountedPrice) throws (1:ShoppingCartException scx),
432
	void removeCoupon(1:i64 cartId) throws (1:ShoppingCartException scx),
373
	void removeCoupon(1:i64 cartId) throws (1:ShoppingCartException scx),
433
	
374
	
434
	/**
375
	/**
Line 442... Line 383...
442
	void saveDiscounts(1:list<Discount> discounts) throws (1:ShoppingCartException scx),
383
	void saveDiscounts(1:list<Discount> discounts) throws (1:ShoppingCartException scx),
443
	
384
	
444
	/**
385
	/**
445
	 Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.
386
	 Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.
446
	*/
387
	*/
447
	i64 createOrders(1:i64 cartId, 2:string sessionSource, 3:i64 sessionStartTime, 4:string firstSource, 5:i64 firstSourceTime) throws (1:ShoppingCartException scx),
388
	i64 createOrders(1:i64 cartId, 2:string sessionSource, 3:i64 sessionStartTime, 4:string firstSource, 5:i64 firstSourceTime, 6:i64 userId) throws (1:ShoppingCartException scx),
448
	
389
	
449
	/**
390
	/**
450
	 Validates that:
391
	 Validates that:
451
	 1. The checkout timestamp is greater than the updatedOn timestamp.
392
	 1. The checkout timestamp is greater than the updatedOn timestamp.
452
	 2. All of the lines in the cart are active items.
393
	 2. All of the lines in the cart are active items.