| 4386 |
anupam.sin |
1 |
from shop2020.thriftpy.logistics.ttypes import Provider as TProvider, AwbUpdate as TAwbUpdate, \
|
| 20745 |
kshitij.so |
2 |
ProviderDetails as TProviderDetails, PickupStore as TPickupStore, BluedartAttributes as TBluedartAttributes
|
| 442 |
rajveer |
3 |
from shop2020.utils.Utils import to_java_date
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
def to_t_provider(provider):
|
|
|
7 |
t_provider = TProvider()
|
|
|
8 |
t_provider.id = provider.id
|
|
|
9 |
t_provider.name = provider.name
|
| 5527 |
anupam.sin |
10 |
t_provider.pickup = provider.pickup
|
| 7792 |
anupam.sin |
11 |
t_provider.details = []
|
| 3044 |
chandransh |
12 |
for detail in provider.details:
|
| 7792 |
anupam.sin |
13 |
t_provider.details.append(to_t_proivder_details(detail))
|
| 13146 |
manish.sha |
14 |
if provider.bundleWeightLimit:
|
|
|
15 |
t_provider.bundleWeightLimit = provider.bundleWeightLimit
|
|
|
16 |
t_provider.groupShipmentAllowed = provider.groupShipmentAllowed
|
|
|
17 |
t_provider.maxCodLimit = provider.maxCodLimit
|
| 442 |
rajveer |
18 |
return t_provider
|
| 3044 |
chandransh |
19 |
|
|
|
20 |
def to_t_proivder_details(detail):
|
|
|
21 |
t_provider_details = TProviderDetails()
|
|
|
22 |
t_provider_details.accountNo = detail.accountNo
|
|
|
23 |
t_provider_details.email = detail.email
|
| 7792 |
anupam.sin |
24 |
t_provider_details.logisticLocation = detail.logisticLocation
|
|
|
25 |
t_provider_details.deliveryType = detail.type
|
| 3044 |
chandransh |
26 |
return t_provider_details
|
|
|
27 |
|
| 644 |
chandransh |
28 |
def to_t_awbupdate(update):
|
|
|
29 |
t_update = TAwbUpdate()
|
| 6643 |
rajveer |
30 |
t_update.awbNumber = update.awbNumber
|
|
|
31 |
t_update.providerId = update.providerId
|
| 644 |
chandransh |
32 |
t_update.location = update.location
|
| 6643 |
rajveer |
33 |
t_update.status = update.status
|
|
|
34 |
t_update.description = update.description
|
|
|
35 |
t_update.date = to_java_date(update.date)
|
| 4386 |
anupam.sin |
36 |
return t_update
|
| 5555 |
rajveer |
37 |
|
|
|
38 |
def to_t_pickup_store(store):
|
|
|
39 |
t_store = TPickupStore()
|
| 5719 |
rajveer |
40 |
t_store.id = store.id
|
|
|
41 |
t_store.hotspotId = store.hotspotId
|
| 5555 |
rajveer |
42 |
t_store.name = store.name
|
| 5572 |
anupam.sin |
43 |
t_store.line1 = store.line_1
|
|
|
44 |
t_store.line2 = store.line_2
|
| 5555 |
rajveer |
45 |
t_store.city = store.city
|
|
|
46 |
t_store.state = store.state
|
|
|
47 |
t_store.pin = store.pin
|
|
|
48 |
t_store.phone = store.phone
|
| 5863 |
rajveer |
49 |
t_store.email = store.email
|
| 5739 |
rajveer |
50 |
t_store.zone = store.zone
|
| 5813 |
rajveer |
51 |
t_store.bdm = store.bdm
|
|
|
52 |
t_store.bdmEmail = store.bdmEmail
|
| 20745 |
kshitij.so |
53 |
return t_store
|
|
|
54 |
|
|
|
55 |
def to_t_bluedart_attribute(bluedartAttr):
|
|
|
56 |
t_bluedart_attr = TBluedartAttributes()
|
|
|
57 |
t_bluedart_attr.logisticsTransactionId = bluedartAttr.logisticsTransactionId
|
|
|
58 |
t_bluedart_attr.name = bluedartAttr.name
|
|
|
59 |
t_bluedart_attr.value = bluedartAttr.value
|
|
|
60 |
return t_bluedart_attr
|
|
|
61 |
|