Subversion Repositories SmartDukaan

Rev

Rev 6842 | Rev 6850 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
85 ashish 1
namespace java in.shop2020.model.v1.catalog
95 ashish 2
namespace py shop2020.thriftpy.model.v1.catalog
85 ashish 3
 
3374 rajveer 4
include "GenericService.thrift"
5
 
85 ashish 6
/**
7
	Objects
8
*/
9
 
123 ashish 10
/**
1330 chandransh 11
Caution :- Never ever change the numbers in it. Please confirm from @Chandranshu or @Rajveer before any changes in enum and other entries in file.
123 ashish 12
**/
5110 mandeep.dh 13
enum status {
123 ashish 14
	PHASED_OUT = 0,		//Item is no longer selling
15
	DELETED = 1,		//Item has been deliberately deleted 
3009 chandransh 16
	PAUSED = 2,			//Item's sale has been paused manually.
123 ashish 17
	ACTIVE = 3,			//Item is available for sale as of now
2984 rajveer 18
	IN_PROCESS = 4,		//Item has been added, but content is not available for the same
19
	CONTENT_COMPLETE = 5,  //The content for this item has been completed. We can start selling the item now.
5217 amit.gupta 20
	PAUSED_BY_RISK = 6,    //Item's sale has been automatically paused since it was marked as risky
21
	COMING_SOON= 7		//Item is now in Coming Soon Page and will move to ACTIVE gradually as it achieves the Start date.
103 ashish 22
}
23
 
5110 mandeep.dh 24
enum ItemType {
25
    SERIALIZED = 1,
26
    NON_SERIALIZED = 2
27
}
28
 
6805 anupam.sin 29
enum PremiumType {
30
    PERCENT = 1,
31
    ABSOLUTE = 2
32
}
33
 
85 ashish 34
struct Item{
35
	1:i64 id,
956 chandransh 36
	2:string productGroup
37
	3:string brand,
38
	4:string modelNumber,
2128 ankur.sing 39
	5:string modelName,
40
	6:string color,
41
	7:i64 category,
42
	8:string comments,
43
	9:i64 catalogItemId,
44
	10:i64 featureId,
45
	11:string featureDescription,
2127 ankur.sing 46
	13:optional double mrp, //maxmimum retail price
4762 phani.kuma 47
	14:optional double sellingPrice, //Selling price
48
	15:optional double weight,
49
	16:i64 addedOn,
50
	17:optional i64 startDate,
51
	18:optional i64 retireDate,
52
	19:status itemStatus,
53
	20:string status_description,
5324 rajveer 54
	21:map<string,string> otherInfo,
4762 phani.kuma 55
	22:string bestDealText,
56
	23:optional double bestDealValue,
57
	24:bool defaultForEntity,
58
	25:i64 updatedOn,
59
	26:optional i64 bestSellingRank,
60
	27:bool risky,
61
	28:optional i32 expectedDelay,
5440 phani.kuma 62
	29:optional bool isWarehousePreferenceSticky,
63
	30:i32 warrantyPeriod,
64
	31:optional i64 preferredVendor,
65
	32:ItemType type,
66
	33:optional i64 comingSoonStartDate,
67
	34:optional i64 expectedArrivalDate,
5460 phani.kuma 68
	35:bool hasItemNo,
6039 amit.gupta 69
	36:bool clearance,
6241 amit.gupta 70
	37:double vatPercentage,
6805 anupam.sin 71
	38:bool showSellingPrice,
6777 vikram.rag 72
	39:string bestDealsDetailsText,
73
	40:string bestDealsDetailsLink,
6805 anupam.sin 74
	41:i64 preferredInsurer
85 ashish 75
}
76
 
6805 anupam.sin 77
struct Insurer{
78
	1:i64 id,
79
	2:string name,
80
	3:string address
81
}
82
 
83
struct ItemInsurerMapping{
84
	1:i64 itemId,
85
	2:i64 insurer,
86
	3:PremiumType premiumType,
87
	4:double premiumValue
88
}
89
 
