Subversion Repositories SmartDukaan

Rev

Rev 15702 | Rev 18150 | 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
'''
12620 amit.gupta 6
from shop2020.model.v1.catalog.impl.DataService import Insurer, SnapdealItem, Item,\
7
    ExclusiveAffiliateItemInfo
6511 kshitij.so 8
from shop2020.thriftpy.model.v1.catalog.ttypes import Item, Category, \
9
    SourceItemPricing, Source, ItemType, \
5110 mandeep.dh 10
    ProductNotificationRequest as TProductNotificationRequest, \
11
    ProductNotificationRequestCount as TProductNotificationRequestCount, \
7281 kshitij.so 12
    VoucherItemMapping, EntityTag as TEntityTag, Banner as TBanner, BannerMap as TBannerMap, \
8182 amar.kumar 13
    Insurer as TInsurer, BrandInfo as TBrandInfo, Amazonlisted as TAmazonlisted, \
8739 vikram.rag 14
    EbayItem as TEbayItem, BannerUriMapping as TBannerUriMapping, Campaign as TCampaign, \
9724 kshitij.so 15
    SnapdealItem as TSnapdealItem, SnapdealItemDetails as TSnapdealItemDetails,ProductFeedSubmit as TProductFeedSubmit, \
9779 kshitij.so 16
    MarketplaceItems as TMarketplaceItems, MarketplacePercentage as TMarketplacePercentage, \
10097 kshitij.so 17
    MarketPlaceItemPrice as TMarketPlaceItemPrice, FlipkartItem as TFlipkartItem,\
11531 vikram.rag 18
    FlipkartItemDetails as TFlipkartItemDetails,MarketplaceHistory as TMarketplaceHistory,\
12363 kshitij.so 19
    PrivateDeal as TPrivateDeal, AmazonOutOfSync as TAmazonOutOfSync, PdPriceComp as TPdPriceComp, CompetitorPricing as TCompetitorPricing, \
13709 manish.sha 20
    AmazonPromotion as TAmazonPromotion, ExclusiveAffiliateItemInfo as TExclusiveAffiliateItemInfo, \
14862 manish.sha 21
    HsItem as THsItem, VoiSnapdealItemInfo as TVoiSnapdealItemInfo
12620 amit.gupta 22
 
13709 manish.sha 23
from shop2020.utils.Utils import to_java_date, to_py_date
12363 kshitij.so 24
import datetime
94 ashish 25
 
26
def to_t_item(item):
27
    t_item = Item()
576 chandransh 28
    if item is None:
29
        return t_item
94 ashish 30
    t_item.id = item.id
963 chandransh 31
    t_item.productGroup = item.product_group
32
    t_item.brand = item.brand
591 chandransh 33
    t_item.modelNumber = item.model_number
34
    t_item.modelName = item.model_name
609 chandransh 35
    t_item.color = item.color
591 chandransh 36
    t_item.category = item.category
122 ashish 37
    t_item.catalogItemId = item.catalog_item_id
38
    t_item.weight = item.weight
39
    t_item.featureId = item.feature_id
40
    t_item.featureDescription = item.feature_description
41
    if item.startDate:
42
        t_item.startDate = to_java_date(item.startDate)
5217 amit.gupta 43
    if item.comingSoonStartDate:
44
        t_item.comingSoonStartDate = to_java_date(item.comingSoonStartDate)
45
    if item.expectedArrivalDate:
46
        t_item.expectedArrivalDate = to_java_date(item.expectedArrivalDate)
122 ashish 47
    if item.addedOn:
48
        t_item.addedOn = to_java_date(item.addedOn)
609 chandransh 49
    if item.updatedOn:
50
        t_item.updatedOn = to_java_date(item.updatedOn)
122 ashish 51
    t_item.itemStatus = item.status
2035 rajveer 52
    t_item.status_description = item.status_description
501 rajveer 53
    if item.sellingPrice:
609 chandransh 54
        t_item.sellingPrice = item.sellingPrice
630 chandransh 55
    if item.mrp:
501 rajveer 56
        t_item.mrp = item.mrp    
122 ashish 57
 
2028 ankur.sing 58
    if item.comments:
59
        t_item.comments = item.comments
609 chandransh 60
    if item.bestDealText:
61
        t_item.bestDealText = item.bestDealText
6777 vikram.rag 62
    if item.bestDealsDetailsText:
63
        t_item.bestDealsDetailsText = item.bestDealsDetailsText
64
    if item.bestDealsDetailsLink:
65
        t_item.bestDealsDetailsLink = item.bestDealsDetailsLink 
609 chandransh 66
    if item.bestDealValue:
67
        t_item.bestDealValue = item.bestDealValue
7291 vikram.rag 68
    if item.asin:
69
        t_item.asin = item.asin    
1910 varun.gupt 70
    t_item.defaultForEntity = item.defaultForEntity
2065 ankur.sing 71
    t_item.bestSellingRank = item.bestSellingRank
2251 ankur.sing 72
    t_item.risky = item.risky
3355 chandransh 73
    t_item.expectedDelay = item.expectedDelay
4406 anupam.sin 74
    t_item.isWarehousePreferenceSticky = item.isWarehousePreferenceSticky
4295 varun.gupt 75
    t_item.warrantyPeriod = item.warranty_period
4506 phani.kuma 76
    t_item.preferredVendor = item.preferredVendor
5110 mandeep.dh 77
    t_item.type = ItemType._NAMES_TO_VALUES[item.type]
5385 phani.kuma 78
    t_item.hasItemNo = item.hasItemNo
7256 rajveer 79
    t_item.activeOnStore = item.activeOnStore
6241 amit.gupta 80
    t_item.showSellingPrice = item.showSellingPrice
6805 anupam.sin 81
    t_item.preferredInsurer = item.preferredInsurer
7291 vikram.rag 82
    t_item.holdInventory = item.holdInventory
83
    t_item.defaultInventory = item.defaultInventory
9841 rajveer 84
    t_item.holdOverride = item.holdOverride
18002 kshitij.so 85
    t_item.packQuantity = item.packQuantity
94 ashish 86
    return t_item
122 ashish 87
 
6805 anupam.sin 88
def to_t_insurer(insurer):
89
    t_insurer = TInsurer()
90
    t_insurer.id = insurer.id
91
    t_insurer.name = insurer.name 
92
    t_insurer.address = insurer.address
6903 anupam.sin 93
    t_insurer.declaredAmount = insurer.declaredAmount
94
    t_insurer.creditedAmount = insurer.creditedAmount
6805 anupam.sin 95
    return t_insurer
96
 
5504 phani.kuma 97
def to_t_voucher_item_mapping(voucher):
98
    t_voucher = VoucherItemMapping()
99
    t_voucher.voucherType = voucher.voucherType
100
    t_voucher.itemId = voucher.item.id
101
    t_voucher.amount = voucher.amount
102
    return t_voucher
103
 
1970 rajveer 104
def to_t_category(category):
105
    t_category = Category()
106
    t_category.id = category.id
107
    t_category.label = category.label
108
    t_category.description = category.description
109
    t_category.parent_category_id = category.parent_category_id
4762 phani.kuma 110
    t_category.display_name = category.display_name
3557 rajveer 111
    return t_category
112
 
113
def to_t_source_item_pricing(source_item_pricing):
114
    t_source_item_pricing = SourceItemPricing()
115
    t_source_item_pricing.sourceId = source_item_pricing.source.id
116
    t_source_item_pricing.itemId = source_item_pricing.item.id
117
    t_source_item_pricing.mrp = source_item_pricing.mrp
118
    t_source_item_pricing.sellingPrice = source_item_pricing.sellingPrice
119
    return t_source_item_pricing
120
 
121
def to_t_source(source):
122
    t_source = Source()
123
    t_source.id = source.id
124
    t_source.name = source.name
125
    t_source.identifier = source.identifier
126
    return t_source
4295 varun.gupt 127
 
128
def to_t_product_notification_request(product_notification_request):
129
    t_product_notification_request = TProductNotificationRequest()
130
 
131
    if product_notification_request:
132
        t_product_notification_request.item = to_t_item(product_notification_request.item)
133
        t_product_notification_request.email = product_notification_request.email
134
        t_product_notification_request.addedOn = to_java_date(product_notification_request.addedOn)
135
 
136
    return t_product_notification_request
137
 
138
def to_t_product_notification_request_count(product_notification_request_count):
139
 
140
    t_product_notification_request_count = TProductNotificationRequestCount()
141
 
142
    if product_notification_request_count:
143
        item, count = product_notification_request_count
144
        t_product_notification_request_count.item = to_t_item(item)
145
        t_product_notification_request_count.count = count
146
 
6511 kshitij.so 147
    return t_product_notification_request_count
148
 
149
def to_t_entity_tag(entity_tag):
150
    t_entity_tag = TEntityTag()
151
    t_entity_tag.entityId = entity_tag.entityId
6848 kshitij.so 152
    t_entity_tag.tag = entity_tag.tag
153
 
154
def to_t_banner(banner):
155
    t_banner = TBanner()
156
    t_banner.bannerName = banner.bannerName
157
    t_banner.imageName = banner.imageName
158
    t_banner.link = banner.link
159
    t_banner.priority = banner.priority
160
    t_banner.hasMap = banner.hasMap
9155 kshitij.so 161
    t_banner.bannerType = banner.bannerType
6848 kshitij.so 162
    return t_banner
163
 
8579 kshitij.so 164
def to_t_banner_list(bannerList):
165
    t_banner_list = []
166
    for banner in bannerList:
167
        t_banner = TBanner()
168
        t_banner.bannerName = banner.bannerName
169
        t_banner.imageName = banner.imageName
170
        t_banner.link = banner.link
171
        t_banner.priority = banner.priority
172
        t_banner.hasMap = banner.hasMap
9155 kshitij.so 173
        t_banner.bannerType = banner.bannerType
8579 kshitij.so 174
        t_banner_list.append(t_banner)
175
    return t_banner_list
176
 
177
 
6848 kshitij.so 178
def to_t_banner_map(banner_map):
179
    t_banner_map = TBannerMap()
180
    t_banner_map.bannerName = banner_map.bannerName
181
    t_banner_map.mapLink = banner_map.mapLink
182
    t_banner_map.coordinates = banner_map.coordinates
183
    return t_banner_map
7272 amit.gupta 184
 
8579 kshitij.so 185
def to_t_uri_mapping(uriMapping):
186
    t_uri_mapping =TBannerUriMapping()
187
    t_uri_mapping.bannerName = uriMapping.bannerName
188
    t_uri_mapping.uri = uriMapping.uri
189
    t_uri_mapping.isActive = uriMapping.isActive
10097 kshitij.so 190
    t_uri_mapping.target = uriMapping.target
8579 kshitij.so 191
    return t_uri_mapping
192
 
193
def to_t_campaign(campaign):
194
    t_campaign = TCampaign()
195
    t_campaign.id = campaign.id
196
    t_campaign.campaignName = campaign.campaignName
197
    t_campaign.imageName = campaign.imageName
198
    return t_campaign
199
 
7281 kshitij.so 200
def to_t_Amazonlisted(Amazonlisted):
201
    t_amazonlisted = TAmazonlisted()
8362 kshitij.so 202
    if Amazonlisted is None:
203
        return t_amazonlisted
7281 kshitij.so 204
    t_amazonlisted.asin = Amazonlisted.asin
205
    t_amazonlisted.brand = Amazonlisted.brand 
206
    t_amazonlisted.itemid = Amazonlisted.itemId
207
    t_amazonlisted.model = Amazonlisted.model
208
    t_amazonlisted.manufacturer_name = Amazonlisted.manufacturer_name
209
    t_amazonlisted.upc = Amazonlisted.upc
210
    t_amazonlisted.part_number = Amazonlisted.part_number
211
    t_amazonlisted.name = Amazonlisted.name
212
    t_amazonlisted.ean = Amazonlisted.ean
213
    t_amazonlisted.fbaPrice = Amazonlisted.fbaPrice
10909 vikram.rag 214
    t_amazonlisted.fbbPrice = Amazonlisted.fbbPrice
7281 kshitij.so 215
    t_amazonlisted.sellingPrice = Amazonlisted.sellingPrice
216
    t_amazonlisted.isFba = Amazonlisted.isFba
10909 vikram.rag 217
    t_amazonlisted.isFbb = Amazonlisted.isFbb
7281 kshitij.so 218
    t_amazonlisted.isNonFba = Amazonlisted.isNonFba
219
    t_amazonlisted.isInventoryOverride = Amazonlisted.isInventoryOverride
220
    t_amazonlisted.color = Amazonlisted.color
221
    t_amazonlisted.category = Amazonlisted.category
7367 kshitij.so 222
    t_amazonlisted.handlingTime = Amazonlisted.handlingTime
223
    t_amazonlisted.isCustomTime = Amazonlisted.isCustomTime
7516 vikram.rag 224
    t_amazonlisted.category_code = Amazonlisted.category_code
7770 kshitij.so 225
    t_amazonlisted.mfnPriceLastUpdatedOn = to_java_date(Amazonlisted.mfnPriceLastUpdatedOn)
226
    t_amazonlisted.fbaPriceLastUpdatedOn = to_java_date(Amazonlisted.fbaPriceLastUpdatedOn)
10909 vikram.rag 227
    t_amazonlisted.fbbPriceLastUpdatedOn = to_java_date(Amazonlisted.fbbPriceLastUpdatedOn)
7770 kshitij.so 228
    t_amazonlisted.mfnPriceLastUpdatedOnSc = to_java_date(Amazonlisted.mfnPriceLastUpdatedOnSc)
10909 vikram.rag 229
    t_amazonlisted.fbbPriceLastUpdatedOnSc = to_java_date(Amazonlisted.fbbPriceLastUpdatedOnSc)
7770 kshitij.so 230
    t_amazonlisted.fbaPriceLastUpdatedOnSc = to_java_date(Amazonlisted.fbaPriceLastUpdatedOnSc)
8139 kshitij.so 231
    t_amazonlisted.suppressMfnPriceUpdate = Amazonlisted.suppressMfnPriceUpdate
8140 kshitij.so 232
    t_amazonlisted.suppressFbaPriceUpdate = Amazonlisted.suppressFbaPriceUpdate
10909 vikram.rag 233
    t_amazonlisted.suppressFbbPriceUpdate = Amazonlisted.suppressFbbPriceUpdate
8619 kshitij.so 234
    t_amazonlisted.taxCode = Amazonlisted.taxCode
10918 vikram.rag 235
    t_amazonlisted.fbbtaxCode = Amazonlisted.fbbtaxCode
12363 kshitij.so 236
    t_amazonlisted.overrrideWanlc = Amazonlisted.overrrideWanlc
237
    t_amazonlisted.exceptionalWanlc = Amazonlisted.exceptionalWanlc
12396 kshitij.so 238
    t_amazonlisted.autoDecrement = Amazonlisted.autoDecrement
239
    t_amazonlisted.autoIncrement = Amazonlisted.autoIncrement
240
    t_amazonlisted.autoFavourite = Amazonlisted.autoFavourite
241
    t_amazonlisted.manualFavourite = Amazonlisted.manualFavourite
12449 kshitij.so 242
    t_amazonlisted.otherCost = Amazonlisted.otherCost
12663 kshitij.so 243
    t_amazonlisted.fbaPromoPrice = Amazonlisted.fbaPromoPrice
244
    t_amazonlisted.fbbPromoPrice = Amazonlisted.fbbPromoPrice
245
    t_amazonlisted.fbaPromoStartDate = to_java_date(Amazonlisted.fbaPromoStartDate)
246
    t_amazonlisted.fbaPromoEndDate = to_java_date(Amazonlisted.fbaPromoEndDate)
247
    t_amazonlisted.fbbPromoStartDate = to_java_date(Amazonlisted.fbbPromoStartDate)
248
    t_amazonlisted.fbbPromoEndDate = to_java_date(Amazonlisted.fbbPromoEndDate)
249
    t_amazonlisted.isFbaPromotionActive = Amazonlisted.fbaPromotionActive
250
    t_amazonlisted.isFbbPromotionActive = Amazonlisted.fbbPromotionActive
12888 kshitij.so 251
    t_amazonlisted.fbgPrice = Amazonlisted.fbgPrice
252
    t_amazonlisted.isFbg = Amazonlisted.isFbg
253
    t_amazonlisted.fbgtaxCode = Amazonlisted.fbgtaxCode
254
    t_amazonlisted.suppressFbgPriceUpdate = Amazonlisted.suppressFbgPriceUpdate
255
    t_amazonlisted.fbgPriceLastUpdatedOn = to_java_date(Amazonlisted.fbgPriceLastUpdatedOn)
256
    t_amazonlisted.fbgPriceLastUpdatedOnSc = to_java_date(Amazonlisted.fbgPriceLastUpdatedOnSc)
257
    t_amazonlisted.fbgPromoPrice = Amazonlisted.fbgPromoPrice
258
    t_amazonlisted.fbgPromoStartDate = to_java_date(Amazonlisted.fbgPromoStartDate)
259
    t_amazonlisted.fbgPromoEndDate = to_java_date(Amazonlisted.fbgPromoEndDate)
15702 kshitij.so 260
    t_amazonlisted.isFbgPromotionActive = Amazonlisted.fbgPromotionActive
261
    t_amazonlisted.fbdPrice = Amazonlisted.fbdPrice
262
    t_amazonlisted.isFbd = Amazonlisted.isFbd
263
    t_amazonlisted.fbdtaxCode = Amazonlisted.fbdtaxCode
264
    t_amazonlisted.suppressFbdPriceUpdate = Amazonlisted.suppressFbdPriceUpdate
265
    t_amazonlisted.fbdPriceLastUpdatedOn = to_java_date(Amazonlisted.fbdPriceLastUpdatedOn)
266
    t_amazonlisted.fbdPriceLastUpdatedOnSc = to_java_date(Amazonlisted.fbdPriceLastUpdatedOnSc)
267
    t_amazonlisted.fbdPromoPrice = Amazonlisted.fbdPromoPrice
268
    t_amazonlisted.fbdPromoStartDate = to_java_date(Amazonlisted.fbdPromoStartDate)
269
    t_amazonlisted.fbdPromoEndDate = to_java_date(Amazonlisted.fbdPromoEndDate)
270
    t_amazonlisted.isFbdPromotionActive = Amazonlisted.fbdPromotionActive 
271
 
7291 vikram.rag 272
    return t_amazonlisted
273
 
8182 amar.kumar 274
def to_t_ebay_item(ebay_item):
275
    t_ebay_item = TEbayItem()
276
    t_ebay_item.ebayListingId = ebay_item.ebayListingId
277
    t_ebay_item.itemId = ebay_item.itemId
278
    t_ebay_item.listingName = ebay_item.listingName
279
    t_ebay_item.listingPrice = ebay_item.listingPrice
280
    t_ebay_item.listingExpiryDate = to_java_date(ebay_item.listingExpiryDate)
281
    t_ebay_item.subsidy = ebay_item.subsidy
8274 amit.gupta 282
    return t_ebay_item
283
 
284
def to_t_brand_info(brand_info):
285
    t_brand_info = TBrandInfo()
286
    t_brand_info.name = brand_info.name
287
    t_brand_info.serviceCenterLocatorUrl = brand_info.serviceCenterLocatorUrl
8739 vikram.rag 288
    return t_brand_info
289
 
290
def to_t_snapdeal_item(snapdealitem):
8754 vikram.rag 291
    if snapdealitem is None:
8746 vikram.rag 292
        t_snapdeal_item = TSnapdealItem()
293
        return t_snapdeal_item
8739 vikram.rag 294
    t_snapdeal_item = TSnapdealItem()
8754 vikram.rag 295
    t_snapdeal_item.item_id = snapdealitem[0].item_id
8739 vikram.rag 296
    t_snapdeal_item.warehouseId = snapdealitem[0].warehouseId
297
    t_snapdeal_item.exceptionPrice = snapdealitem[0].exceptionPrice
9242 kshitij.so 298
    t_snapdeal_item.transferPrice = snapdealitem[0].transferPrice
299
    t_snapdeal_item.sellingPrice = snapdealitem[0].sellingPrice
300
    t_snapdeal_item.courierCost = snapdealitem[0].courierCost
11095 kshitij.so 301
    t_snapdeal_item.courierCostMarketplace = snapdealitem[0].courierCostMarketplace
9242 kshitij.so 302
    t_snapdeal_item.commission = snapdealitem[0].commission
303
    t_snapdeal_item.serviceTax = snapdealitem[0].serviceTax
304
    t_snapdeal_item.isListedOnSnapdeal = snapdealitem[0].isListedOnSnapdeal
305
    t_snapdeal_item.suppressPriceFeed = snapdealitem[0].suppressPriceFeed
306
    t_snapdeal_item.suppressInventoryFeed = snapdealitem[0].suppressInventoryFeed
9404 vikram.rag 307
    t_snapdeal_item.maxNlc = snapdealitem[0].maxNlc
9456 vikram.rag 308
    t_snapdeal_item.skuAtSnapdeal = snapdealitem[0].skuAtSnapdeal
9568 kshitij.so 309
    t_snapdeal_item.supc = snapdealitem[0].supc
9724 kshitij.so 310
    t_snapdeal_item.shippingTime = snapdealitem[0].shippingTime
14780 manish.sha 311
    t_snapdeal_item.isVoiListed = snapdealitem[0].isVoiListed
312
    t_snapdeal_item.voiSellingPrice = snapdealitem[0].voiSellingPrice
313
    t_snapdeal_item.suppressVoiPriceFeed = snapdealitem[0].suppressVoiPriceFeed
314
    t_snapdeal_item.voiPriceLastUpdatedOn = to_java_date(snapdealitem[0].voiPriceLastUpdatedOn)
315
    t_snapdeal_item.voiSkuAtSnapdeal = snapdealitem[0].voiSkuAtSnapdeal
316
    t_snapdeal_item.minimumPossibleSpVoi = snapdealitem[0].minimumPossibleSpVoi
317
    t_snapdeal_item.minimumPossibleTpVoi = snapdealitem[0].minimumPossibleTpVoi
318
    t_snapdeal_item.courierCostVoi = snapdealitem[0].courierCostVoi
319
    t_snapdeal_item.serviceTaxVoi = snapdealitem[0].serviceTaxVoi
320
    t_snapdeal_item.transferPriceVoi = snapdealitem[0].transferPriceVoi
321
    t_snapdeal_item.commissionVoi = snapdealitem[0].commissionVoi
14862 manish.sha 322
    t_snapdeal_item.courierCostMarketplaceVoi = snapdealitem[0].courierCostMarketplaceVoi
323
    t_snapdeal_item.commissionPercentageVoi = snapdealitem[0].commissionPercentageVoi
9242 kshitij.so 324
    return t_snapdeal_item
325
 
9724 kshitij.so 326
def to_t_snapdeal_item_details(snapdealitem,snapdealItemInventory):
9242 kshitij.so 327
    if snapdealitem is None:
328
        t_snapdeal_item_details = TSnapdealItemDetails()
329
        return t_snapdeal_item_details
330
    t_snapdeal_item_details = TSnapdealItemDetails()
331
    t_snapdeal_item_details.item_id = snapdealitem[0].item_id
332
    t_snapdeal_item_details.warehouseId = snapdealitem[0].warehouseId
333
    t_snapdeal_item_details.exceptionPrice = snapdealitem[0].exceptionPrice
334
    t_snapdeal_item_details.transferPrice = snapdealitem[0].transferPrice
335
    t_snapdeal_item_details.sellingPrice = snapdealitem[0].sellingPrice
336
    t_snapdeal_item_details.courierCost = snapdealitem[0].courierCost
11095 kshitij.so 337
    t_snapdeal_item_details.courierCostMarketplace = snapdealitem[0].courierCostMarketplace
9242 kshitij.so 338
    t_snapdeal_item_details.commission = snapdealitem[0].commission
339
    t_snapdeal_item_details.serviceTax = snapdealitem[0].serviceTax
340
    t_snapdeal_item_details.brand = snapdealitem[1].brand
341
    t_snapdeal_item_details.model_name = snapdealitem[1].model_name
342
    t_snapdeal_item_details.model_number = snapdealitem[1].model_number
343
    t_snapdeal_item_details.color = snapdealitem[1].color
344
    t_snapdeal_item_details.risky = snapdealitem[1].risky
345
    t_snapdeal_item_details.itemStatus = snapdealitem[1].status
346
    t_snapdeal_item_details.isListedOnSnapdeal = snapdealitem[0].isListedOnSnapdeal
347
    t_snapdeal_item_details.weight = snapdealitem[1].weight
348
    t_snapdeal_item_details.mrp = snapdealitem[1].mrp
349
    t_snapdeal_item_details.websiteSellingPrice = snapdealitem[1].sellingPrice
350
    t_snapdeal_item_details.suppressPriceFeed = snapdealitem[0].suppressPriceFeed
351
    t_snapdeal_item_details.suppressInventoryFeed = snapdealitem[0].suppressInventoryFeed
9478 kshitij.so 352
    t_snapdeal_item_details.maxNlc = snapdealitem[0].maxNlc
9456 vikram.rag 353
    t_snapdeal_item_details.skuAtSnapdeal = snapdealitem[0].skuAtSnapdeal
9568 kshitij.so 354
    t_snapdeal_item_details.supc = snapdealitem[0].supc
9724 kshitij.so 355
    t_snapdeal_item_details.shippingTime = snapdealitem[0].shippingTime
14780 manish.sha 356
    t_snapdeal_item_details.isVoiListed = snapdealitem[0].isVoiListed
9724 kshitij.so 357
    if snapdealItemInventory is not None:
358
        t_snapdeal_item_details.lastUpdatedInventory = snapdealItemInventory.availability
359
        t_snapdeal_item_details.lastUpdatedInventoryTimestamp = snapdealItemInventory.lastUpdatedOnSnapdeal 
9242 kshitij.so 360
    return t_snapdeal_item_details
9621 manish.sha 361
 
362
def to_t_product_feed_submit(productfeedsubmit):
363
    if productfeedsubmit is None:
364
        t_product_feed_submit = TProductFeedSubmit()
365
        return t_product_feed_submit
366
    t_product_feed_submit = TProductFeedSubmit()
367
    t_product_feed_submit.catalogItemId = productfeedsubmit.catalogItemId
368
    t_product_feed_submit.stockLinkedFeed = productfeedsubmit.stockLinkedFeed
9724 kshitij.so 369
    return t_product_feed_submit
370
 
371
def to_t_marketplace_items(marketplaceItem):
372
    t_marketplace_item = TMarketplaceItems() 
373
    if marketplaceItem is None:
374
        return t_marketplace_item
375
    t_marketplace_item.itemId = marketplaceItem.itemId
376
    t_marketplace_item.source = marketplaceItem.source
377
    t_marketplace_item.emiFee = marketplaceItem.emiFee
378
    t_marketplace_item.courierCost = marketplaceItem.courierCost
11095 kshitij.so 379
    t_marketplace_item.courierCostMarketplace = marketplaceItem.courierCostMarketplace
9724 kshitij.so 380
    t_marketplace_item.closingFee = marketplaceItem.closingFee
381
    t_marketplace_item.commission = marketplaceItem.commission
382
    t_marketplace_item.returnProvision = marketplaceItem.returnProvision
383
    t_marketplace_item.vat = marketplaceItem.vat
384
    t_marketplace_item.packagingCost = marketplaceItem.packagingCost
385
    t_marketplace_item.otherCost = marketplaceItem.otherCost
386
    t_marketplace_item.serviceTax = marketplaceItem.serviceTax
387
    t_marketplace_item.autoIncrement = marketplaceItem.autoIncrement
388
    t_marketplace_item.autoDecrement = marketplaceItem.autoDecrement
389
    t_marketplace_item.autoFavourite = marketplaceItem.autoFavourite
390
    t_marketplace_item.manualFavourite = marketplaceItem.manualFavourite
391
    t_marketplace_item.currentSp = marketplaceItem.currentSp
392
    t_marketplace_item.currentTp = marketplaceItem.currentTp
393
    t_marketplace_item.minimumPossibleSp = marketplaceItem.minimumPossibleSp
394
    t_marketplace_item.minimumPossibleTp = marketplaceItem.minimumPossibleTp
395
    t_marketplace_item.lastCheckedTimestamp = to_java_date(marketplaceItem.lastCheckedTimestamp)
9923 kshitij.so 396
    t_marketplace_item.maximumSellingPrice = marketplaceItem.maximumSellingPrice
10287 kshitij.so 397
    t_marketplace_item.pgFee = marketplaceItem.pgFee
9724 kshitij.so 398
    return t_marketplace_item
9776 vikram.rag 399
 
400
def to_t_marketplace_itemprice(marketplaceitemprice):
401
    t_marketplace_priceitem = TMarketPlaceItemPrice()    
402
    t_marketplace_priceitem.item_id = marketplaceitemprice.item_id
403
    t_marketplace_priceitem.source = marketplaceitemprice.source
404
    t_marketplace_priceitem.sellingPrice = marketplaceitemprice.sellingPrice
405
    t_marketplace_priceitem.lastUpdatedOn = to_java_date(marketplaceitemprice.lastUpdatedOn)
406
    t_marketplace_priceitem.lastUpdatedOnMarketplace = to_java_date(marketplaceitemprice.lastUpdatedOnMarketplace)
407
    t_marketplace_priceitem.isPriceOverride = marketplaceitemprice.suppressPriceFeed
408
    t_marketplace_priceitem.isListedOnSource = marketplaceitemprice.isListedOnSource
409
    return t_marketplace_priceitem 
9779 kshitij.so 410
 
411
def to_t_marketplacepercentage(marketplacePercentage):
412
    t_marketplacepercentage = TMarketplacePercentage()
413
    if marketplacePercentage is None:
414
        return t_marketplacepercentage
415
    t_marketplacepercentage.source =  marketplacePercentage.source
416
    t_marketplacepercentage.emiFee =  marketplacePercentage.emiFee
417
    t_marketplacepercentage.closingFee = marketplacePercentage.closingFee
418
    t_marketplacepercentage.returnProvision = marketplacePercentage.returnProvision
419
    t_marketplacepercentage.commission = marketplacePercentage.commission
420
    t_marketplacepercentage.serviceTax = marketplacePercentage.serviceTax
10287 kshitij.so 421
    t_marketplacepercentage.pgFee = marketplacePercentage.pgFee
9779 kshitij.so 422
    return t_marketplacepercentage
9945 vikram.rag 423
 
424
def to_t_flipkart_item(flipkartItem):
425
    t_flipkartitem = TFlipkartItem()
426
    if flipkartItem is None:
427
        return t_flipkartitem
10097 kshitij.so 428
    t_flipkartitem.item_id = flipkartItem[0].item_id  
429
    t_flipkartitem.exceptionPrice = flipkartItem[0].exceptionPrice
430
    t_flipkartitem.warehouseId = flipkartItem[0].warehouseId
431
    t_flipkartitem.commissionValue  =  flipkartItem[0].commissionValue
432
    t_flipkartitem.serviceTaxValue  =  flipkartItem[0].serviceTaxValue
433
    t_flipkartitem.maxNlc = flipkartItem[0].maxNlc
434
    t_flipkartitem.skuAtFlipkart = flipkartItem[0].skuAtFlipkart
435
    t_flipkartitem.isListedOnFlipkart = flipkartItem[0].isListedOnFlipkart
436
    t_flipkartitem.suppressPriceFeed = flipkartItem[0].suppressPriceFeed
437
    t_flipkartitem.suppressInventoryFeed = flipkartItem[0].suppressInventoryFeed
438
    #t_flipkartitem.updatedOn = to_java_date(flipkartItem.updatedOn)
439
    t_flipkartitem.updatedBy = flipkartItem[0].updatedBy
440
    t_flipkartitem.flipkartSerialNumber = flipkartItem[0].flipkartSerialNumber
14780 manish.sha 441
    t_flipkartitem.isFaListed = flipkartItem[0].isFaListed
9945 vikram.rag 442
    return t_flipkartitem
10097 kshitij.so 443
 
444
def to_t_flipkart_item_details(flipkartitem,flipkartItemInventory):
445
    if flipkartitem is None:
446
        t_flipkart_item_details = TFlipkartItemDetails()
447
        return t_flipkart_item_details
448
    t_flipkart_item_details = TFlipkartItemDetails()
449
    t_flipkart_item_details.item_id = flipkartitem[0].item_id
450
    t_flipkart_item_details.warehouseId = flipkartitem[0].warehouseId
451
    t_flipkart_item_details.exceptionPrice = flipkartitem[0].exceptionPrice
452
    t_flipkart_item_details.commission = flipkartitem[0].commissionValue
453
    t_flipkart_item_details.serviceTax = flipkartitem[0].serviceTaxValue
454
    t_flipkart_item_details.brand = flipkartitem[1].brand
455
    t_flipkart_item_details.model_name = flipkartitem[1].model_name
456
    t_flipkart_item_details.model_number = flipkartitem[1].model_number
457
    t_flipkart_item_details.color = flipkartitem[1].color
458
    t_flipkart_item_details.risky = flipkartitem[1].risky
459
    t_flipkart_item_details.itemStatus = flipkartitem[1].status
460
    t_flipkart_item_details.isListedOnFlipkart = flipkartitem[0].isListedOnFlipkart
461
    t_flipkart_item_details.weight = flipkartitem[1].weight
462
    t_flipkart_item_details.mrp = flipkartitem[1].mrp
463
    t_flipkart_item_details.websiteSellingPrice = flipkartitem[1].sellingPrice
464
    t_flipkart_item_details.suppressPriceFeed = flipkartitem[0].suppressPriceFeed
465
    t_flipkart_item_details.suppressInventoryFeed = flipkartitem[0].suppressInventoryFeed
466
    t_flipkart_item_details.maxNlc = flipkartitem[0].maxNlc
467
    t_flipkart_item_details.skuAtFlipkart = flipkartitem[0].skuAtFlipkart
468
    t_flipkart_item_details.flipkartSerialNumber = flipkartitem[0].flipkartSerialNumber
10156 amar.kumar 469
    t_flipkart_item_details.category = flipkartitem[1].category
14780 manish.sha 470
    t_flipkart_item_details.isFaListed = flipkartitem[0].isFaListed
10097 kshitij.so 471
    if flipkartItemInventory is not None:
472
        t_flipkart_item_details.lastUpdatedInventory = flipkartItemInventory.availability
473
        #t_flipkart_item_details.lastUpdatedInventoryTimestamp = flipkartItemInventory.lastUpdatedOnFlipkart 
474
    return t_flipkart_item_details
11015 kshitij.so 475
 
476
def to_t_market_place_history(marketplaceHistory):
477
    t_marketplace_history = TMarketplaceHistory()
478
    if marketplaceHistory is None:
479
        return t_marketplace_history
480
    t_marketplace_history.item_id = marketplaceHistory.item_id
481
    t_marketplace_history.source = marketplaceHistory.source
482
    t_marketplace_history.timestamp = to_java_date(marketplaceHistory.timestamp)
11076 kshitij.so 483
    if marketplaceHistory.lowestPossibleTp is None:
484
        t_marketplace_history.lowest_possible_tp =0
485
    else:
486
        t_marketplace_history.lowest_possible_tp = int(marketplaceHistory.lowestPossibleTp)
487
    if marketplaceHistory.lowestPossibleSp is None:
488
        t_marketplace_history.lowest_possible_sp = 0
489
    else:
490
        t_marketplace_history.lowest_possible_sp = int(marketplaceHistory.lowestPossibleSp)
11015 kshitij.so 491
    t_marketplace_history.ourInventory = marketplaceHistory.ourInventory
492
    t_marketplace_history.otherInventory = marketplaceHistory.otherInventory
493
    t_marketplace_history.secondLowestInventory = marketplaceHistory.secondLowestInventory
494
    t_marketplace_history.ourRank = marketplaceHistory.ourRank
11076 kshitij.so 495
    if marketplaceHistory.ourOfferPrice is None:
496
        t_marketplace_history.ourOfferPrice = 0
497
    else: 
498
        t_marketplace_history.ourOfferPrice = int(marketplaceHistory.ourOfferPrice)
499
    if marketplaceHistory.ourSellingPrice is None:
500
        t_marketplace_history.ourSellingPrice = 0
501
    else:
502
        t_marketplace_history.ourSellingPrice = int(marketplaceHistory.ourSellingPrice)
503
    if marketplaceHistory.ourTp is None:
504
        t_marketplace_history.ourTp = 0
505
    else:
506
        t_marketplace_history.ourTp = int(marketplaceHistory.ourTp)
507
    if marketplaceHistory.ourNlc is None:
508
        t_marketplace_history.ourNlc = 0
509
    else:
510
        t_marketplace_history.ourNlc = int(marketplaceHistory.ourNlc)
11015 kshitij.so 511
    t_marketplace_history.competitiveCategory = marketplaceHistory.competitiveCategory
512
    t_marketplace_history.risky = marketplaceHistory.risky
11076 kshitij.so 513
    if marketplaceHistory.lowestOfferPrice is None:
514
        t_marketplace_history.lowestOfferPrice = 0
515
    else:
516
        t_marketplace_history.lowestOfferPrice = int(marketplaceHistory.lowestOfferPrice)
517
    if marketplaceHistory.lowestSellingPrice is None:
518
        t_marketplace_history.lowestSellingPrice = 0
519
    else:
520
        t_marketplace_history.lowestSellingPrice = int(marketplaceHistory.lowestSellingPrice)
521
    if marketplaceHistory.lowestTp is None:
522
        t_marketplace_history.lowestTp = 0
523
    else:
524
        t_marketplace_history.lowestTp = int(marketplaceHistory.lowestTp)
11015 kshitij.so 525
    if marketplaceHistory.lowestSellerName is None:
526
        t_marketplace_history.lowestSellerName = ''
527
    else:
528
        t_marketplace_history.lowestSellerName = marketplaceHistory.lowestSellerName
11076 kshitij.so 529
    if marketplaceHistory.proposedSellingPrice is None:
530
        t_marketplace_history.proposedSellingPrice = 0
531
    else:
532
        t_marketplace_history.proposedSellingPrice = int(marketplaceHistory.proposedSellingPrice)
533
    if marketplaceHistory.proposedTp is None:
534
        t_marketplace_history.proposedTp = 0
535
    else:
536
        t_marketplace_history.proposedTp = int(marketplaceHistory.proposedTp)
537
    if marketplaceHistory.targetNlc is None:
538
        t_marketplace_history.targetNlc = 0
539
    else:
540
        t_marketplace_history.targetNlc = int(marketplaceHistory.targetNlc)
11015 kshitij.so 541
    t_marketplace_history.salesPotential = marketplaceHistory.salesPotential
542
    if marketplaceHistory.secondLowestSellerName is None:
543
        t_marketplace_history.secondLowestSellerName = ''
544
    else:
545
        t_marketplace_history.secondLowestSellerName = marketplaceHistory.secondLowestSellerName
11017 kshitij.so 546
    if marketplaceHistory.secondLowestSellingPrice is None:
11076 kshitij.so 547
        t_marketplace_history.secondLowestSellingPrice=0
11017 kshitij.so 548
    else:
11076 kshitij.so 549
        t_marketplace_history.secondLowestSellingPrice = int(marketplaceHistory.secondLowestSellingPrice)
11017 kshitij.so 550
    if marketplaceHistory.secondLowestOfferPrice is None:
11076 kshitij.so 551
        t_marketplace_history.secondLowestOfferPrice = 0
11017 kshitij.so 552
    else:
11076 kshitij.so 553
        t_marketplace_history.secondLowestOfferPrice = int(marketplaceHistory.secondLowestOfferPrice)
11017 kshitij.so 554
    if marketplaceHistory.secondLowestTp is None:
11076 kshitij.so 555
        t_marketplace_history.secondLowestTp=0
11017 kshitij.so 556
    else:
11076 kshitij.so 557
        t_marketplace_history.secondLowestTp = int(marketplaceHistory.secondLowestTp)
11015 kshitij.so 558
    t_marketplace_history.marginIncreasedPotential = marketplaceHistory.marginIncreasedPotential
11076 kshitij.so 559
    if marketplaceHistory.margin is None:
560
        t_marketplace_history.margin = 0
561
    else:
562
        t_marketplace_history.margin = int(marketplaceHistory.margin)
11015 kshitij.so 563
    t_marketplace_history.ourEnoughStock = marketplaceHistory.ourEnoughStock
564
    t_marketplace_history.totalSeller = marketplaceHistory.totalSeller
565
    t_marketplace_history.averageSale = marketplaceHistory.avgSales
566
    t_marketplace_history.toGroup = marketplaceHistory.toGroup
11076 kshitij.so 567
    t_marketplace_history.decision = marketplaceHistory.decision
568
    t_marketplace_history.reason = marketplaceHistory.reason
11015 kshitij.so 569
    return t_marketplace_history
9945 vikram.rag 570
 
11531 vikram.rag 571
def to_t_private_deal(private_deal_item):
572
    if private_deal_item is None:
573
        t_private_deal_item = TPrivateDeal()
574
        return t_private_deal_item
575
    t_private_deal_item = TPrivateDeal()
576
    t_private_deal_item.item_id = private_deal_item.item_id
577
    t_private_deal_item.dealPrice = private_deal_item.dealPrice
578
    t_private_deal_item.dealFreebieItemId = private_deal_item.dealFreebieItemId
11579 vikram.rag 579
    t_private_deal_item.startDate = to_java_date(private_deal_item.startDate)
580
    t_private_deal_item.endDate = to_java_date(private_deal_item.endDate)
11566 vikram.rag 581
    t_private_deal_item.dealTextOption = private_deal_item.dealTextOption
11635 vikram.rag 582
    if private_deal_item.dealText is None: 
11613 vikram.rag 583
        t_private_deal_item.dealText = ''
584
    else:
585
        t_private_deal_item.dealText = private_deal_item.dealText    
11531 vikram.rag 586
    t_private_deal_item.isCod = private_deal_item.isCod
587
    t_private_deal_item.rank = private_deal_item.rank
11566 vikram.rag 588
    t_private_deal_item.dealFreebieOption = private_deal_item.dealFreebieOption
11606 vikram.rag 589
    t_private_deal_item.isActive = private_deal_item.isActive
11905 kshitij.so 590
    return t_private_deal_item
591
 
592
def to_t_amazonoutofsync(amazonOutOfSync):
593
    t_amazonoutofsync = TAmazonOutOfSync()
594
    if amazonOutOfSync is None:
595
        return t_amazonoutofsync
596
    else:
597
        t_amazonoutofsync.item_id = amazonOutOfSync.item_id
598
        t_amazonoutofsync.mfn = amazonOutOfSync.mfn
599
        t_amazonoutofsync.fba = amazonOutOfSync.fba
600
        t_amazonoutofsync.fbb = amazonOutOfSync.fbb
601
        return t_amazonoutofsync
602
 
603
def to_t_private_deals_comparison(item):
604
    xstr = lambda s: s or ""
605
    t_pdcomp = TPdPriceComp()
606
    pdComp = item[0]
607
    catItem  = item[1]
608
    t_pdcomp.item_id = pdComp.item_id
609
    t_pdcomp.dealPrice = pdComp.dealPrice
610
    t_pdcomp.saholicPrice = pdComp.saholicPrice
611
    t_pdcomp.sdPrice = pdComp.sdPrice
612
    t_pdcomp.fkPrice = pdComp.fkPrice
613
    t_pdcomp.amazonPrice = pdComp.amazonPrice
614
    t_pdcomp.productName = xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color)
12169 kshitij.so 615
    t_pdcomp.lastProcessedTimestamp = to_java_date(pdComp.lastProcessedTimestamp)
11905 kshitij.so 616
    return t_pdcomp
617
 
12133 kshitij.so 618
def to_t_snapdeal_marketplace_item(item):
619
    mpItem = item[1]
620
    dItem = item[2]
621
    t_sd_item = to_t_snapdeal_item(item)
622
    t_sd_item.marketplaceItems = to_t_marketplace_items(mpItem)
623
    t_sd_item.item = to_t_item(dItem)
624
    return t_sd_item
13709 manish.sha 625
'''
626
def to_t_deal_tag(dealTag):
627
    t_deal_tag = TDealTag()
