Subversion Repositories SmartDukaan

Rev

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