1967 rajveer 90
struct Category{
91
	1:i64 id,
92
	2:string label,
93
	3:string description,
94
	4:i64 parent_category_id,
95
	/**
96
	* This field should not be used.
97
	*/
98
	5:list<i64> children_category_ids
4762 phani.kuma 99
	6:string display_name
1967 rajveer 100
}
2113 ankur.sing 101
 
2983 chandransh 102
struct ItemShippingInfo{
103
	1:bool isActive,
104
	2:optional bool isRisky,
105
	3:optional i64 quantity
106
}
107
 
3556 rajveer 108
struct Source{
109
	1:i64 id,
110
	2:string name,
111
	3:string identifier
112
}
113
 
114
struct SourceItemPricing{
115
	1:i64 sourceId,
116
	2:i64 itemId,
117
	3:double mrp,
118
	4:double sellingPrice
119
}
120
 
4295 varun.gupt 121
struct ProductNotificationRequest	{
122
	1:Item item,
123
	2:string email,
124
	3:i64 addedOn
125
}
126
 
127
struct ProductNotificationRequestCount	{
128
	1:Item item,
129
	2:i64 count
130
}
131
 
5504 phani.kuma 132
struct VoucherItemMapping{
5512 rajveer 133
	1:i64 voucherType,
5504 phani.kuma 134
	2:i64 itemId,
135
	3:i64 amount
136
}
137
 
5945 mandeep.dh 138
exception CatalogServiceException{
85 ashish 139
	1:i64 id,
140
	2:string message
141
}
142
 
6511 kshitij.so 143
struct EntityTag {
144
    1:i64 entityId,
145
    2:string tag
146
}
147
 
6848 kshitij.so 148
struct Banner {
149
    1:string bannerName,
150
    2:string imageName,
151
    3:string link,
152
    4:i64 priority,
153
    5:bool isActive,
154
    6:bool hasMap
155
}
156
 
157
struct BannerMap {
158
    1:string bannerName,
159
    2:string mapLink,
160
    3:string coordinates
161
}
162
 
5945 mandeep.dh 163
service CatalogService extends GenericService.GenericService{
763 rajveer 164
 
85 ashish 165
/**
166
	Availability and inventory attributes	
167
*/
168
	//all add and update methods - added by Ashish
5945 mandeep.dh 169
	i64 addItem(1:Item item) throws (1:CatalogServiceException cex),
170
	i64 updateItem(1:Item item) throws (1:CatalogServiceException cex),
2983 chandransh 171
 
172
	/**
173
	Checks if the item given to the corresponding itemId is active. If it's active,
174
	whether it's risky and if it's risky, its inventory position.
175
	*/
5945 mandeep.dh 176
	ItemShippingInfo isActive(1:i64 itemId) throws (1:CatalogServiceException isex),
2983 chandransh 177
 
5945 mandeep.dh 178
	string getItemStatusDescription(1:i64 itemId) throws (1:CatalogServiceException isex),
3323 chandransh 179
 
103 ashish 180
	//Item management apis
5945 mandeep.dh 181
	void startItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:CatalogServiceException cex),
182
	void retireItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:CatalogServiceException cex),
183
	void changeItemStatus(1:i64 item_id, 2:i64 timestamp, 3:status newstatus) throws (1:CatalogServiceException cex),
85 ashish 184
	//Other accessor methods - added by Ashish
5945 mandeep.dh 185
	Item getItem(1:i64 item_id) throws (1:CatalogServiceException cex),
186
	list<Item> getItemsByCatalogId(1:i64 catalog_item_id) throws  (1:CatalogServiceException cex),
187
	list<Item> getValidItemsByCatalogId(1:i64 catalog_item_id) throws  (1:CatalogServiceException cex),
188
	list<Item> getAllItems(1:bool isActive) throws (1:CatalogServiceException cex),
189
	list<Item> getAllItemsByStatus(1:status itemStatus) throws (1:CatalogServiceException cex),
