Subversion Repositories SmartDukaan

Rev

Rev 7291 | Rev 7308 | 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,
7256 rajveer 69
	36:bool activeOnStore,
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,
7291 vikram.rag 74
	41:i64 preferredInsurer,
75
	42:string asin,
76
	43:i64 defaultInventory,
77
	44:i64 holdInventory
85 ashish 78
}
79
 
6805 anupam.sin 80
struct Insurer{
81
	1:i64 id,
82
	2:string name,
6903 anupam.sin 83
	3:string address,
84
	4:i64 declaredAmount,
85
	5:i64 creditedAmount
6805 anupam.sin 86
}
87
 
88
struct ItemInsurerMapping{
89
	1:i64 itemId,
90
	2:i64 insurer,
91
	3:PremiumType premiumType,
92
	4:double premiumValue
93
}
94
 
1967 rajveer 95
struct Category{
96
	1:i64 id,
97
	2:string label,
98
	3:string description,
99
	4:i64 parent_category_id,
100
	/**
101
	* This field should not be used.
102
	*/
103
	5:list<i64> children_category_ids
4762 phani.kuma 104
	6:string display_name
1967 rajveer 105
}
2113 ankur.sing 106
 
2983 chandransh 107
struct ItemShippingInfo{
108
	1:bool isActive,
109
	2:optional bool isRisky,
110
	3:optional i64 quantity
111
}
112
 
3556 rajveer 113
struct Source{
114
	1:i64 id,
115
	2:string name,
116
	3:string identifier
117
}
118
 
119
struct SourceItemPricing{
120
	1:i64 sourceId,
121
	2:i64 itemId,
122
	3:double mrp,
123
	4:double sellingPrice
124
}
125
 
4295 varun.gupt 126
struct ProductNotificationRequest	{
127
	1:Item item,
128
	2:string email,
129
	3:i64 addedOn
130
}
131
 
132
struct ProductNotificationRequestCount	{
133
	1:Item item,
134
	2:i64 count
135
}
136
 
5504 phani.kuma 137
struct VoucherItemMapping{
5512 rajveer 138
	1:i64 voucherType,
5504 phani.kuma 139
	2:i64 itemId,
140
	3:i64 amount
141
}
142
 
5945 mandeep.dh 143
exception CatalogServiceException{
85 ashish 144
	1:i64 id,
145
	2:string message
146
}
147
 
6511 kshitij.so 148
struct EntityTag {
149
    1:i64 entityId,
150
    2:string tag
151
}
152
 
6848 kshitij.so 153
struct Banner {
154
    1:string bannerName,
155
    2:string imageName,
156
    3:string link,
157
    4:i64 priority,
158
    5:bool isActive,
159
    6:bool hasMap
160
}
161
 
162
struct BannerMap {
163
    1:string bannerName,
164
    2:string mapLink,
165
    3:string coordinates
166
}
167
 
7190 amar.kumar 168
struct FreebieItem {
169
	1:i64 itemId,
170
	2:i64 freebieItemId
171
}
172
 
7272 amit.gupta 173
struct BrandInfo {
174
	1:string name,
175
	2:string serviceCenterLocatorUrl
176
}
177
 
7256 rajveer 178
struct StorePricing {
179
    1:i64 itemId,
180
	2:double recommendedPrice,
181
	3:double minPrice,
182
	4:double maxPrice,
183
	5:double minAdvancePrice
184
}
185
 
7281 kshitij.so 186
struct Amazonlisted{
187
	1:i64 itemid,
188
    2:string asin,
189
    3:string name,
190
    4:string brand,
191
    5:string model,
192
    6:string manufacturer_name,
193
    7:string part_number,
194
    8:string ean,
195
    9:string upc 
196
    10:double fbaPrice,
197
    11:double sellingPrice,
198
    12:bool isFba,
199
    13:bool isNonFba,
200
    14:bool isInventoryOverride,
201
    15:string color,
202
    16:string category
203
    }
204
 
