Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
94 ashish 1
'''
2
Created on 23-Mar-2010
3
 
4
@author: ashish
5
'''
8754 vikram.rag 6
from shop2020.model.v1.catalog.impl.DataService import Insurer, SnapdealItem, Item
6511 kshitij.so 7
from shop2020.thriftpy.model.v1.catalog.ttypes import Item, Category, \
8
    SourceItemPricing, Source, ItemType, \
5110 mandeep.dh 9
    ProductNotificationRequest as TProductNotificationRequest, \
10
    ProductNotificationRequestCount as TProductNotificationRequestCount, \
7281 kshitij.so 11
    VoucherItemMapping, EntityTag as TEntityTag, Banner as TBanner, BannerMap as TBannerMap, \
8182 amar.kumar 12
    Insurer as TInsurer, BrandInfo as TBrandInfo, Amazonlisted as TAmazonlisted, \
8739 vikram.rag 13
    EbayItem as TEbayItem, BannerUriMapping as TBannerUriMapping, Campaign as TCampaign, \
9724 kshitij.so 14
    SnapdealItem as TSnapdealItem, SnapdealItemDetails as TSnapdealItemDetails,ProductFeedSubmit as TProductFeedSubmit, \
9779 kshitij.so 15
    MarketplaceItems as TMarketplaceItems, MarketplacePercentage as TMarketplacePercentage, \
10097 kshitij.so 16
    MarketPlaceItemPrice as TMarketPlaceItemPrice, FlipkartItem as TFlipkartItem,\
10909 vikram.rag 17
    FlipkartItemDetails as TFlipkartItemDetails
5110 mandeep.dh 18
from shop2020.utils.Utils import to_java_date
94 ashish 19
 
20
def to_t_item(item):
21
    t_item = Item()
576 chandransh 22
    if item is None:
23
        return t_item
94 ashish 24
    t_item.id = item.id
963 chandransh 25
    t_item.productGroup = item.product_group
26
    t_item.brand = item.brand
591 chandransh 27
    t_item.modelNumber = item.model_number
28
    t_item.modelName = item.model_name
609 chandransh 29
    t_item.color = item.color
591 chandransh 30
    t_item.category = item.category
122 ashish 31
    t_item.catalogItemId = item.catalog_item_id
32
    t_item.weight = item.weight
33
    t_item.featureId = item.feature_id
34
    t_item.featureDescription = item.feature_description
35
    if item.startDate:
36
        t_item.startDate = to_java_date(item.startDate)
5217 amit.gupta 37
    if item.comingSoonStartDate:
38
        t_item.comingSoonStartDate = to_java_date(item.comingSoonStartDate)
39
    if item.expectedArrivalDate:
40
        t_item.expectedArrivalDate = to_java_date(item.expectedArrivalDate)
122 ashish 41
    if item.addedOn:
42
        t_item.addedOn = to_java_date(item.addedOn)
609 chandransh 43
    if item.updatedOn:
44
        t_item.updatedOn = to_java_date(item.updatedOn)
122 ashish 45
    t_item.itemStatus = item.status
2035 rajveer 46
    t_item.status_description = item.status_description
501 rajveer 47
    if item.sellingPrice:
609 chandransh 48
        t_item.sellingPrice = item.sellingPrice
630 chandransh 49
    if item.mrp:
501 rajveer 50
        t_item.mrp = item.mrp    
122 ashish 51
 
2028 ankur.sing 52
    if item.comments:
53
        t_item.comments = item.comments
609 chandransh 54
    if item.bestDealText:
55
        t_item.bestDealText = item.bestDealText
6777 vikram.rag 56
    if item.bestDealsDetailsText:
57
        t_item.bestDealsDetailsText = item.bestDealsDetailsText
58
    if item.bestDealsDetailsLink:
59
        t_item.bestDealsDetailsLink = item.bestDealsDetailsLink 
609 chandransh 60
    if item.bestDealValue:
61
        t_item.bestDealValue = item.bestDealValue
7291 vikram.rag 62
    if item.asin:
63
        t_item.asin = item.asin    