190
	bool markItemAsContentComplete(1:i64 entityId, 2:i64 category, 3:string brand, 4:string modelName, 5:string modelNumber) throws (1:CatalogServiceException cex),
646 chandransh 191
 
3355 chandransh 192
	/**
3848 chandransh 193
	Gets at most 'limit' items starting at the given offset. Returns an empty list if there are no more items at the given offset.
194
	*/
5945 mandeep.dh 195
	list<Item> getAllItemsInRange(1:i64 offset, 2:i64 limit) throws (1:CatalogServiceException cex),
3848 chandransh 196
 
197
	/**
198
	Gets at most 'limit' items starting at the given offset in the given status. Returns an empty list if there are no more items at the given offset.
199
	*/
5945 mandeep.dh 200
	list<Item> getAllItemsByStatusInRange(1:status itemStatus, 2:i64 offset, 3:i64 limit) throws (1:CatalogServiceException cex),
3848 chandransh 201
 
202
	/**
203
	Gets a count of all items by status
204
	*/
205
	i32 getItemCountByStatus(1:bool useStatus, 2:status itemStatus),
1157 rajveer 206
 
502 rajveer 207
	// for home page .... best deals, best sellers and latest arrivals
5945 mandeep.dh 208
	list<Item> getBestSellers() throws (1:CatalogServiceException isex),
209
	list<i64> getBestSellersCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:string brand, 4:i64 category) throws (1:CatalogServiceException cex),
210
	i64 getBestSellersCount() throws (1:CatalogServiceException cex),
588 chandransh 211
 
5945 mandeep.dh 212
	list<Item> getBestDeals() throws (1:CatalogServiceException isex),
213
	list<i64> getBestDealsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:string brand, 4:i64 category) throws (1:CatalogServiceException cex),
214
	i64 getBestDealsCount() throws (1:CatalogServiceException cex),
5217 amit.gupta 215
 
5945 mandeep.dh 216
	list<Item> getComingSoon() throws (1:CatalogServiceException isex),
217
	list<i64> getComingSoonCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:string brand, 4:i64 category) throws (1:CatalogServiceException cex),
218
	i64 getComingSoonCount() throws (1:CatalogServiceException cex),
588 chandransh 219
 
2975 chandransh 220
	/**
221
	Returns a list of items sorted in the descending order by start date.
222
	The list is limited to the 'latest_arrivals_count' configuraiton parameter.
223
	*/
5945 mandeep.dh 224
	list<Item> getLatestArrivals() throws (1:CatalogServiceException isex),
2975 chandransh 225
 
226
	/**
227
	Returns the list of catalog ids of latest arrivals in the given categories of the given brand.
228
	To ignore the categories, pass the list as empty. To ignore brand, pass it as null.   
229
	*/
5945 mandeep.dh 230
	list<i64> getLatestArrivalsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:string brand, 4:list<i64> categories) throws (1:CatalogServiceException cex),
2975 chandransh 231
 
232
	/**
233
	Get the total number of latest arrivals we are willing to show.
234
	The count's upper bound is the 'latest_arrivals_count' configuraiton parameter.
235
	*/
5945 mandeep.dh 236
	i64 getLatestArrivalsCount() throws (1:CatalogServiceException cex),
632 rajveer 237
 
1157 rajveer 238
 
239
	i64 generateNewEntityID(),
240
 
241
	/**
1967 rajveer 242
	* All category related functions
243
	*/
244
	bool addCategory(1:Category category),
245
	Category getCategory(1:i64 id),
1990 ankur.sing 246
	list<Category> getAllCategories(),
1967 rajveer 247
 
1990 ankur.sing 248
	/**
4423 phani.kuma 249
	Returns the list of similar items.
250
	*/
251
	list<Item> getAllSimilarItems(1:i64 itemId),
252
 
253
	/**
254
	Adds similar item.
255
	*/
5945 mandeep.dh 256
	Item addSimilarItem(1:i64 itemId, 2:i64 catalogItemId) throws (1:CatalogServiceException cex),