5945 mandeep.dh 205
service CatalogService extends GenericService.GenericService{
763 rajveer 206
 
85 ashish 207
/**
208
	Availability and inventory attributes	
209
*/
210
	//all add and update methods - added by Ashish
5945 mandeep.dh 211
	i64 addItem(1:Item item) throws (1:CatalogServiceException cex),
212
	i64 updateItem(1:Item item) throws (1:CatalogServiceException cex),
2983 chandransh 213
 
214
	/**
215
	Checks if the item given to the corresponding itemId is active. If it's active,
216
	whether it's risky and if it's risky, its inventory position.
217
	*/
5945 mandeep.dh 218
	ItemShippingInfo isActive(1:i64 itemId) throws (1:CatalogServiceException isex),
2983 chandransh 219
 
5945 mandeep.dh 220
	string getItemStatusDescription(1:i64 itemId) throws (1:CatalogServiceException isex),
3323 chandransh 221
 
103 ashish 222
	//Item management apis
5945 mandeep.dh 223
	void startItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:CatalogServiceException cex),
224
	void retireItemOn(1:i64 item_id, 2:i64 timestamp) throws (1:CatalogServiceException cex),
225
	void changeItemStatus(1:i64 item_id, 2:i64 timestamp, 3:status newstatus) throws (1:CatalogServiceException cex),
85 ashish 226
	//Other accessor methods - added by Ashish
5945 mandeep.dh 227
	Item getItem(1:i64 item_id) throws (1:CatalogServiceException cex),
228
	list<Item> getItemsByCatalogId(1:i64 catalog_item_id) throws  (1:CatalogServiceException cex),
229
	list<Item> getValidItemsByCatalogId(1:i64 catalog_item_id) throws  (1:CatalogServiceException cex),
230
	list<Item> getAllItems(1:bool isActive) throws (1:CatalogServiceException cex),
231
	list<Item> getAllItemsByStatus(1:status itemStatus) throws (1:CatalogServiceException cex),
232
	bool markItemAsContentComplete(1:i64 entityId, 2:i64 category, 3:string brand, 4:string modelName, 5:string modelNumber) throws (1:CatalogServiceException cex),
646 chandransh 233
 
3355 chandransh 234
	/**
3848 chandransh 235
	Gets at most 'limit' items starting at the given offset. Returns an empty list if there are no more items at the given offset.
236
	*/
5945 mandeep.dh 237
	list<Item> getAllItemsInRange(1:i64 offset, 2:i64 limit) throws (1:CatalogServiceException cex),
3848 chandransh 238
 
239
	/**
240
	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.
241
	*/
5945 mandeep.dh 242
	list<Item> getAllItemsByStatusInRange(1:status itemStatus, 2:i64 offset, 3:i64 limit) throws (1:CatalogServiceException cex),
3848 chandransh 243
 
244
	/**
245
	Gets a count of all items by status
246
	*/
247
	i32 getItemCountByStatus(1:bool useStatus, 2:status itemStatus),
1157 rajveer 248
 
502 rajveer 249
	// for home page .... best deals, best sellers and latest arrivals
5945 mandeep.dh 250
	list<Item> getBestSellers() throws (1:CatalogServiceException isex),
251
	list<i64> getBestSellersCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:string brand, 4:i64 category) throws (1:CatalogServiceException cex),
252
	i64 getBestSellersCount() throws (1:CatalogServiceException cex),
588 chandransh 253
 
5945 mandeep.dh 254
	list<Item> getBestDeals() throws (1:CatalogServiceException isex),
255
	list<i64> getBestDealsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:string brand, 4:i64 category) throws (1:CatalogServiceException cex),
256
	i64 getBestDealsCount() throws (1:CatalogServiceException cex),
5217 amit.gupta 257
 
5945 mandeep.dh 258
	list<Item> getComingSoon() throws (1:CatalogServiceException isex),
259
	list<i64> getComingSoonCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:string brand, 4:i64 category) throws (1:CatalogServiceException cex),
