Rev 22715 | Blame | Compare with Previous | Last modification | View Log | RSS feed
namespace java in.shop2020.model.v1.usernamespace py shop2020.thriftpy.model.v1.userinclude "GenericService.thrift"/**Exceptions*/exception AuthenticationException{1:string message,2:i32 errorCode}exception UserContextException{1:i32 errorCode,2:string message}exception ShoppingCartException{1:i64 id,2:string message}exception UserCommunicationException{1:i64 id,2:string message}exception UserAffiliateException{1:i64 id,2:string message}enum UserType{USER = 0,ANONYMOUS = 1}enum PromotionType{DISCOUNT_COUPON = 0,GIFT_VOUCHER = 1}enum AddressType{WORK = 0,HOME = 1}/** Added by Manish Sharma*/enum CouponCategory{CUSTOMER_SATISFACTION = 0,MARKETING = 1,REFUND = 2,CATEGORY = 3}/**Form types for Contact Us form*/enum UserCommunicationType{RETURN_FORM = 1,ORDER_CANCELLATION = 2,DELIVERY_PROBLEM = 3,PAYMENT_STATUS = 4,ORDER_STATUS = 5,PRODUCT_REQUEST = 6,RECHARGE_RELATED = 7,OTHER = 8,Bulk_Order_ENQUIRY = 21}/**Affiliate track log types for affiliate tracking*/enum TrackLogType{NEW_REGISTRATION = 1,PAYMENT_SUCCESS = 2}/**Address*/struct Address{1:i64 id,2:string line1,3:string line2,4:string landmark,5:string city,6:string state,7:string pin,8:string country,9:bool enabled,10:AddressType type,11:i64 addedOn,12:string name,13:string phone,14:bool taxInvoiceAvailable,15:bool creditOptionAvailable}enum Sex{MALE,FEMALE,WONT_SAY}/**The user structure holding the basic information that identifies the user.**/struct User{1:i64 userId,2:string email,3:string password,4:string name,5:string dateOfBirth,6:Sex sex,7:optional string mobileNumber,8:i64 lastLogin,9:i64 lastLogout,10:i64 activeSince,11:list<Address> addresses,12:i64 defaultAddressId,13:string communicationEmail,14:i64 activeCartId,15:string jsessionId,16:bool isAnonymous,17:string source,18:i64 sourceStartTime,19:double trustLevel,20:bool isFacebookUser,21:string facebookAccessToken,22:string facebookId,23:i64 sourceId}struct UserCommunication{1:i64 id,2:i64 userId,3:UserCommunicationType communicationType,4:i64 orderId,5:string airwaybillNo,6:string replyTo,7:string productName,8:string subject,9:string message,10:i64 communication_timestamp}struct MasterAffiliate{1:i64 id,2:string name,3:i64 addedOn}struct Affiliate{1:i64 id,2:string name,3:string url,4:i64 masterAffiliateId,5:i64 addedOn}struct Tracker{1:i64 id,2:i64 affiliateId,}struct TrackLog{1:i64 id,2:i64 addedOn,3:i64 affiliateId,4:i64 userId,5:TrackLogType eventType,6:string url,7:string data}struct ItemQuantity {1:i64 itemId,2:i64 qty,}struct ItemPriceQuantity {1:i64 itemId,2:double price,3:i64 qty}//Various statuses for line itemsenum LineStatus{LINE_ACTIVE, //line is activeLINE_DELETED, //line is deletedLINE_EXPIRED, //line is expired, on laspse of fixed amount of timeLINE_COMMITED, //line is committed, sent for processing.LINE_COMMIT_FAILED, //line was committed, but commit failed due to some reason, possibly during cart validation.LINE_AUTO_DELETED, //line was auto deleted internally due to some reason(item delisted, price changed etc).}//Various statuses for Cartenum CartStatus{ACTIVE,INACTIVE,EXPIRED,COMMITTED,COMMIT_FAILED}struct Discount{1:i64 cart_id,2:i64 item_id,3:double discount,4:double quantity}struct Line{1:i64 cartId, //identifier2:i64 itemId, //item id added3:double quantity, //quantity added4:i64 createdOn, //addition timestamp5:i64 updatedOn, //any updation in quantity or status6:LineStatus lineStatus, //current status7:i32 estimate, //delivery estimate in hours8:double actualPrice,9:double discountedPrice,10:list<Discount> discounts,11:i64 insurer,12:double insuranceAmount,13:i64 dataProtectionInsurer,14:double dataProtectionAmount,15:string dealText,16:i64 freebieId}struct Cart{1:i64 id, //identifier2:list<Line> lines, //list of lines3:CartStatus status, //current status4:i64 createdOn, //creation timestamp5:i64 updatedOn, //time of last update in cart (like addition/deletion/updation of cart items )6:i64 checkedOutOn, //commited timestamp7:i64 addressId, //address on which this will be shipped8:double totalPrice,9:double discountedPrice,10:string couponCode,11:i64 pickupStoreId,12:string message, //This is introduced to display custom message as and when required to the Website for user display.13:double wallet_amount}struct CartPlus {1:Cart cart,2:string pinCode,3:bool needInsuranceInfo,4:list<string> validateCartMessages}enum WidgetType{MY_RESEARCH,BROWSE_HISTORY}struct UserWidgetItem{1:i64 userId,2:i64 widgetId,3:i64 itemId,4:i64 addedOn}exception WidgetException{1:i64 id,2:string message}/**Exceptions for Promotion Service*/exception PromotionException{1:i64 id,2:string message}/**Types for Promotion Service*/struct Promotion{1:i64 id,2:string name,3:string ruleExecutionSrc,4:i64 startOn,5:i64 endOn,6:i64 createdOn}enum CounterVerificationType{NOT_VERIFIED,OFFLINE,ONLINE}struct Counter {1:i64 id,2:string code,3:string name,4:string ownerName,5:string email,6:string mobile,7:string alternateMobile,8:bool striker,9:string tin,10:i64 spCounterSize,11:i64 fpCounterSize,12:string dob,13:i64 addedOn,14:i64 address,15:bool documentVerified,16:CounterVerificationType verificationType,17:i64 verifiedOn,18:string gstin}struct CounterOnlineInfo {1:i64 counterId,2:string tinNumber,3:string cstNumber,4:string dealerName,5:string dealerAddress,6:string state,7:string pan,8:i64 registrationDate,9:bool registrationStatus,10:i64 validatedTill,11:i64 created}struct Coupon{1:string couponCode,2:Promotion promotion,3:string arguments,4:CouponCategory coupon_category}struct PromotionTracking{1:string couponCode,2:i64 transactionId,3:i64 userId,4:bool appliedOn}struct ItemCouponDiscount{1:i64 itemId,2:string couponCode,3:double discount}enum VoucherType{SPICEDECK_MOBILE=1}struct Voucher{1:i64 id,2:string voucherCode,3:VoucherType voucherType,4:i64 issuedOn,5:double amount,6:i64 expiredOn,7:string userEmail}struct PrivateDealUser{1:i64 userId,2:i64 addedOn,3:bool isActive,4:i64 counterId,5:string tin,6:double bulkShipmentAmountLimit,7:bool creditorAssigned,8:bool tinVerified,9:i64 isFofo}struct AccessTokenizer{1:i64 id,2:i64 userId,3:string source,4:string tokenString,5:i64 expiredTime,6:bool expired}/**Promotion Service*/service PromotionService extends GenericService.GenericService{void createPromotion(1:string name, 2:string ruleExecutionSrc, 3:i64 startOn, 4:i64 endOn) throws (1:PromotionException pex),i64 removeAllCouponsByPromotionId(1:i64 promotionId) throws (1:PromotionException pex),Coupon getCoupon(1:string couponCode) throws (1:PromotionException pex),bool isGiftVoucher(1:string couponCode) throws (1:PromotionException pex),bool isCodApplicable(1:Cart cart) throws (1:PromotionException pex),list<Promotion> getAllPromotions() throws (1:PromotionException pex),Promotion getPromotionById(1:i64 promotionId) throws (1:PromotionException pex),void generateCouponsForPromotion(1:i64 promotionId, 2:string couponCode) throws (1:PromotionException pex),Cart applyCoupon(1:string couponCode, 2:i64 cartId) throws (1:PromotionException pex),map<i64,double> getEmiDiscount(1:i64 cartId) throws (1:PromotionException pex),map<i64, string> applyRechargeCoupon(1:string couponCode, 2:i64 totalAmount, 3:i64 userId) throws (1:PromotionException pex),void trackCouponUsage(1:string couponCode, 2:i64 transactionId, 3:i64 userId, 4:i64 amount, 5:bool isDigital) throws (1:PromotionException pex),i64 getCouponUsageCountByUser(1:string couponCode, 2:i64 userId) throws (1:PromotionException pex),list<Coupon> getActiveCodes(1:i64 promotionId) throws (1:PromotionException pex),void deleteCoupon(1:string couponCode) throws (1:PromotionException pex),list<Coupon> getAllCouponsByPromotionId(1:i64 promotionId) throws (1:PromotionException pex),/**Returns a list of active coupons*/list<Coupon> getActiveCoupons() throws (1:PromotionException pex),/**Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.*/string createCoupon(1:i64 promotionId,2:i64 couponCategory, 3:string couponCode, 4:string arguments 5:bool isCod, 6:string prefix) throws (1:PromotionException pex),/**Returns the count of successful payments done using a given coupon*/i64 getSuccessfulPaymentCountForCoupon(1:string couponCode) throws (1:PromotionException pex),/**Returns the doc string of the rule module*/string getRuleDocString(1:string ruleName),list<ItemCouponDiscount> getItemDiscountMap(1:list<i64> itemIds) throws (1:PromotionException pex),map<string, double> getDiscountsForEntity(1:i64 entityId),void addVoucher(1:Voucher voucher),Voucher assignVoucher(1:i64 userId, 2:string userEmail, 3:VoucherType voucherType, 4:i64 amount),bool markVoucherAsRedeemed(1:string voucherCode, 2:i64 redeemedOn)}/**service*/service UserContextService extends GenericService.GenericService{User createAnonymousUser(1:string jsessionId) throws (1:UserContextException ucex),User getUserById(1:i64 userId) throws (1:UserContextException ucex),User getUserByCartId(1:i64 cartId) throws (1:UserContextException ucex),User getUserByEmail(1:string email) throws (1:UserContextException ucex),User getUserByMobileNumber(1:i64 mobileNumber) throws (1:UserContextException ucex),User createUser(1:User user) throws (1:UserContextException ucex),User updateUser(1:User user) throws (1:UserContextException ucex),User authenticateUser(1:string email, 2:string password) throws (1:AuthenticationException auex),bool userExists(1:string email) throws (1:UserContextException ucx),i64 addAddressForUser(1:i64 userId, 2:Address address, 3:bool setDefault)throws (1:UserContextException ucx),bool removeAddressForUser(1:i64 userid, 2:i64 addressId)throws (1:UserContextException ucx),bool updateAddress(1:Address address)throws (1:UserContextException ucx),bool updateCounter(1:Counter counter)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 setDefaultAddress(1:i64 userid, 2:i64 addressId)throws (1:UserContextException ucx),bool updatePassword(1:i64 userid, 2:string oldPassword, 3:string newPassword)throws (1:UserContextException ucx),bool forgotPassword(1:string email, 2:string newPassword)throws (1:UserContextException ucx),list<Address> getAllAddressesForUser(1:i64 userId)throws (1:UserContextException ucx),Address getAddressById(1:i64 addressId)throws (1:UserContextException ucx),i64 getDefaultAddressId(1:i64 userId)throws (1:UserContextException ucx),string getDefaultPincode(1:i64 userId)throws (1:UserContextException ucx),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)UserCommunication getUserCommunicationById(1:i64 id) throws (1:UserCommunicationException ucx)list<UserCommunication> getUserCommunicationByUser(1:i64 userId) throws (1:UserCommunicationException ucx)list<UserCommunication> getAllUserCommunications() throws (1:UserCommunicationException ucx)void removeUserCommunication(1:i64 id) throws (1:UserCommunicationException ucx)MasterAffiliate createMasterAffiliate(1:string name, 2:i64 addedOn) throws (1:UserAffiliateException utx)list<MasterAffiliate> getAllMasterAffiliates() throws (1:UserAffiliateException utx)MasterAffiliate getMasterAffiliateById(1:i64 id) throws (1:UserAffiliateException utx)MasterAffiliate getMasterAffiliateByName(1:string name) throws (1:UserAffiliateException utx)Affiliate createAffiliate(1:string name, 2:string url, 3:i64 masterAffiliateId, 4:i64 addedOn) throws (1:UserAffiliateException utx)Affiliate getAffiliateById(1:i64 id) throws (1:UserAffiliateException utx)Affiliate getAffiliateByName(1:string name) throws (1:UserAffiliateException utx)Tracker getTrackerById(1:i64 id) throws (1:UserAffiliateException utx)list<Affiliate> getAffiliatesByMasterAffiliate(1:i64 id) throws (1:UserAffiliateException utx)i64 addTrackLog(1:i64 affiliateId, 2:i64 userId, 3:TrackLogType event, 4:string url, 5:string data, 6:i64 addedOn) throws (1:UserAffiliateException utx)TrackLog getTrackLogById(1:i64 id) throws (1:UserAffiliateException utx)list<TrackLog> getTrackLogsByAffiliate(1:i64 affiliateId, 2:i64 startDate, 3:i64 endDate) throws (1:UserAffiliateException utx)list<TrackLog> getTrackLogsByUser(1:i64 userId) throws (1:UserAffiliateException utx)list<TrackLog> getTrackLogs(1:i64 userId, 2:string event, 3:string url) throws (1:UserAffiliateException utx)Cart getCurrentCart(1:i64 userId) throws (1:ShoppingCartException scx),Cart getCart(1:i64 cartId) throws (1:ShoppingCartException scx),list<Cart> getCartsByTime(1:i64 from_time, 2:i64 to_time, 3:CartStatus status) throws (1:ShoppingCartException scx),string addItemToCart(1:i64 cartId, 2:i64 itemId, 3:i64 quantity, 4:i64 sourceId) throws (1:ShoppingCartException scx),void deleteItemFromCart(1:i64 cartId, 2:i64 itemId) throws (1:ShoppingCartException scx),void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),void addStoreToCart(1:i64 cartId, 2:i64 storeId) throws (1:ShoppingCartException scx),void applyCouponToCart(1:Cart cart, 2:string couponCode) throws (1:ShoppingCartException scx),void removeCoupon(1:i64 cartId) throws (1:ShoppingCartException scx),/**Deletes all the discounts associated with the cart*/void deleteDiscountsFromCart(1:i64 cartId) throws (1:ShoppingCartException scx),/**Accepts a list of thrift objects of Discount type and saves them*/void saveDiscounts(1:list<Discount> discounts) throws (1:ShoppingCartException scx),/**Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.*/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),/**Validates that:1. The checkout timestamp is greater than the updatedOn timestamp.2. All of the lines in the cart are active items.3. The estimate for any of the lines in cart doesn't change.If all three are true, returns empty string; else returns appropriate message.*/list<string> validateCart(1:i64 cartId, 2:i64 sourceId) throws (1:ShoppingCartException scex),/**Validates that:1. The checkout timestamp is greater than the updatedOn timestamp.2. All of the lines in the cart are active items.3. The estimate for any of the lines in cart doesn't change.If all three are true, returns empty string; else returns appropriate message.*/list<string> validateCartWithDealerCoupon(1:i64 cartId, 2:i64 sourceId, 3:string dealCoupon) throws (1:ShoppingCartException scex),/**Merges the lines from the first cart into the second cart. Lines with duplicate items are removed.*/void mergeCart(1:i64 fromCartId, 2:i64 toCartId),/**Sets the checkedOutOn timestamp of the cart. Raises an exception if the specified cart can't be found.*/bool checkOut(1:i64 cartId) throws (1:ShoppingCartException scex),/**The second parameter is a map of item ids and their quantities which have been successfully processed.This methods removes the specified quantity of the specified item from the cart.*/bool resetCart(1:i64 cartId, 2:map<i64, double> items) throws (1:ShoppingCartException scex),/**Returns number of registered users.If userType = null, then it returns count of all users, including anonymousIf userType = UserType.ANONYMOUS, then it returns count of anonymous users onlyIf userType = UserType.USER, then it returns count of non-anonymous users only*/i64 getUserCount(1:UserType userType),/**Returns list of users of type userType who registered between startDate and endDate (both inclusive).If any of startDate or endDate is -1, then that filter is ignored.If userType is null, then returns all the users, irrespective of anonymous flag*/list<User> getAllUsers(1:UserType userType, 2:i64 startDate, 3:i64 endDate),/**Returns list of item ids in myresearch for the user*/list<i64> getMyResearchItems(1:i64 userId) throws (1:WidgetException scx),/**add item to my research for a user*/bool updateMyResearch(1:i64 userId, 2:i64 itemId) throws (1:WidgetException scx),/**delete item from my research for a user*/void deleteItemFromMyResearch(1:i64 userId, 2:i64 itemId) throws (1:WidgetException scx),/**Returns list of item ids in browse history for the user. It will return maximum 10 items.*/list<i64> getBrowseHistoryItems(1:i64 userId) throws (1:WidgetException scx),/**add item to browse history for a user*/void updateBrowseHistory(1:i64 userId, 2:i64 itemId),/**Returns count of Carts with given coupon applied*/i64 getCartsWithCouponCount(1:string couponCode),/*** Updates COD trust level of a user*/oneway void increaseTrustLevel(1:i64 userId, 2:double trustLevelDelta),/*** Get trust level of a user*/double getTrustLevel(1:i64 userId),/*** Returns true/false depending on wether COD is allowed for a cart or not*/bool showCODOption(1:i64 cartId, 2:i64 sourceId, 3:string pincode),/*** Get email addresses for users activated within a given date range*/list<string> getUserEmails(1:i64 startDate, 2:i64 endDate),/*** Mark a cart lineitem as insured. Returns true/false.*/bool insureItem(1:i64 itemId, 2:i64 cartId, 3:bool toInsure, 4:i32 insurerType),/*** Cancel insurance for all items in the cart*/bool cancelInsurance(1:i64 cartId),/*** Stores insurance specific details like date of birth and guardianName*/bool storeInsuranceSpecificDetails(1:i64 addressId, 2:string dob, 3:string guardianName),/*** Return true or false based on whether the user has stored any insurance info corresponding to the given addressId*/bool isInsuranceDetailPresent(1:i64 addressId)/*** Returns list of item ids which added to cart from startDate to endDate*/list<i64> getProductsAddedToCart(1:i64 startDate, 2:i64 endDate)/*** This method is speciically used to avoid overloadaed calls to userClient*/CartPlus validateCartPlus(1:i64 cartId, 2:i64 sourceId, 3:string dealerCoupon) throws (1:ShoppingCartException scex)bool isPrivateDealUser(1:i64 userId)bool addPrivateDealUser(1:i64 userId)bool changePrivateDealUserStatus(1:i64 userId,2:bool isActive)PrivateDealUser getPrivateDealUser(1:i64 userId)map<string,string> registerCounter(1:Counter counter, 2:i64 userId)list<Counter> searchCounter(1:string type1, 2:string searchString)Counter getCounterByUserId(1:i64 userId)list<User> getAllUsersByCounter(1:i64 counterId)string getActiveAccessTokenForUser(1:i64 userId, 2:string source)bool validateAccessToken(1:string accessToken)bool addItemsToCart(1:i64 cartId, 2:list<ItemQuantity> itemQty, 3:string couponCode)string validateCartNew(1:i64 cartId, 2:string pinCode, 3:i64 sourceId)bool isAddressEditableForCounter(1:i64 userId)Address getBillingAddressForUser(1:i64 userId)bool isCreditorAssigned(1:i64 userId)bool isTaxInvoiceEnabledUser(1:i64 userId)bool taxInvoiceAvailable(1:i64 addressId)map<i64, list<Line>> getCartByValue(1:list<i64> cartIds)map<i64, string> getCounterName(1:list<i64> userIds)bool setWalletAmountInCart(1:i64 cartId, 2:double wallet_amount)bool addItemPricingToCart(1:i64 cartId, 2:list<ItemPriceQuantity> itemPriceQuantityList)}