| Line 4... |
Line 4... |
| 4 |
@author: ashish
|
4 |
@author: ashish
|
| 5 |
'''
|
5 |
'''
|
| 6 |
|
6 |
|
| 7 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as T_Transaction,\
|
7 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as T_Transaction,\
|
| 8 |
LineItem as T_LineItem, Order as T_Order, Alert as T_Alert, OrderStatus, DelayReason, \
|
8 |
LineItem as T_LineItem, Order as T_Order, Alert as T_Alert, OrderStatus, DelayReason, \
|
| 9 |
PaymentSettlement as T_PaymentSettlement, CODVerificationAgent as T_CODVerificationAgent
|
9 |
PaymentSettlement as T_PaymentSettlement, CODVerificationAgent as T_CODVerificationAgent, \
|
| - |
|
10 |
Attribute as T_Attribute
|
| 10 |
from shop2020.utils.Utils import to_java_date
|
11 |
from shop2020.utils.Utils import to_java_date
|
| 11 |
from shop2020.model.v1.order.impl.DataService import Alert, Transaction
|
12 |
from shop2020.model.v1.order.impl.DataService import Alert, Transaction
|
| 12 |
|
13 |
|
| 13 |
def to_t_transaction(transaction):
|
14 |
def to_t_transaction(transaction):
|
| 14 |
t_transaction = T_Transaction()
|
15 |
t_transaction = T_Transaction()
|
| Line 99... |
Line 100... |
| 99 |
t_order.purchaseOrderId = order.purchase_order_id
|
100 |
t_order.purchaseOrderId = order.purchase_order_id
|
| 100 |
if order.received_return_timestamp:
|
101 |
if order.received_return_timestamp:
|
| 101 |
t_order.received_return_timestamp = to_java_date(order.received_return_timestamp)
|
102 |
t_order.received_return_timestamp = to_java_date(order.received_return_timestamp)
|
| 102 |
if order.first_dlvyatmp_timestamp:
|
103 |
if order.first_dlvyatmp_timestamp:
|
| 103 |
t_order.first_attempt_timestamp = to_java_date(order.first_dlvyatmp_timestamp)
|
104 |
t_order.first_attempt_timestamp = to_java_date(order.first_dlvyatmp_timestamp)
|
| - |
|
105 |
t_order.orderType = order.orderType
|
| 104 |
|
106 |
|
| 105 |
return t_order
|
107 |
return t_order
|
| 106 |
|
108 |
|
| 107 |
def to_t_lineitem(lineitem):
|
109 |
def to_t_lineitem(lineitem):
|
| 108 |
t_lineitem = T_LineItem()
|
110 |
t_lineitem = T_LineItem()
|
| Line 155... |
Line 157... |
| 155 |
t_verification_agent = T_CODVerificationAgent()
|
157 |
t_verification_agent = T_CODVerificationAgent()
|
| 156 |
|
158 |
|
| 157 |
if codVerificationAgent:
|
159 |
if codVerificationAgent:
|
| 158 |
t_verification_agent.orderId = codVerificationAgent.orderId
|
160 |
t_verification_agent.orderId = codVerificationAgent.orderId
|
| 159 |
t_verification_agent.agentEmailId = codVerificationAgent.verificationAgent
|
161 |
t_verification_agent.agentEmailId = codVerificationAgent.verificationAgent
|
| 160 |
return t_verification_agent
|
- |
|
| 161 |
|
162 |
return t_verification_agent
|
| - |
|
163 |
|
| - |
|
164 |
def to_t_attribute(attribute):
|
| - |
|
165 |
t_attribute = T_Attribute()
|
| - |
|
166 |
|
| - |
|
167 |
if attribute:
|
| - |
|
168 |
t_attribute.name = attribute.name
|
| - |
|
169 |
t_attribute.value = attribute.value
|
| - |
|
170 |
return t_attribute
|
| - |
|
171 |
|
| 162 |
|
172 |
|