260
	i64 getComingSoonCount() throws (1:CatalogServiceException cex),
588 chandransh 261
 
2975 chandransh 262
	/**
263
	Returns a list of items sorted in the descending order by start date.
264
	The list is limited to the 'latest_arrivals_count' configuraiton parameter.
265
	*/
5945 mandeep.dh 266
	list<Item> getLatestArrivals() throws (1:CatalogServiceException isex),
2975 chandransh 267
 
268
	/**
269
	Returns the list of catalog ids of latest arrivals in the given categories of the given brand.
270
	To ignore the categories, pass the list as empty. To ignore brand, pass it as null.   
271
	*/
5945 mandeep.dh 272
	list<i64> getLatestArrivalsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:string brand, 4:list<i64> categories) throws (1:CatalogServiceException cex),
2975 chandransh 273
 
274
	/**
275
	Get the total number of latest arrivals we are willing to show.
276
	The count's upper bound is the 'latest_arrivals_count' configuraiton parameter.
277
	*/
5945 mandeep.dh 278
	i64 getLatestArrivalsCount() throws (1:CatalogServiceException cex),
632 rajveer 279
 
1157 rajveer 280
 
281
	i64 generateNewEntityID(),
282
 
283
	/**
1967 rajveer 284
	* All category related functions
285
	*/
286
	bool addCategory(1:Category category),
287
	Category getCategory(1:i64 id),
1990 ankur.sing 288
	list<Category> getAllCategories(),
1967 rajveer 289
 
1990 ankur.sing 290
	/**
4423 phani.kuma 291
	Returns the list of similar items.
292
	*/
293
	list<Item> getAllSimilarItems(1:i64 itemId),
294
 
295
	/**
296
	Adds similar item.
297
	*/
5945 mandeep.dh 298
	Item addSimilarItem(1:i64 itemId, 2:i64 catalogItemId) throws (1:CatalogServiceException cex),
4423 phani.kuma 299
 
300
	/**
6511 kshitij.so 301
	Tag Related
302
	*/
303
 
304
	bool addTag(1:string displayName, 2:i64 itemId),
305
	bool deleteEntityTag(1:string displayName, 2:i64 itemId),
306
	bool deleteTag(1:string displayName),
307
	list<string> getAllTags(),
308
	list<i64> getAllEntitiesByTagName(1:string displayName)
6842 amit.gupta 309
	map<i64, list<string>> getAllEntityTags()
6511 kshitij.so 310
 
6850 kshitij.so 311
	bool addBanner(1:string bannerName 2:string imageName, 3:string link, 4:i64 priority, 5:bool isActive , 6:bool hasMap),
312
	list <string> getAllBanners(),
313
	bool deleteBanner(1:string bannerName),
314
	Banner getBannerDetails(1:string bannerName),
315
	list <Banner> getActiveBanners(),
6848 kshitij.so 316
	bool addBannerMap(1:string bannerName, 2:string mapLink, 3:string coordinates),
317
	bool deleteBannerMap(1:string bannerName),
318
	list <BannerMap> getBannerMapDetails(1:string bannerName),
6511 kshitij.so 319
	/**
4423 phani.kuma 320
	Delete similar item.
321
	*/
5945 mandeep.dh 322
	bool deleteSimilarItem(1:i64 itemId, 2:i64 catalogItemId) throws (1:CatalogServiceException cex),
4423 phani.kuma 323
 
324
	/**
4725 phani.kuma 325
	Checks if similar item exists (with same Brand, ModelNumber, ModelName, Color)
2113 ankur.sing 326
	If yes, returns the itemId else returns 0
327
	*/
4725 phani.kuma 328
	i64 checkSimilarItem(1:string brand, 2:string modelNumber, 3:string modelName, 4:string color),
2284 ankur.sing 329
 
330
	/**
5945 mandeep.dh 331
	Check wether item is risky and change status if inventory is not available for risky items
2284 ankur.sing 332
	*/
5945 mandeep.dh 333
	void validateRiskyStatus(1:i64 itemId),