1910 varun.gupt 64
    t_item.defaultForEntity = item.defaultForEntity
2065 ankur.sing 65
    t_item.bestSellingRank = item.bestSellingRank
2251 ankur.sing 66
    t_item.risky = item.risky
3355 chandransh 67
    t_item.expectedDelay = item.expectedDelay
4406 anupam.sin 68
    t_item.isWarehousePreferenceSticky = item.isWarehousePreferenceSticky
4295 varun.gupt 69
    t_item.warrantyPeriod = item.warranty_period
4506 phani.kuma 70
    t_item.preferredVendor = item.preferredVendor
5110 mandeep.dh 71
    t_item.type = ItemType._NAMES_TO_VALUES[item.type]
5385 phani.kuma 72
    t_item.hasItemNo = item.hasItemNo
7256 rajveer 73
    t_item.activeOnStore = item.activeOnStore
6241 amit.gupta 74
    t_item.showSellingPrice = item.showSellingPrice
6805 anupam.sin 75
    t_item.preferredInsurer = item.preferredInsurer
7291 vikram.rag 76
    t_item.holdInventory = item.holdInventory
77
    t_item.defaultInventory = item.defaultInventory
9841 rajveer 78
    t_item.holdOverride = item.holdOverride
94 ashish 79
    return t_item
122 ashish 80
 
6805 anupam.sin 81
def to_t_insurer(insurer):
82
    t_insurer = TInsurer()
83
    t_insurer.id = insurer.id
84
    t_insurer.name = insurer.name 
85
    t_insurer.address = insurer.address
6903 anupam.sin 86
    t_insurer.declaredAmount = insurer.declaredAmount
87
    t_insurer.creditedAmount = insurer.creditedAmount
6805 anupam.sin 88
    return t_insurer
89
 
5504 phani.kuma 90
def to_t_voucher_item_mapping(voucher):
91
    t_voucher = VoucherItemMapping()
92
    t_voucher.voucherType = voucher.voucherType
93
    t_voucher.itemId = voucher.item.id
94
    t_voucher.amount = voucher.amount
95
    return t_voucher
96
 
1970 rajveer 97
def to_t_category(category):
98
    t_category = Category()
99
    t_category.id = category.id
100
    t_category.label = category.label
101
    t_category.description = category.description
102
    t_category.parent_category_id = category.parent_category_id
4762 phani.kuma 103
    t_category.display_name = category.display_name
3557 rajveer 104
    return t_category
105
 
106
def to_t_source_item_pricing(source_item_pricing):
107
    t_source_item_pricing = SourceItemPricing()
108
    t_source_item_pricing.sourceId = source_item_pricing.source.id
109
    t_source_item_pricing.itemId = source_item_pricing.item.id
110
    t_source_item_pricing.mrp = source_item_pricing.mrp
111
    t_source_item_pricing.sellingPrice = source_item_pricing.sellingPrice
112
    return t_source_item_pricing
113
 
114
def to_t_source(source):
115
    t_source = Source()
116
    t_source.id = source.id
117
    t_source.name = source.name
118
    t_source.identifier = source.identifier
119
    return t_source
4295 varun.gupt 120
 
121
def to_t_product_notification_request(product_notification_request):
122
    t_product_notification_request = TProductNotificationRequest()
123
 
124
    if product_notification_request:
125
        t_product_notification_request.item = to_t_item(product_notification_request.item)
126
        t_product_notification_request.email = product_notification_request.email
127
        t_product_notification_request.addedOn = to_java_date(product_notification_request.addedOn)
128
 
129
    return t_product_notification_request
130
 
131
def to_t_product_notification_request_count(product_notification_request_count):
132
 
133
    t_product_notification_request_count = TProductNotificationRequestCount()
134
 
135
    if product_notification_request_count:
136
        item, count = product_notification_request_count
137
        t_product_notification_request_count.item = to_t_item(item)
138
        t_product_notification_request_count.count = count
139
 
6511 kshitij.so 140
    return t_product_notification_request_count
141
 
142
def to_t_entity_tag(entity_tag):
143
    t_entity_tag = TEntityTag()
144
    t_entity_tag.entityId = entity_tag.entityId
