Subversion Repositories SmartDukaan

Rev

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