| Line 47... |
Line 47... |
| 47 |
get_all_vendor_item_pricing, get_state_master, update_snapdeal_stock_at_eod, \
|
47 |
get_all_vendor_item_pricing, get_state_master, update_snapdeal_stock_at_eod, \
|
| 48 |
update_flipkart_stock_at_eod, get_wanlc_for_source, \
|
48 |
update_flipkart_stock_at_eod, get_wanlc_for_source, \
|
| 49 |
get_all_available_amazon_inventory, _task_update_item_availability_cache, \
|
49 |
get_all_available_amazon_inventory, _task_update_item_availability_cache, \
|
| 50 |
add_vendor_item_pricing_in_bulk, add_inventory_in_bulk, \
|
50 |
add_vendor_item_pricing_in_bulk, add_inventory_in_bulk, \
|
| 51 |
get_item_pincode_availability, get_fofo_availability, \
|
51 |
get_item_pincode_availability, get_fofo_availability, \
|
| 52 |
get_fofo_fulfilment_warehouse_map
|
52 |
get_fofo_fulfilment_warehouse_map, get_item_availability_for_state
|
| 53 |
from shop2020.model.v1.inventory.impl.DataService import Warehouse, \
|
53 |
from shop2020.model.v1.inventory.impl.DataService import Warehouse, \
|
| 54 |
MissedInventoryUpdate, VendorItemMapping
|
54 |
MissedInventoryUpdate, VendorItemMapping
|
| 55 |
from shop2020.thriftpy.model.v1.inventory.ttypes import \
|
55 |
from shop2020.thriftpy.model.v1.inventory.ttypes import \
|
| 56 |
InventoryServiceException, WarehouseType, InventoryType, \
|
56 |
InventoryServiceException, WarehouseType, InventoryType, \
|
| 57 |
AvailableAndReservedStock
|
57 |
AvailableAndReservedStock
|
| Line 151... |
Line 151... |
| 151 |
inventory = get_item_inventory_by_item_id(item_id)
|
151 |
inventory = get_item_inventory_by_item_id(item_id)
|
| 152 |
return to_t_item_inventory(inventory, item_id)
|
152 |
return to_t_item_inventory(inventory, item_id)
|
| 153 |
finally:
|
153 |
finally:
|
| 154 |
close_session()
|
154 |
close_session()
|
| 155 |
|
155 |
|
| 156 |
def getItemAvailabilityAtLocation(self, itemId, sourceId):
|
156 |
def getItemAvailabilityAtLocation(self, itemId, sourceId, stateId):
|
| 157 |
"""
|
157 |
"""
|
| 158 |
Determines the warehouse that should be used to fulfil an order for the given item.
|
158 |
Determines the warehouse that should be used to fulfil an order for the given item.
|
| 159 |
It first checks all the warehouses which are in the logistics location given by the
|
159 |
It first checks all the warehouses which are in the logistics location given by the
|
| 160 |
warehouse_loc parameter. If none of the warehouses there have any inventory, then the
|
160 |
warehouse_loc parameter. If none of the warehouses there have any inventory, then the
|
| 161 |
preferred warehouse for the item is used.
|
161 |
preferred warehouse for the item is used.
|
| Line 167... |
Line 167... |
| 167 |
4. Expected delay added by the category manager.
|
167 |
4. Expected delay added by the category manager.
|
| 168 |
|
168 |
|
| 169 |
Parameters:
|
169 |
Parameters:
|
| 170 |
- itemId
|
170 |
- itemId
|
| 171 |
- sourceId
|
171 |
- sourceId
|
| - |
|
172 |
As of now stateId is used for partner purpose only and data have been bypassed.
|
| 172 |
"""
|
173 |
"""
|
| 173 |
try:
|
174 |
try:
|
| - |
|
175 |
if stateId == -1:
|
| 174 |
return get_item_availability_for_location(itemId, sourceId)
|
176 |
return get_item_availability_for_location(itemId, sourceId)
|
| - |
|
177 |
else:
|
| - |
|
178 |
return get_item_availability_for_state(itemId, sourceId, stateId)
|
| 175 |
finally:
|
179 |
finally:
|
| 176 |
close_session()
|
180 |
close_session()
|
| 177 |
|
181 |
|
| 178 |
def getItemAvailibilityAtWarehouse(self, warehouse_id, item_id):
|
182 |
def getItemAvailibilityAtWarehouse(self, warehouse_id, item_id):
|
| 179 |
"""
|
183 |
"""
|