2356 ankur.sing 334
 
335
	/**
5945 mandeep.dh 336
    Marks/Unmarks an item as risky. This flag is used for automatic marking of an item as INACTIVE in case of zero inventory.
337
    */
338
    void changeItemRiskyFlag(1:i64 itemId, 2:bool risky),
339
 
340
 
341
	/**
2356 ankur.sing 342
	Returns list of items marked as risky.
343
	*/
344
	list<Item> getItemsByRiskyFlag(),
345
 
346
	/**
4957 phani.kuma 347
	Returns list of items with any status except PHASED_OUT and filtered by category, brand.
2356 ankur.sing 348
	*/
4957 phani.kuma 349
	list<Item> getItemsForMasterSheet(1:string category, 2:string brand),
2807 rajveer 350
 
351
	/**
352
	Returns list of catalog ids of items with same similarity index as of the given itemId 
353
	*/
354
	list<i64> getSimilarItemsCatalogIds(1:i64 beginIndex, 2:i64 totalItems, 3:i64 itemId),
3079 rajveer 355
 
356
	/**
357
	Add user requests for out of stock items. Once user will ask for notify me an entry will 
358
	*/
3086 rajveer 359
	bool addProductNotification(i64 itemId, string email),
3079 rajveer 360
 
3086 rajveer 361
	/**
362
		Send the product notifications to the users for items which has stock.
363
	*/
3348 varun.gupt 364
	bool sendProductNotifications(),
3079 rajveer 365
 
3348 varun.gupt 366
	/**
367
		Returns list of brand names for a given category Id
368
	*/
3556 rajveer 369
	list<string> getAllBrandsByCategory(1:i64 categoryId),
4957 phani.kuma 370
 
371
    /**
372
		Returns list of brand names
373
	*/
374
	list<string> getAllBrands(),
375
 
3556 rajveer 376
	/**
377
	Return list of all sources
378
	*/
379
	list<Source> getAllSources(), 
380
 
381
	/**
382
	Returns the pricing information of an item. If no information is found, exception will be thrown.
383
	*/
5945 mandeep.dh 384
	SourceItemPricing getItemPricingBySource(1:i64 itemId, 2:i64 sourceId) throws (1:CatalogServiceException cex),
3556 rajveer 385
 
386
	/**
387
	Adds prices to be displayed corresponding to the item if user comes from a source.
388
	If item is not found or source is not found, it will throw exception.
389
	*/
5945 mandeep.dh 390
	void addSourceItemPricing(1:SourceItemPricing sourceItemPricing) throws (1:CatalogServiceException cex),
3556 rajveer 391
 
392
	/**
393
	Returns the list of source pricing information of an item.
394
	Raises an exception if item not found corresponding to itemId
395
	*/
5945 mandeep.dh 396
	list<SourceItemPricing> getAllSourcePricing(1:i64 itemId) throws (1:CatalogServiceException cex),
3556 rajveer 397
 
398
	/**
399
	Get the item for a given itemId and sourceId. MRP and sellingPrice will be updated for source if we have different prices for source.
400
	*/
5945 mandeep.dh 401
	Item getItemForSource(1:i64 item_id, 2:optional i64  sourceId) throws (1:CatalogServiceException cex),
3872 chandransh 402
 
403
	/**
404
	Searches items matching the the given terms in the catalog and returns results within the specified range.
405
	*/
406
	list<Item> searchItemsInRange(1:list<string> searchTerms, 2:i64 offset, 3:i64 limit),
407
 
408
	/**
409
	Gets the count of search results for the given search terms so that the user can go through all the pages.
410
	*/
4024 chandransh 411
	i32 getSearchResultCount(1:list<string> searchTerms),
412
 
413
	/**
4295 varun.gupt 414
	Returns a list of product notifications added after a supplied datetime
415
	*/
416
	list<ProductNotificationRequest> getProductNotifications(1:i64 startDateTime),
417
 
418
	/**
419
	Returns a list of count of requests for product notification against each item
420
	*/