6848 kshitij.so 145
    t_entity_tag.tag = entity_tag.tag
146
 
147
def to_t_banner(banner):
148
    t_banner = TBanner()
149
    t_banner.bannerName = banner.bannerName
150
    t_banner.imageName = banner.imageName
151
    t_banner.link = banner.link
152
    t_banner.priority = banner.priority
153
    t_banner.hasMap = banner.hasMap
9155 kshitij.so 154
    t_banner.bannerType = banner.bannerType
6848 kshitij.so 155
    return t_banner
156
 
8579 kshitij.so 157
def to_t_banner_list(bannerList):
158
    t_banner_list = []
159
    for banner in bannerList:
160
        t_banner = TBanner()
161
        t_banner.bannerName = banner.bannerName
162
        t_banner.imageName = banner.imageName
163
        t_banner.link = banner.link
164
        t_banner.priority = banner.priority
165
        t_banner.hasMap = banner.hasMap
9155 kshitij.so 166
        t_banner.bannerType = banner.bannerType
8579 kshitij.so 167
        t_banner_list.append(t_banner)
168
    return t_banner_list
169
 
170
 
6848 kshitij.so 171
def to_t_banner_map(banner_map):
172
    t_banner_map = TBannerMap()
173
    t_banner_map.bannerName = banner_map.bannerName
174
    t_banner_map.mapLink = banner_map.mapLink
175
    t_banner_map.coordinates = banner_map.coordinates
176
    return t_banner_map
7272 amit.gupta 177
 
8579 kshitij.so 178
def to_t_uri_mapping(uriMapping):
179
    t_uri_mapping =TBannerUriMapping()
180
    t_uri_mapping.bannerName = uriMapping.bannerName
181
    t_uri_mapping.uri = uriMapping.uri
182
    t_uri_mapping.isActive = uriMapping.isActive
10097 kshitij.so 183
    t_uri_mapping.target = uriMapping.target
8579 kshitij.so 184
    return t_uri_mapping
185
 
186
def to_t_campaign(campaign):
187
    t_campaign = TCampaign()
188
    t_campaign.id = campaign.id
189
    t_campaign.campaignName = campaign.campaignName
190
    t_campaign.imageName = campaign.imageName
191
    return t_campaign
192
 
7281 kshitij.so 193
def to_t_Amazonlisted(Amazonlisted):
194
    t_amazonlisted = TAmazonlisted()
8362 kshitij.so 195
    if Amazonlisted is None:
196
        return t_amazonlisted
7281 kshitij.so 197
    t_amazonlisted.asin = Amazonlisted.asin
198
    t_amazonlisted.brand = Amazonlisted.brand 
199
    t_amazonlisted.itemid = Amazonlisted.itemId
200
    t_amazonlisted.model = Amazonlisted.model
201
    t_amazonlisted.manufacturer_name = Amazonlisted.manufacturer_name
202
    t_amazonlisted.upc = Amazonlisted.upc
203
    t_amazonlisted.part_number = Amazonlisted.part_number
204
    t_amazonlisted.name = Amazonlisted.name
205
    t_amazonlisted.ean = Amazonlisted.ean
206
    t_amazonlisted.fbaPrice = Amazonlisted.fbaPrice
10909 vikram.rag 207
    t_amazonlisted.fbbPrice = Amazonlisted.fbbPrice
7281 kshitij.so 208
    t_amazonlisted.sellingPrice = Amazonlisted.sellingPrice
209
    t_amazonlisted.isFba = Amazonlisted.isFba
10909 vikram.rag 210
    t_amazonlisted.isFbb = Amazonlisted.isFbb
7281 kshitij.so 211
    t_amazonlisted.isNonFba = Amazonlisted.isNonFba
212
    t_amazonlisted.isInventoryOverride = Amazonlisted.isInventoryOverride
213
    t_amazonlisted.color = Amazonlisted.color
214
    t_amazonlisted.category = Amazonlisted.category
7367 kshitij.so 215
    t_amazonlisted.handlingTime = Amazonlisted.handlingTime
216
    t_amazonlisted.isCustomTime = Amazonlisted.isCustomTime
