Rev 4386 | Rev 5527 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
from shop2020.thriftpy.logistics.ttypes import Provider as TProvider, AwbUpdate as TAwbUpdate, \ProviderDetails as TProviderDetailsfrom shop2020.utils.Utils import to_java_datedef to_t_provider(provider):t_provider = TProvider()t_provider.id = provider.idt_provider.name = provider.namet_provider.details = {}for detail in provider.details:t_provider.details[detail.type] = to_t_proivder_details(detail)return t_providerdef to_t_proivder_details(detail):t_provider_details = TProviderDetails()t_provider_details.accountNo = detail.accountNot_provider_details.email = detail.emailreturn t_provider_detailsdef to_t_awbupdate(update):t_update = TAwbUpdate()t_update.awbNumber = update.awb.awb_numbert_update.providerName = update.awb.provider.namet_update.description = update.description + " - " + update.commentst_update.location = update.locationt_update.entryDate = to_java_date(update.entry_date)return t_update