421
	list<ProductNotificationRequestCount> getProductNotificationRequestCount(1:i64 startDateTime)
4370 anupam.sin 422
 
423
	/**
4649 phani.kuma 424
	This method adds a log to authorize table with Item Id, username who authorized the change, reason.
425
	*/
5945 mandeep.dh 426
	bool addAuthorizationLog(1:i64 itemId, 2:string username, 3:string reason) throws (1:CatalogServiceException cex),
5504 phani.kuma 427
 
5945 mandeep.dh 428
	bool addupdateVoucherForItem(1:i64 catalog_item_id, 2:i64 voucherType, 3:i64 voucherAmount) throws (1:CatalogServiceException cex),
5504 phani.kuma 429
 
5945 mandeep.dh 430
	bool deleteVoucherForItem(1:i64 catalog_item_id, 2:i64 voucherType) throws (1:CatalogServiceException cex),
5504 phani.kuma 431
 
5512 rajveer 432
	i64 getVoucherAmount(1:i64 itemId, 2:i64 voucherType),
5504 phani.kuma 433
 
434
	list<VoucherItemMapping> getAllItemVouchers(1:i64 itemId),
5586 phani.kuma 435
 
6039 amit.gupta 436
	bool isValidCatalogItemId(1:i64 catalog_item_id),
437
 
438
	double getVatPercentageForItem(1:i64 itemId, 2:double price),
6531 vikram.rag 439
 
440
	double getVatAmountForItem(1:i64 itemId, 2:double price),
441
 
6821 amar.kumar 442
	list<Item> getAllIgnoredInventoryUpdateItemsList(1:i32 offset,2:i32 limit),
443
 
444
	list<Item> getAllAliveItems();	
6805 anupam.sin 445
 
446
	/**
447
	This method returns the insurance amount needed to insure the given item for a given quantity.
448
	*/
6921 anupam.sin 449
	i64 getInsuranceAmount(1:i64 itemId, 2:double price, 3:i64 insurerId, 4:i64 quantity),
6805 anupam.sin 450
 
6921 anupam.sin 451
	Insurer getInsurer(1:i64 insurerId),
6838 vikram.rag 452
 
6962 rajveer 453
	list<Insurer> getAllInsurers(),
454
 
7190 amar.kumar 455
	void updateInsuranceDeclaredAmount(1:i64 insurerId, 2:double amount),
456
 
457
	i64 getFreebieForItem(1:i64 itemId),
458
 
7256 rajveer 459
	void addOrUpdateFreebieForItem(1:FreebieItem freebieItem),
460
 
7272 amit.gupta 461
	void addOrUpdateBrandInfo(1:BrandInfo brandInfo),
462
 
7291 vikram.rag 463
	map<string, BrandInfo> getBrandInfo(),
7272 amit.gupta 464
 
7265 rajveer 465
	StorePricing getStorePricing(1:i64 itemId),
466
 
7306 rajveer 467
	list<StorePricing> getStorePricings(1:list<i64> itemIds),
468
 
7291 vikram.rag 469
	void updateStorePricing(1:StorePricing sp),
7281 kshitij.so 470
 
471
	list<Amazonlisted> getAllAmazonListedItems(),
472
 
473
	Amazonlisted getAmazonItemDetails(1:i64 itemId),
474
 
475
	void updateAmazonItemDetails(1:i64 itemId, 2:double fbaPrice, 3:double sellingPrice, 4:bool isFba, 5:bool isNonFba, 6:bool isInventoryOverride),
476
 
7291 vikram.rag 477
	void addAmazonItem(1:Amazonlisted amazonlisted),
7281 kshitij.so 478
 
7291 vikram.rag 479
	list<Item> getAsinItems(),
7281 kshitij.so 480
 
7291 vikram.rag 481
	list<Amazonlisted> getAllFbaListedItems(),
482
 
483
	list<Amazonlisted> getAllNonFbaListedItems()	
484
 
5110 mandeep.dh 485
}