628
    t_deal_tag.id = dealTag.id
629
    t_deal_tag.name = dealTag.name
630
    return t_deal_tag
12133 kshitij.so 631
 
13709 manish.sha 632
def to_t_item_tag(itemTag):
633
    t_item_tag = TItemTag()
634
    t_item_tag.itemId = itemTag.itemId
635
    t_item_tag.tagId = itemTag.tagId
636
    t_item_tag.startDate = to_java_date(itemTag.startDate)
637
    t_item_tag.endDate = to_java_date(itemTag.endDate)
638
    t_item_tag.status = itemTag.status
639
    return t_item_tag
640
'''
641
 
12133 kshitij.so 642
def to_t_flipkart_marketplace_item(item):
643
    mpItem = item[1]
644
    dItem = item[2]
645
    t_fk_item = to_t_flipkart_item(item)
646
    t_fk_item.marketplaceItems = to_t_marketplace_items(mpItem)
647
    t_fk_item.item = to_t_item(dItem)
648
    return t_fk_item
12243 kshitij.so 649
 
12256 kshitij.so 650
def to_t_competitor_pricing(compPricing):
651
    xstr = lambda s: s or ""
652
    item = compPricing[0]
653
    catItem = compPricing[1]
654
    t_comp = TCompetitorPricing()
655
    t_comp.productName = xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color)
656
    t_comp.item_id = item.item_id
657
    t_comp.lowestSnapdealPrice = item.lowestSnapdealPrice
658
    t_comp.lowestFlipkartPrice = item.lowestFlipkartPrice
659
    t_comp.lowestAmazonPrice = item.lowestAmazonPrice
660
    t_comp.ourSnapdealPrice = item.ourSnapdealPrice
661
    t_comp.ourSnapdealOfferPrice = item.ourSnapdealOfferPrice
662
    t_comp.ourSnapdealInventory = item.ourSnapdealInventory
663
    t_comp.lowestSnapdealOfferPrice = item.lowestSnapdealOfferPrice
664
    if item.lowestSnapdealSeller is None:
665
        t_comp.lowestSnapdealSeller=''
666
    else:
667
        t_comp.lowestSnapdealSeller = item.lowestSnapdealSeller
668
    t_comp.lowestSnapdealSellerInventory = item.lowestSnapdealSellerInventory
669
    t_comp.ourFlipkartPrice = item.ourFlipkartPrice
670
    t_comp.ourFlipkartInventory = item.ourFlipkartInventory
671
    if item.lowestFlipkartSeller is None:
672
        t_comp.lowestFlipkartSeller=''
673
    else:
674
        t_comp.lowestFlipkartSeller = item.lowestFlipkartSeller
15488 kshitij.so 675
    t_comp.ourAmazonPrice = item.ourAmazonPrice
12256 kshitij.so 676
    t_comp.lowestAmazonPrice = item.lowestAmazonPrice
677
    if item.lowestAmazonSeller is None:
678
        t_comp.lowestAmazonSeller=''
679
    else:
680
        t_comp.lowestAmazonSeller = item.lowestAmazonSeller
681
    return t_comp
12363 kshitij.so 682
 
683
def to_t_amazon_promotion(amazonPromotion):
684
    t_amazonPromotion = TAmazonPromotion()
685
    t_amazonPromotion.sku = amazonPromotion.sku
686
    t_amazonPromotion.startDate = to_java_date(datetime.datetime.combine(amazonPromotion.startDate, datetime.datetime.min.time()))
687
    t_amazonPromotion.endDate = to_java_date(datetime.datetime.combine(amazonPromotion.endDate, datetime.datetime.min.time()))
688
    t_amazonPromotion.updatedOnMarketplace = to_java_date(amazonPromotion.updatedOnMarketplace)
689
    t_amazonPromotion.promotionActive = amazonPromotion.promotionActive
690
    t_amazonPromotion.addedOn = to_java_date(amazonPromotion.addedOn)
691
    t_amazonPromotion.standardPrice = amazonPromotion.standardPrice
692
    t_amazonPromotion.salePrice = amazonPromotion.salePrice
693
    t_amazonPromotion.stateId = amazonPromotion.stateId
694
    t_amazonPromotion.promotionType = amazonPromotion.promotionType
695
    return t_amazonPromotion
696
 
697
def to_t_Amazonlisted_promo(amazonDetails):
698
    amazonlisted = amazonDetails[0]
699
    fbaPromo = amazonDetails[1]
700
    fbbPromo = amazonDetails[2]
12888 kshitij.so 701
    fbgPromo = amazonDetails[3]
15702 kshitij.so 702
    fbdPromo = amazonDetails[4]
12363 kshitij.so 703
    t_amazon = to_t_Amazonlisted(amazonlisted)
704
    if not (fbaPromo is None or len(fbaPromo)==0):
12663 kshitij.so 705
        t_amazon.maxFbaSalePrice = fbaPromo[0].salePrice
12363 kshitij.so 706
    if not (fbbPromo is None or len(fbbPromo)==0):
12663 kshitij.so 707
        t_amazon.maxFbbSalePrice = fbbPromo[0].salePrice
12888 kshitij.so 708
    if not (fbgPromo is None or len(fbgPromo)==0):
709
        t_amazon.maxFbgSalePrice = fbgPromo[0].salePrice
15702 kshitij.so 710
    if not (fbdPromo is None or len(fbdPromo)==0):
711
        t_amazon.maxFbdSalePrice = fbdPromo[0].salePrice
12363 kshitij.so 712
    return t_amazon
12620 amit.gupta 713
 
714
def to_t_exclusive_affiliate_item_info(afItemInfo):
715
    tinfo = TExclusiveAffiliateItemInfo()
716
    tinfo.affiliateId = afItemInfo[0].affiliateId
717
    tinfo.active = afItemInfo[0].isActive
718
    tinfo.affiliateName = afItemInfo[1]
719
    tinfo.offerImageUrl = afItemInfo[0].offerUrl
720
    tinfo.offerText = afItemInfo[0].offerText
721
    tinfo.itemId = afItemInfo[0].itemId
722
    tinfo.mOfferImageUrl = afItemInfo[0].mOfferUrl
723
    tinfo.mOfferText = afItemInfo[0].mOfferText
724
    tinfo.affiliateUrl = afItemInfo[0].affiliateUrl
725
    return tinfo
12363 kshitij.so 726
 
13709 manish.sha 727
def to_t_hsItem(hsItem):
728
    t_hsItem = THsItem()
729
    t_hsItem.addedBy = hsItem.addedBy
730
    t_hsItem.addedTimestamp = to_java_date(hsItem.addedTimestamp)
731
    t_hsItem.defaultWarehouseId = hsItem.defaultWarehouseId
732
    t_hsItem.hsItemId = hsItem.hsItemId
733
    t_hsItem.hsProductId = hsItem.hsProductId
734
    t_hsItem.itemId = hsItem.itemId
735
    t_hsItem.listingPrice = hsItem.listingPrice
14862 manish.sha 736
    return t_hsItem
737
 
738
def to_t_voiSnapdealItemInfo(voiSnapdealItemInfo):
739
    t_voiSnapdealItemInfo = TVoiSnapdealItemInfo()
740
    t_voiSnapdealItemInfo.item_id = voiSnapdealItemInfo.item_id
741
    t_voiSnapdealItemInfo.voiSkuAtSnapdeal = voiSnapdealItemInfo.voiSkuAtSnapdeal
742
    t_voiSnapdealItemInfo.sellingPriceSnapdeal = voiSnapdealItemInfo.sellingPriceSnapdeal
743
    t_voiSnapdealItemInfo.transferPriceSnapdeal = voiSnapdealItemInfo.transferPriceSnapdeal
744
    t_voiSnapdealItemInfo.fixedMargin = voiSnapdealItemInfo.fixedMargin
745
    t_voiSnapdealItemInfo.fixedMarginPercentage = voiSnapdealItemInfo.fixedMarginPercentage
746
    t_voiSnapdealItemInfo.logisticCostSnapdeal = voiSnapdealItemInfo.logisticCostSnapdeal
747
    t_voiSnapdealItemInfo.woodenPackagingCost = voiSnapdealItemInfo.woodenPackagingCost
748
    t_voiSnapdealItemInfo.weightSnapdeal = voiSnapdealItemInfo.weightSnapdeal
749
    return t_voiSnapdealItemInfo