| Line 10... |
Line 10... |
| 10 |
change_transaction_status, get_orders_for_customer,get_orders_for_transaction, get_order,\
|
10 |
change_transaction_status, get_orders_for_customer,get_orders_for_transaction, get_order,\
|
| 11 |
get_all_orders, change_order_status, get_alerts, set_alert, add_billing_details,\
|
11 |
get_all_orders, change_order_status, get_alerts, set_alert, add_billing_details,\
|
| 12 |
mark_orders_as_manifested, close_session, accept_order, bill_order,\
|
12 |
mark_orders_as_manifested, close_session, accept_order, bill_order,\
|
| 13 |
get_orders_by_billing_date, mark_orders_as_picked_up,\
|
13 |
get_orders_by_billing_date, mark_orders_as_picked_up,\
|
| 14 |
mark_orders_as_delivered, mark_orders_as_failed, add_jacket_number,\
|
14 |
mark_orders_as_delivered, mark_orders_as_failed, add_jacket_number,\
|
| 15 |
order_outofstock
|
15 |
order_outofstock, batch_orders
|
| 16 |
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
|
16 |
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
|
| 17 |
to_t_lineitem, to_t_alert, to_t_order, to_t_lineitem
|
17 |
to_t_lineitem, to_t_alert, to_t_order, to_t_lineitem
|
| 18 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
|
18 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
|
| 19 |
LineItem, Order
|
19 |
LineItem, Order
|
| 20 |
from shop2020.utils.Utils import to_py_date, get_fdate_tdate
|
20 |
from shop2020.utils.Utils import to_py_date, get_fdate_tdate
|
| Line 243... |
Line 243... |
| 243 |
"""
|
243 |
"""
|
| 244 |
try:
|
244 |
try:
|
| 245 |
return add_jacket_number(orderId, jacketNumber)
|
245 |
return add_jacket_number(orderId, jacketNumber)
|
| 246 |
finally:
|
246 |
finally:
|
| 247 |
close_session()
|
247 |
close_session()
|
| - |
|
248 |
|
| - |
|
249 |
def batchOrders(self, warehouseId):
|
| - |
|
250 |
"""
|
| - |
|
251 |
Create a batch of all the pending orders for the given warehouse.
|
| - |
|
252 |
The returned list is orderd by created_timestamp.
|
| - |
|
253 |
If there are no pending orders, an empty list is returned.
|
| - |
|
254 |
|
| - |
|
255 |
Parameters:
|
| - |
|
256 |
- warehouseId
|
| - |
|
257 |
"""
|
| - |
|
258 |
try:
|
| - |
|
259 |
pending_orders = batch_orders(warehouseId)
|
| - |
|
260 |
return [to_t_order(order) for order in pending_orders]
|
| - |
|
261 |
finally:
|
| - |
|
262 |
close_session()
|
| 248 |
|
263 |
|
| 249 |
def markOrderAsOutOfStock(self, orderId):
|
264 |
def markOrderAsOutOfStock(self, orderId):
|
| 250 |
"""
|
265 |
"""
|
| 251 |
Mark the given order as out of stock. Throws an exception if the order with the given Id couldn't be found.
|
266 |
Mark the given order as out of stock. Throws an exception if the order with the given Id couldn't be found.
|
| 252 |
|
267 |
|