| Line 14... |
Line 14... |
| 14 |
from shop2020.thriftpy.logistics.ttypes import LogisticsServiceException, \
|
14 |
from shop2020.thriftpy.logistics.ttypes import LogisticsServiceException, \
|
| 15 |
DeliveryType
|
15 |
DeliveryType
|
| 16 |
from shop2020.thriftpy.model.v1.catalog.ttypes import Item
|
16 |
from shop2020.thriftpy.model.v1.catalog.ttypes import Item
|
| 17 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as TTransaction, \
|
17 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as TTransaction, \
|
| 18 |
TransactionStatus as TTransactionStatus, Order as TOrder, LineItem as TLineItem, \
|
18 |
TransactionStatus as TTransactionStatus, Order as TOrder, LineItem as TLineItem, \
|
| 19 |
OrderStatus
|
19 |
OrderStatus, OrderSource
|
| 20 |
from shop2020.thriftpy.model.v1.user.ttypes import CartStatus, LineStatus, \
|
20 |
from shop2020.thriftpy.model.v1.user.ttypes import CartStatus, LineStatus, \
|
| 21 |
ShoppingCartException, PromotionException
|
21 |
ShoppingCartException, PromotionException
|
| 22 |
from shop2020.utils.Utils import to_py_date, to_java_date
|
22 |
from shop2020.utils.Utils import to_py_date, to_java_date
|
| 23 |
import datetime
|
23 |
import datetime
|
| 24 |
|
24 |
|
| Line 316... |
Line 316... |
| 316 |
|
316 |
|
| 317 |
catalog_client = CatalogClient().get_client()
|
317 |
catalog_client = CatalogClient().get_client()
|
| 318 |
freebie_item_id = catalog_client.getFreebieForItem(t_line_item.item_id)
|
318 |
freebie_item_id = catalog_client.getFreebieForItem(t_line_item.item_id)
|
| 319 |
if freebie_item_id:
|
319 |
if freebie_item_id:
|
| 320 |
t_order.freebieItemId = freebie_item_id
|
320 |
t_order.freebieItemId = freebie_item_id
|
| - |
|
321 |
t_order.source = OrderSource.WEBSITE
|
| 321 |
return t_order
|
322 |
return t_order
|
| 322 |
|
323 |
|
| 323 |
def create_line_item(item_id, final_price, quantity=1):
|
324 |
def create_line_item(item_id, final_price, quantity=1):
|
| 324 |
inventory_client = CatalogClient().get_client()
|
325 |
inventory_client = CatalogClient().get_client()
|
| 325 |
item = inventory_client.getItem(item_id)
|
326 |
item = inventory_client.getItem(item_id)
|