Rev 95 | Rev 123 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
namespace java in.shop2020.model.v1.usernamespace py shop2020.thriftpy.model.v1.user/**Exceptions*/exception AuthenticationException{1:string message,2:i32 errorCode}exception UserContextException{1:i32 errorCode,2:string message}enum AddressType{WORK,HOME}/**All the social handles*/struct SocialHandles{1:string facebook,2:string opensocial,3:string twitter}/**Address*/struct Address{1:string line1,2:string line2,3:string landmark,4:string city,5:string state,6:string pin,7:string country,8:i64 id,9:bool enabled,10:TAddressType type,11:i64 addedOn}/**Primary information of the user**/struct UserPrimaryInfo{1:i64 userId,2:string title,3:string firstName,4:string lastName,5:string pictureUrl,6:string email,7:string mobile,8:string workPhone,9:string userHandle,10:string password,11:SocialHandles socialHandles,12:i64 dateOfBirth,13:i64 anniversary,14:set<Address> addresses,16:i32 shipmentOption,17:string middleName,18:string occupation}/**Internal information to be used by system. various variables which aid in serving the user are identified and put here**/struct UserInternalInfo{1:i64 userId,2:i64 geoZone,3:i64 shipmentZone,4:i64 taxZone,5:double userRankScore}/**structure representing timestamp and ip at which user logged into the system**/struct IPMap{1:i64 timestamp2:Stirng ip}/**dynamic user state**/struct UserState{1:i64 userId,2:bool isEmailVerified,3:i64 lastLogin,4:i64 lastLogout,5:i64 emailVerificationSentOn,6:i64 smsVerificationSentOn,7:bool isSMSVerified,8:i64 activeSince,9:bool isLoggedIn,10:list<IPMap> ips}/**complete user structre**/struct UserContext{1:UserPrimaryInfo primaryInfo,2:UserInternalInfo internalInfo,3:UserState userState,4:i64 id5:i64 sessionid //in case user is not logged in, the id would be -1 and session id would help to uniquely identify the user}/**service*/service UserContextService{UserContext createContext(1: UserContext context, 2: bool updateExisting) throws (1:UserContextException cex),UserContext getContextFromId(1:i64 userId, 2:bool isSessionId) throws (1:UserContextException ucx),UserContext getContextFromEmailOrHandle(1:string emailorhandle, 2:bool isEmail) throws (1:UserContextException ucx),UserState getState(1:i64 userId, 2:bool isSessionId) throws (1:UserContextException ucx),UserPrimaryInfo getPrimaryInfo(1:i64 userId, 2:bool isSessionId) throws (1:UserContextException ucx),UserInternalInfo getInternalInfo(1:i64 userId, 2:bool isSessionId) throws (1:UserContextException ucx),UserContext getContext(1:string email, 2:string password) throws (1:AuthenticationException ax),bool userExists(1:string email)throws (1:UserContextException ucx),bool addIpAdressForUser(1:string ip, 2:i64 timestamp, 3:i64 userId)throws (1:UserContextException ucx),bool addAddressForUser(1:Address address, 2:i64 userid, 3:i64 timestamp)throws (1:UserContextException ucx),bool removeAddressForUser(1:i64 userid, 2:i64 addressId)throws (1:UserContextException ucx),bool setUserAsLoggedIn(1:i64 userId, 2:i64 timestamp)throws (1:UserContextException ucx),bool setUserAsLoggedOut(1:i64 userid, 2:i64 timestamp)throws (1:UserContextException ucx),bool updatePassword(1:i64 userid, 2:string password)throws (1:UserContextException ucx),bool deleteUser(1:i64 userid, 2:bool isSessionId)throws (1:UserContextException ucx),bool sendEmailVerification(1:i64 userid)throws (1:UserContextException ucx),bool sendSMSVerification(1:i64 userid)throws (1:UserContextException ucx),bool confirmEmailVerification(1:i64 userid)throws (1:UserContextException ucx),bool confirmSMSVerification(1:i64 userid)throws (1:UserContextException ucx),bool addSocialhandle(1:i64 userid, 2:string socialService, 3:string handle)throws (1:UserContextException ucx)}