Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
4386 anupam.sin 1
from shop2020.thriftpy.logistics.ttypes import Provider as TProvider, AwbUpdate as TAwbUpdate, \
5555 rajveer 2
        ProviderDetails as TProviderDetails, PickupStore as TPickupStore
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))
442 rajveer 14
    return t_provider
3044 chandransh 15
 
16
def to_t_proivder_details(detail):
17
    t_provider_details = TProviderDetails()
18
    t_provider_details.accountNo = detail.accountNo
19
    t_provider_details.email = detail.email
7792 anupam.sin 20
    t_provider_details.logisticLocation = detail.logisticLocation
21
    t_provider_details.deliveryType = detail.type
3044 chandransh 22
    return t_provider_details 
23
 
644 chandransh 24
def to_t_awbupdate(update):
25
    t_update = TAwbUpdate()
6643 rajveer 26
    t_update.awbNumber    = update.awbNumber
27
    t_update.providerId = update.providerId
644 chandransh 28
    t_update.location     = update.location
6643 rajveer 29
    t_update.status  = update.status
30
    t_update.description  = update.description
31
    t_update.date    = to_java_date(update.date)
4386 anupam.sin 32
    return t_update
5555 rajveer 33
 
34
def to_t_pickup_store(store):
35
    t_store = TPickupStore()
5719 rajveer 36
    t_store.id = store.id
37
    t_store.hotspotId = store.hotspotId 
5555 rajveer 38
    t_store.name = store.name
5572 anupam.sin 39
    t_store.line1 = store.line_1
40
    t_store.line2 = store.line_2
5555 rajveer 41
    t_store.city = store.city
42
    t_store.state = store.state
43
    t_store.pin = store.pin
44
    t_store.phone = store.phone
5863 rajveer 45
    t_store.email = store.email
5739 rajveer 46
    t_store.zone = store.zone
5813 rajveer 47
    t_store.bdm = store.bdm
48
    t_store.bdmEmail = store.bdmEmail
5555 rajveer 49
    return t_store