7516 vikram.rag 217
    t_amazonlisted.category_code = Amazonlisted.category_code
7770 kshitij.so 218
    t_amazonlisted.mfnPriceLastUpdatedOn = to_java_date(Amazonlisted.mfnPriceLastUpdatedOn)
219
    t_amazonlisted.fbaPriceLastUpdatedOn = to_java_date(Amazonlisted.fbaPriceLastUpdatedOn)
10909 vikram.rag 220
    t_amazonlisted.fbbPriceLastUpdatedOn = to_java_date(Amazonlisted.fbbPriceLastUpdatedOn)
7770 kshitij.so 221
    t_amazonlisted.mfnPriceLastUpdatedOnSc = to_java_date(Amazonlisted.mfnPriceLastUpdatedOnSc)
10909 vikram.rag 222
    t_amazonlisted.fbbPriceLastUpdatedOnSc = to_java_date(Amazonlisted.fbbPriceLastUpdatedOnSc)
7770 kshitij.so 223
    t_amazonlisted.fbaPriceLastUpdatedOnSc = to_java_date(Amazonlisted.fbaPriceLastUpdatedOnSc)
8139 kshitij.so 224
    t_amazonlisted.suppressMfnPriceUpdate = Amazonlisted.suppressMfnPriceUpdate
8140 kshitij.so 225
    t_amazonlisted.suppressFbaPriceUpdate = Amazonlisted.suppressFbaPriceUpdate
10909 vikram.rag 226
    t_amazonlisted.suppressFbbPriceUpdate = Amazonlisted.suppressFbbPriceUpdate
8619 kshitij.so 227
    t_amazonlisted.taxCode = Amazonlisted.taxCode
10909 vikram.rag 228
    t_amazonlisted.fbbTaxCode = Amazonlisted.fbbTaxCode
7291 vikram.rag 229
    return t_amazonlisted
230
 
8182 amar.kumar 231
def to_t_ebay_item(ebay_item):
232
    t_ebay_item = TEbayItem()
233
    t_ebay_item.ebayListingId = ebay_item.ebayListingId
234
    t_ebay_item.itemId = ebay_item.itemId
235
    t_ebay_item.listingName = ebay_item.listingName
236
    t_ebay_item.listingPrice = ebay_item.listingPrice
237
    t_ebay_item.listingExpiryDate = to_java_date(ebay_item.listingExpiryDate)
238
    t_ebay_item.subsidy = ebay_item.subsidy
8274 amit.gupta 239
    return t_ebay_item
240
 
241
def to_t_brand_info(brand_info):
242
    t_brand_info = TBrandInfo()
243
    t_brand_info.name = brand_info.name
244
    t_brand_info.serviceCenterLocatorUrl = brand_info.serviceCenterLocatorUrl
8739 vikram.rag 245
    return t_brand_info
246
 
247
def to_t_snapdeal_item(snapdealitem):
8754 vikram.rag 248
    if snapdealitem is None:
8746 vikram.rag 249
        t_snapdeal_item = TSnapdealItem()
250
        return t_snapdeal_item
8739 vikram.rag 251
    t_snapdeal_item = TSnapdealItem()
8754 vikram.rag 252
    t_snapdeal_item.item_id = snapdealitem[0].item_id
8739 vikram.rag 253
    t_snapdeal_item.warehouseId = snapdealitem[0].warehouseId
254
    t_snapdeal_item.exceptionPrice = snapdealitem[0].exceptionPrice
9242 kshitij.so 255
    t_snapdeal_item.transferPrice = snapdealitem[0].transferPrice
256
    t_snapdeal_item.sellingPrice = snapdealitem[0].sellingPrice
257
    t_snapdeal_item.courierCost = snapdealitem[0].courierCost
258
    t_snapdeal_item.commission = snapdealitem[0].commission
259
    t_snapdeal_item.serviceTax = snapdealitem[0].serviceTax
260
    t_snapdeal_item.isListedOnSnapdeal = snapdealitem[0].isListedOnSnapdeal
261
    t_snapdeal_item.suppressPriceFeed = snapdealitem[0].suppressPriceFeed