4423 phani.kuma 257
 
258
	/**
6511 kshitij.so 259
	Tag Related
260
	*/
261
 
262
	bool addTag(1:string displayName, 2:i64 itemId),
263
	bool deleteEntityTag(1:string displayName, 2:i64 itemId),
264
	bool deleteTag(1:string displayName),
265
	list<string> getAllTags(),
266
	list<i64> getAllEntitiesByTagName(1:string displayName)
6842 amit.gupta 267
	map<i64, list<string>> getAllEntityTags()
6511 kshitij.so 268
 
6848 kshitij.so 269
	bool addBannerMap(1:string bannerName, 2:string mapLink, 3:string coordinates),
270
	bool deleteBannerMap(1:string bannerName),
271
	list <BannerMap> getBannerMapDetails(1:string bannerName),
6511 kshitij.so 272
	/**
4423 phani.kuma 273
	Delete similar item.
274
	*/
5945 mandeep.dh 275
	bool deleteSimilarItem(1:i64 itemId, 2:i64 catalogItemId) throws (1:CatalogServiceException cex),
4423 phani.kuma 276
 
277
	/**
4725 phani.kuma 278
	Checks if similar item exists (with same Brand, ModelNumber, ModelName, Color)
2113 ankur.sing 279
	If yes, returns the itemId else returns 0
280
	*/
4725 phani.kuma 281
	i64 checkSimilarItem(1:string brand, 2:string modelNumber, 3:string modelName, 4:string color),
2284 ankur.sing 282
 
283
	/**
5945 mandeep.dh 284
	Check wether item is risky and change status if inventory is not available for risky items
2284 ankur.sing 285
	*/
5945 mandeep.dh 286
	void validateRiskyStatus(1:i64 itemId),
2356 ankur.sing 287
 
288
	/**
5945 mandeep.dh 289
    Marks/Unmarks an item as risky. This flag is used for automatic marking of an item as INACTIVE in case of zero inventory.
290
    */
291
    void changeItemRiskyFlag(1:i64 itemId, 2:bool risky),
292
 
293
 
294
	/**
2356 ankur.sing 295
	Returns list of items marked as risky.
296
	*/
297
	list<Item> getItemsByRiskyFlag(),
298
 
299
	/**
4957 phani.kuma 300
	Returns list of items with any status except PHASED_OUT and filtered by category, brand.
2356 ankur.sing 301
	*/
4957 phani.kuma 302
	list<Item> getItemsForMasterSheet(1:string category, 2:string brand),
2807 rajveer 303
 
304
	/**
305
	Returns list of catalog ids of items with same similarity index as of the given itemId 
306
	*/
307
	list<i64> getSimilarItemsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:i64 itemId),
3079 rajveer 308
 
309
	/**
310
	Add user requests for out of stock items. Once user will ask for notify me an entry will 
311
	*/
3086 rajveer 312
	bool addProductNotification(i64 itemId, string email),
3079 rajveer 313
 
3086 rajveer 314
	/**
315
		Send the product notifications to the users for items which has stock.
316
	*/
3348 varun.gupt 317
	bool sendProductNotifications(),
3079 rajveer 318
 
3348 varun.gupt 319
	/**
320
		Returns list of brand names for a given category Id
321
	*/
3556 rajveer 322
	list<string> getAllBrandsByCategory(1:i64 categoryId),
4957 phani.kuma 323
 
324
    /**
325
		Returns list of brand names
326
	*/
327
	list<string> getAllBrands(),
328
 
3556 rajveer 329
	/**
330
	Return list of all sources
331
	*/
332
	list<Source> getAllSources(), 
333
 
334
	/**
335
	Returns the pricing information of an item. If no information is found, exception will be thrown.
336
	*/
5945 mandeep.dh 337
	SourceItemPricing getItemPricingBySource(1:i64 itemId, 2:i64 sourceId) throws (1:CatalogServiceException cex),
3556 rajveer 338
 
