| Line 7... |
Line 7... |
| 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 |
Item as T_Item, LineItem as T_LineItem, PaymentInfo, Payment, BillingInfo,\
|
8 |
Item as T_Item, LineItem as T_LineItem, PaymentInfo, Payment, BillingInfo,\
|
| 9 |
ShipmentInfo, Item, OrderInfo as T_OrderInfo
|
9 |
ShipmentInfo, Item, OrderInfo as T_OrderInfo
|
| 10 |
from shop2020.thriftpy.model.v1.order.ttypes import Billing as T_Billing
|
10 |
from shop2020.thriftpy.model.v1.order.ttypes import Billing as T_Billing
|
| 11 |
from shop2020.thriftpy.model.v1.order.ttypes import Shipment as T_Shipment
|
11 |
from shop2020.thriftpy.model.v1.order.ttypes import Shipment as T_Shipment
|
| - |
|
12 |
from shop2020.thriftpy.model.v1.order.ttypes import Alert as T_Alert
|
| - |
|
13 |
from shop2020.thriftpy.model.v1.order.ttypes import ExtraOrderInfo as T_ExtraOrderInfo
|
| 12 |
from shop2020.utils.Utils import to_java_date
|
14 |
from shop2020.utils.Utils import to_java_date
|
| 13 |
from shop2020.utils import OrderStatus
|
15 |
from shop2020.utils import OrderStatus
|
| 14 |
from shop2020.model.v1.order.impl.DataService import Billing
|
16 |
from shop2020.model.v1.order.impl.DataService import Billing, Alerts,\
|
| - |
|
17 |
ExtraItemInfo
|
| 15 |
from shop2020.utils.OrderStatus import get_t_status
|
18 |
from shop2020.utils.OrderStatus import get_t_status
|
| 16 |
|
19 |
|
| 17 |
def to_t_transaction(transaction):
|
20 |
def to_t_transaction(transaction):
|
| 18 |
t_transaction = T_Transaction()
|
21 |
t_transaction = T_Transaction()
|
| 19 |
t_transaction.id = transaction.id
|
22 |
t_transaction.id = transaction.id
|
| Line 150... |
Line 153... |
| 150 |
if shipment.lineitems:
|
153 |
if shipment.lineitems:
|
| 151 |
for line_item in shipment.lineitems:
|
154 |
for line_item in shipment.lineitems:
|
| 152 |
t_shipment.lineItems.append(to_t_lineitem(line_item))
|
155 |
t_shipment.lineItems.append(to_t_lineitem(line_item))
|
| 153 |
return t_shipment
|
156 |
return t_shipment
|
| 154 |
|
157 |
|
| - |
|
158 |
def to_t_alert(alert):
|
| - |
|
159 |
t_alert = T_Alert()
|
| - |
|
160 |
t_alert.id = alert.id
|
| - |
|
161 |
t_alert.comment = alert.comment
|
| - |
|
162 |
try:
|
| - |
|
163 |
t_alert.time_set = to_java_date(alert.time_set)
|
| - |
|
164 |
except:
|
| - |
|
165 |
pass
|
| - |
|
166 |
try:
|
| - |
|
167 |
t_alert.time_unset = to_java_date(alert.time_unset)
|
| - |
|
168 |
except:
|
| - |
|
169 |
pass
|
| - |
|
170 |
t_alert.transaction_id = alert.transaction_id
|
| - |
|
171 |
t_alert.type = alert.type
|
| - |
|
172 |
return t_alert
|
| - |
|
173 |
|
| - |
|
174 |
def to_t_extra_item_info(extra_item_info, transaction_id):
|
| - |
|
175 |
|
| - |
|
176 |
extra_order_info = T_ExtraOrderInfo()
|
| - |
|
177 |
if not extra_item_info:
|
| - |
|
178 |
extra_order_info.id = 2
|
| - |
|
179 |
extra_order_info.model_name = "N 72"
|
| - |
|
180 |
extra_order_info.sku_id = 34
|
| - |
|
181 |
extra_order_info.transaction_id = transaction_id
|
| - |
|
182 |
extra_order_info.vendor_info = "Nokia"
|
| - |
|
183 |
extra_order_info.colour = "Black"
|
| - |
|
184 |
return extra_order_info
|
| - |
|
185 |
|
| - |
|
186 |
extra_order_info.id = extra_item_info.id
|
| - |
|
187 |
extra_order_info.model_name = extra_item_info.model
|
| - |
|
188 |
extra_order_info.vendor_info = extra_item_info.vendor
|
| - |
|
189 |
extra_order_info.transaction_id = extra_item_info.transaction_id
|
| - |
|
190 |
extra_order_info.sku_id = extra_item_info.sku_id
|
| - |
|
191 |
return extra_order_info
|
| 155 |
|
192 |
|