262
    t_snapdeal_item.suppressInventoryFeed = snapdealitem[0].suppressInventoryFeed
9404 vikram.rag 263
    t_snapdeal_item.maxNlc = snapdealitem[0].maxNlc
9456 vikram.rag 264
    t_snapdeal_item.skuAtSnapdeal = snapdealitem[0].skuAtSnapdeal
9568 kshitij.so 265
    t_snapdeal_item.supc = snapdealitem[0].supc
9724 kshitij.so 266
    t_snapdeal_item.shippingTime = snapdealitem[0].shippingTime
9242 kshitij.so 267
    return t_snapdeal_item
268
 
9724 kshitij.so 269
def to_t_snapdeal_item_details(snapdealitem,snapdealItemInventory):
9242 kshitij.so 270
    if snapdealitem is None:
271
        t_snapdeal_item_details = TSnapdealItemDetails()
272
        return t_snapdeal_item_details
273
    t_snapdeal_item_details = TSnapdealItemDetails()
274
    t_snapdeal_item_details.item_id = snapdealitem[0].item_id
275
    t_snapdeal_item_details.warehouseId = snapdealitem[0].warehouseId
276
    t_snapdeal_item_details.exceptionPrice = snapdealitem[0].exceptionPrice
277
    t_snapdeal_item_details.transferPrice = snapdealitem[0].transferPrice
278
    t_snapdeal_item_details.sellingPrice = snapdealitem[0].sellingPrice
279
    t_snapdeal_item_details.courierCost = snapdealitem[0].courierCost
280
    t_snapdeal_item_details.commission = snapdealitem[0].commission
281
    t_snapdeal_item_details.serviceTax = snapdealitem[0].serviceTax
282
    t_snapdeal_item_details.brand = snapdealitem[1].brand
283
    t_snapdeal_item_details.model_name = snapdealitem[1].model_name
284
    t_snapdeal_item_details.model_number = snapdealitem[1].model_number
285
    t_snapdeal_item_details.color = snapdealitem[1].color
286
    t_snapdeal_item_details.risky = snapdealitem[1].risky
287
    t_snapdeal_item_details.itemStatus = snapdealitem[1].status
288
    t_snapdeal_item_details.isListedOnSnapdeal = snapdealitem[0].isListedOnSnapdeal
289
    t_snapdeal_item_details.weight = snapdealitem[1].weight
290
    t_snapdeal_item_details.mrp = snapdealitem[1].mrp
291
    t_snapdeal_item_details.websiteSellingPrice = snapdealitem[1].sellingPrice
292
    t_snapdeal_item_details.suppressPriceFeed = snapdealitem[0].suppressPriceFeed
293
    t_snapdeal_item_details.suppressInventoryFeed = snapdealitem[0].suppressInventoryFeed
9478 kshitij.so 294
    t_snapdeal_item_details.maxNlc = snapdealitem[0].maxNlc
9456 vikram.rag 295
    t_snapdeal_item_details.skuAtSnapdeal = snapdealitem[0].skuAtSnapdeal
9568 kshitij.so 296
    t_snapdeal_item_details.supc = snapdealitem[0].supc
9724 kshitij.so 297
    t_snapdeal_item_details.shippingTime = snapdealitem[0].shippingTime
298
    if snapdealItemInventory is not None:
299
        t_snapdeal_item_details.lastUpdatedInventory = snapdealItemInventory.availability
300
        t_snapdeal_item_details.lastUpdatedInventoryTimestamp = snapdealItemInventory.lastUpdatedOnSnapdeal 
9242 kshitij.so 301
    return t_snapdeal_item_details
9621 manish.sha 302
 
303
def to_t_product_feed_submit(productfeedsubmit):
304
    if productfeedsubmit is None:
305
        t_product_feed_submit = TProductFeedSubmit()
306
        return t_product_feed_submit
307
    t_product_feed_submit = TProductFeedSubmit()
308
    t_product_feed_submit.catalogItemId = productfeedsubmit.catalogItemId
309
    t_product_feed_submit.stockLinkedFeed = productfeedsubmit.stockLinkedFeed
