| Line 13... |
Line 13... |
| 13 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as TTransaction,\
|
13 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as TTransaction,\
|
| 14 |
TransactionStatus as TTransactionStatus, Order as TOrder, LineItem as TLineItem, OrderStatus
|
14 |
TransactionStatus as TTransactionStatus, Order as TOrder, LineItem as TLineItem, OrderStatus
|
| 15 |
|
15 |
|
| 16 |
from shop2020.thriftpy.model.v1.catalog.ttypes import Item as TItem
|
16 |
from shop2020.thriftpy.model.v1.catalog.ttypes import Item as TItem
|
| 17 |
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo as TLogisticsInfo,\
|
17 |
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo as TLogisticsInfo,\
|
| 18 |
LogisticsServiceException
|
18 |
LogisticsServiceException, DeliveryType
|
| 19 |
|
19 |
|
| 20 |
from shop2020.clients.TransactionClient import TransactionClient
|
20 |
from shop2020.clients.TransactionClient import TransactionClient
|
| 21 |
from shop2020.clients.CatalogClient import CatalogClient
|
21 |
from shop2020.clients.CatalogClient import CatalogClient
|
| 22 |
from shop2020.clients.LogisticsClient import LogisticsClient
|
22 |
from shop2020.clients.LogisticsClient import LogisticsClient
|
| 23 |
from shop2020.model.v1 import user
|
23 |
from shop2020.model.v1 import user
|
| Line 400... |
Line 400... |
| 400 |
retval = "Try adding a smaller quantity of " + item.brand + " " + item.modelNumber + " (" + item.color + ")"
|
400 |
retval = "Try adding a smaller quantity of " + item.brand + " " + item.modelNumber + " (" + item.color + ")"
|
| 401 |
|
401 |
|
| 402 |
line.actual_price = item.sellingPrice
|
402 |
line.actual_price = item.sellingPrice
|
| 403 |
cart.total_price = cart.total_price + (line.actual_price * line.quantity)
|
403 |
cart.total_price = cart.total_price + (line.actual_price * line.quantity)
|
| 404 |
try:
|
404 |
try:
|
| 405 |
item_delivery_estimate = logistics_client.getLogisticsEstimation(item_id, customer_pincode).deliveryTime
|
405 |
item_delivery_estimate = logistics_client.getLogisticsEstimation(item_id, customer_pincode, DeliveryType.PREPAID).deliveryTime
|
| 406 |
except LogisticsServiceException:
|
406 |
except LogisticsServiceException:
|
| 407 |
item_delivery_estimate = -1
|
407 |
item_delivery_estimate = -1
|
| 408 |
#TODO Use the exception clause to set the retval appropriately
|
408 |
#TODO Use the exception clause to set the retval appropriately
|
| 409 |
except :
|
409 |
except :
|
| 410 |
item_delivery_estimate = -1
|
410 |
item_delivery_estimate = -1
|