Subversion Repositories SmartDukaan

Rev

Rev 9761 | Rev 10097 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9761 Rev 10050
Line 7... Line 7...
7
from shop2020.model.v1.inventory.impl import DataService
7
from shop2020.model.v1.inventory.impl import DataService
8
from shop2020.model.v1.inventory.impl.Convertors import to_t_item_inventory, \
8
from shop2020.model.v1.inventory.impl.Convertors import to_t_item_inventory, \
9
    to_t_warehouse, to_t_vendor_item_pricing, to_t_vendor, to_t_vendor_item_mapping, \
9
    to_t_warehouse, to_t_vendor_item_pricing, to_t_vendor, to_t_vendor_item_mapping, \
10
    to_t_item_stock_purchase_params, to_t_oos_status, to_t_amazon_inventory_snapshot, \
10
    to_t_item_stock_purchase_params, to_t_oos_status, to_t_amazon_inventory_snapshot, \
11
    to_t_amazon_fba_inventory_snapshot,to_t_snapdeal_inventory_snapshot,\
11
    to_t_amazon_fba_inventory_snapshot,to_t_snapdeal_inventory_snapshot,\
12
    to_t_hold_inventory_detail
12
    to_t_hold_inventory_detail, to_t_flipkart_inventory_snapshot
13
from shop2020.model.v1.inventory.impl.DataAcessors import add_warehouse, \
13
from shop2020.model.v1.inventory.impl.DataAcessors import add_warehouse, \
14
    update_inventory, retire_warehouse, get_item_availability_for_warehouse, \
14
    update_inventory, retire_warehouse, get_item_availability_for_warehouse, \
15
    get_item_availability_for_location, get_all_warehouses_by_status, get_Warehouse, \
15
    get_item_availability_for_location, get_all_warehouses_by_status, get_Warehouse, \
16
    get_all_items_for_warehouse, close_session, add_vendor, \
16
    get_all_items_for_warehouse, close_session, add_vendor, \
17
    get_item_inventory_by_item_id, reserve_item_in_warehouse, \
17
    get_item_inventory_by_item_id, reserve_item_in_warehouse, \
Line 33... Line 33...
33
    add_or_update_amazon_inventory_for_item, update_reservation_for_order, \
33
    add_or_update_amazon_inventory_for_item, update_reservation_for_order, \
34
    get_last_n_day_sale_for_item, add_or_update_amazon_fba_inventory, add_update_hold_inventory,\
34
    get_last_n_day_sale_for_item, add_or_update_amazon_fba_inventory, add_update_hold_inventory,\
35
    get_amazon_fba_inventory,get_all_amazon_fba_inventory, get_oursgood_warehouseids_for_location, \
35
    get_amazon_fba_inventory,get_all_amazon_fba_inventory, get_oursgood_warehouseids_for_location, \
36
    get_holdinventorydetail_forItem_forWarehouseId_exceptsource, get_snapdeal_inventory_for_item, \
36
    get_holdinventorydetail_forItem_forWarehouseId_exceptsource, get_snapdeal_inventory_for_item, \
37
    add_or_update_snapdeal_inventor_for_item, get_nlc_for_warehouse,get_snapdeal_inventory_snapshot, \
37
    add_or_update_snapdeal_inventor_for_item, get_nlc_for_warehouse,get_snapdeal_inventory_snapshot, \
38
    get_held_inventory_map_for_item, get_hold_inventory_details
38
    get_held_inventory_map_for_item, get_hold_inventory_details, add_or_update_flipkart_inventory_snapshot, \
-
 
39
    get_flipkart_inventory_snapshot
39
    
40
    
40
from shop2020.model.v1.inventory.impl.DataService import Warehouse, \
41
from shop2020.model.v1.inventory.impl.DataService import Warehouse, \
41
    MissedInventoryUpdate, VendorItemMapping
42
    MissedInventoryUpdate, VendorItemMapping
42
from shop2020.thriftpy.model.v1.inventory.ttypes import \
43
from shop2020.thriftpy.model.v1.inventory.ttypes import \
43
    InventoryServiceException, WarehouseType, InventoryType, \
44
    InventoryServiceException, WarehouseType, InventoryType, \
Line 852... Line 853...
852
    def getHoldInventoryDetails(self, itemId, warehouseId, source):
853
    def getHoldInventoryDetails(self, itemId, warehouseId, source):
853
        try:
854
        try:
854
            return [to_t_hold_inventory_detail(holdInventoryDetail) for holdInventoryDetail in get_hold_inventory_details(itemId, warehouseId, source)]
855
            return [to_t_hold_inventory_detail(holdInventoryDetail) for holdInventoryDetail in get_hold_inventory_details(itemId, warehouseId, source)]
855
        finally:
856
        finally:
856
            close_session()
857
            close_session()
-
 
858
            
-
 
859
    def addOrUpdateFlipkartInventorySnapshot(self,flipkartInventorySnapshot):
-
 
860
        try:
-
 
861
            add_or_update_flipkart_inventory_snapshot(flipkartInventorySnapshot)
-
 
862
        finally:
-
 
863
            close_session()    
-
 
864
    
-
 
865
    
-
 
866
    def getFlipkartInventorySnapshot(self):
-
 
867
        try:
-
 
868
            return [to_t_flipkart_inventory_snapshot(snapshot) for snapshot in get_flipkart_inventory_snapshot()]
-
 
869
        finally:
-
 
870
            close_session()
857
        
871
        
858
                    
872
                    
859
873