9724 kshitij.so 310
    return t_product_feed_submit
311
 
312
def to_t_marketplace_items(marketplaceItem):
313
    t_marketplace_item = TMarketplaceItems() 
314
    if marketplaceItem is None:
315
        return t_marketplace_item
316
    t_marketplace_item.itemId = marketplaceItem.itemId
317
    t_marketplace_item.source = marketplaceItem.source
318
    t_marketplace_item.emiFee = marketplaceItem.emiFee
319
    t_marketplace_item.courierCost = marketplaceItem.courierCost
320
    t_marketplace_item.closingFee = marketplaceItem.closingFee
321
    t_marketplace_item.commission = marketplaceItem.commission
322
    t_marketplace_item.returnProvision = marketplaceItem.returnProvision
323
    t_marketplace_item.vat = marketplaceItem.vat
324
    t_marketplace_item.packagingCost = marketplaceItem.packagingCost
325
    t_marketplace_item.otherCost = marketplaceItem.otherCost
326
    t_marketplace_item.serviceTax = marketplaceItem.serviceTax
327
    t_marketplace_item.autoIncrement = marketplaceItem.autoIncrement
328
    t_marketplace_item.autoDecrement = marketplaceItem.autoDecrement
329
    t_marketplace_item.autoFavourite = marketplaceItem.autoFavourite
330
    t_marketplace_item.manualFavourite = marketplaceItem.manualFavourite
331
    t_marketplace_item.currentSp = marketplaceItem.currentSp
332
    t_marketplace_item.currentTp = marketplaceItem.currentTp
333
    t_marketplace_item.minimumPossibleSp = marketplaceItem.minimumPossibleSp
334
    t_marketplace_item.minimumPossibleTp = marketplaceItem.minimumPossibleTp
335
    t_marketplace_item.lastCheckedTimestamp = to_java_date(marketplaceItem.lastCheckedTimestamp)
9923 kshitij.so 336
    t_marketplace_item.maximumSellingPrice = marketplaceItem.maximumSellingPrice
10287 kshitij.so 337
    t_marketplace_item.pgFee = marketplaceItem.pgFee
9724 kshitij.so 338
    return t_marketplace_item
9776 vikram.rag 339
 
340
def to_t_marketplace_itemprice(marketplaceitemprice):
341
    t_marketplace_priceitem = TMarketPlaceItemPrice()    
342
    t_marketplace_priceitem.item_id = marketplaceitemprice.item_id
343
    t_marketplace_priceitem.source = marketplaceitemprice.source
344
    t_marketplace_priceitem.sellingPrice = marketplaceitemprice.sellingPrice
345
    t_marketplace_priceitem.lastUpdatedOn = to_java_date(marketplaceitemprice.lastUpdatedOn)
346
    t_marketplace_priceitem.lastUpdatedOnMarketplace = to_java_date(marketplaceitemprice.lastUpdatedOnMarketplace)
347
    t_marketplace_priceitem.isPriceOverride = marketplaceitemprice.suppressPriceFeed
348
    t_marketplace_priceitem.isListedOnSource = marketplaceitemprice.isListedOnSource
349
    return t_marketplace_priceitem 
9779 kshitij.so 350
 
351
def to_t_marketplacepercentage(marketplacePercentage):
352
    t_marketplacepercentage = TMarketplacePercentage()
353
    if marketplacePercentage is None:
354
        return t_marketplacepercentage
355
    t_marketplacepercentage.source =  marketplacePercentage.source
356
    t_marketplacepercentage.emiFee =  marketplacePercentage.emiFee
357
    t_marketplacepercentage.closingFee = marketplacePercentage.closingFee
358
    t_marketplacepercentage.returnProvision = marketplacePercentage.returnProvision
359
    t_marketplacepercentage.commission = marketplacePercentage.commission
360
    t_marketplacepercentage.serviceTax = marketplacePercentage.serviceTax
10287 kshitij.so 361
    t_marketplacepercentage.pgFee = marketplacePercentage.pgFee
9779 kshitij.so 362
    return t_marketplacepercentage