339
	/**
340
	Adds prices to be displayed corresponding to the item if user comes from a source.
341
	If item is not found or source is not found, it will throw exception.
342
	*/
5945 mandeep.dh 343
	void addSourceItemPricing(1:SourceItemPricing sourceItemPricing) throws (1:CatalogServiceException cex),
3556 rajveer 344
 
345
	/**
346
	Returns the list of source pricing information of an item.
347
	Raises an exception if item not found corresponding to itemId
348
	*/
5945 mandeep.dh 349
	list<SourceItemPricing> getAllSourcePricing(1:i64 itemId) throws (1:CatalogServiceException cex),
3556 rajveer 350
 
351
	/**
352
	Get the item for a given itemId and sourceId. MRP and sellingPrice will be updated for source if we have different prices for source.
353
	*/
5945 mandeep.dh 354
	Item getItemForSource(1:i64 item_id, 2:optional i64  sourceId) throws (1:CatalogServiceException cex),
3872 chandransh 355
 
356
	/**
357
	Searches items matching the the given terms in the catalog and returns results within the specified range.
358
	*/
359
	list<Item> searchItemsInRange(1:list<string> searchTerms, 2:i64 offset, 3:i64 limit),
360
 
361
	/**
362
	Gets the count of search results for the given search terms so that the user can go through all the pages.
363
	*/
4024 chandransh 364
	i32 getSearchResultCount(1:list<string> searchTerms),
365
 
366
	/**
4295 varun.gupt 367
	Returns a list of product notifications added after a supplied datetime
368
	*/
369
	list<ProductNotificationRequest> getProductNotifications(1:i64 startDateTime),
370
 
371
	/**
372
	Returns a list of count of requests for product notification against each item
373
	*/
374
	list<ProductNotificationRequestCount> getProductNotificationRequestCount(1:i64 startDateTime)
4370 anupam.sin 375
 
376
	/**
4649 phani.kuma 377
	This method adds a log to authorize table with Item Id, username who authorized the change, reason.
378
	*/
5945 mandeep.dh 379
	bool addAuthorizationLog(1:i64 itemId, 2:string username, 3:string reason) throws (1:CatalogServiceException cex),
5336 rajveer 380
 
5945 mandeep.dh 381
    list<i64> getClearanceSaleCatalogIds() throws (1:CatalogServiceException cex),
5504 phani.kuma 382
 
5945 mandeep.dh 383
	bool addupdateVoucherForItem(1:i64 catalog_item_id, 2:i64 voucherType, 3:i64 voucherAmount) throws (1:CatalogServiceException cex),
5504 phani.kuma 384
 
5945 mandeep.dh 385
	bool deleteVoucherForItem(1:i64 catalog_item_id, 2:i64 voucherType) throws (1:CatalogServiceException cex),
5504 phani.kuma 386
 
5512 rajveer 387
	i64 getVoucherAmount(1:i64 itemId, 2:i64 voucherType),
5504 phani.kuma 388
 
389
	list<VoucherItemMapping> getAllItemVouchers(1:i64 itemId),
5586 phani.kuma 390
 
6039 amit.gupta 391
	bool isValidCatalogItemId(1:i64 catalog_item_id),
392
 
393
	double getVatPercentageForItem(1:i64 itemId, 2:double price),
6531 vikram.rag 394
 
395
	double getVatAmountForItem(1:i64 itemId, 2:double price),
396
 
6821 amar.kumar 397
	list<Item> getAllIgnoredInventoryUpdateItemsList(1:i32 offset,2:i32 limit),
398
 
399
	list<Item> getAllAliveItems();	
6805 anupam.sin 400
 
401
	/**
402
	This method returns the insurance amount needed to insure the given item for a given quantity.
403
	*/
404
	i64 getInsuranceAmount(1:i64 itemId, 2:i64 insurerId, 3:i64 quantity),
405
 
406
	Insurer getInsurer(1:i64 insurerId)
6838 vikram.rag 407
 
408
	list<Insurer> getAllInsurers()
5110 mandeep.dh 409
}