9945 vikram.rag 363
 
364
def to_t_flipkart_item(flipkartItem):
365
    t_flipkartitem = TFlipkartItem()
366
    if flipkartItem is None:
367
        return t_flipkartitem
10097 kshitij.so 368
    t_flipkartitem.item_id = flipkartItem[0].item_id  
369
    t_flipkartitem.exceptionPrice = flipkartItem[0].exceptionPrice
370
    t_flipkartitem.warehouseId = flipkartItem[0].warehouseId
371
    t_flipkartitem.commissionValue  =  flipkartItem[0].commissionValue
372
    t_flipkartitem.serviceTaxValue  =  flipkartItem[0].serviceTaxValue
373
    t_flipkartitem.maxNlc = flipkartItem[0].maxNlc
374
    t_flipkartitem.skuAtFlipkart = flipkartItem[0].skuAtFlipkart
375
    t_flipkartitem.isListedOnFlipkart = flipkartItem[0].isListedOnFlipkart
376
    t_flipkartitem.suppressPriceFeed = flipkartItem[0].suppressPriceFeed
377
    t_flipkartitem.suppressInventoryFeed = flipkartItem[0].suppressInventoryFeed
378
    #t_flipkartitem.updatedOn = to_java_date(flipkartItem.updatedOn)
379
    t_flipkartitem.updatedBy = flipkartItem[0].updatedBy
380
    t_flipkartitem.flipkartSerialNumber = flipkartItem[0].flipkartSerialNumber
9945 vikram.rag 381
    return t_flipkartitem
10097 kshitij.so 382
 
383
def to_t_flipkart_item_details(flipkartitem,flipkartItemInventory):
384
    if flipkartitem is None:
385
        t_flipkart_item_details = TFlipkartItemDetails()
386
        return t_flipkart_item_details
387
    t_flipkart_item_details = TFlipkartItemDetails()
388
    t_flipkart_item_details.item_id = flipkartitem[0].item_id
389
    t_flipkart_item_details.warehouseId = flipkartitem[0].warehouseId
390
    t_flipkart_item_details.exceptionPrice = flipkartitem[0].exceptionPrice
391
    t_flipkart_item_details.commission = flipkartitem[0].commissionValue
392
    t_flipkart_item_details.serviceTax = flipkartitem[0].serviceTaxValue
393
    t_flipkart_item_details.brand = flipkartitem[1].brand
394
    t_flipkart_item_details.model_name = flipkartitem[1].model_name
395
    t_flipkart_item_details.model_number = flipkartitem[1].model_number
396
    t_flipkart_item_details.color = flipkartitem[1].color
397
    t_flipkart_item_details.risky = flipkartitem[1].risky
398
    t_flipkart_item_details.itemStatus = flipkartitem[1].status
399
    t_flipkart_item_details.isListedOnFlipkart = flipkartitem[0].isListedOnFlipkart
400
    t_flipkart_item_details.weight = flipkartitem[1].weight
401
    t_flipkart_item_details.mrp = flipkartitem[1].mrp
402
    t_flipkart_item_details.websiteSellingPrice = flipkartitem[1].sellingPrice
403
    t_flipkart_item_details.suppressPriceFeed = flipkartitem[0].suppressPriceFeed
404
    t_flipkart_item_details.suppressInventoryFeed = flipkartitem[0].suppressInventoryFeed
405
    t_flipkart_item_details.maxNlc = flipkartitem[0].maxNlc
406
    t_flipkart_item_details.skuAtFlipkart = flipkartitem[0].skuAtFlipkart
407
    t_flipkart_item_details.flipkartSerialNumber = flipkartitem[0].flipkartSerialNumber
10156 amar.kumar 408
    t_flipkart_item_details.category = flipkartitem[1].category
10097 kshitij.so 409
    if flipkartItemInventory is not None:
410
        t_flipkart_item_details.lastUpdatedInventory = flipkartItemInventory.availability
411
        #t_flipkart_item_details.lastUpdatedInventoryTimestamp = flipkartItemInventory.lastUpdatedOnFlipkart 
412
    return t_flipkart_item_details
9945 vikram.rag 413