Subversion Repositories SmartDukaan

Rev

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

Rev 10097 Rev 10126
Line 34... Line 34...
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, add_or_update_flipkart_inventory_snapshot, \
38
    get_held_inventory_map_for_item, get_hold_inventory_details, add_or_update_flipkart_inventory_snapshot, \
39
    get_flipkart_inventory_snapshot, get_flipkart_inventory_for_Item
39
    get_flipkart_inventory_snapshot, get_flipkart_inventory_for_Item, get_oos_statuses_for_x_days, \
-
 
40
    get_all_vendor_item_pricing
40
    
41
    
41
from shop2020.model.v1.inventory.impl.DataService import Warehouse, \
42
from shop2020.model.v1.inventory.impl.DataService import Warehouse, \
42
    MissedInventoryUpdate, VendorItemMapping
43
    MissedInventoryUpdate, VendorItemMapping
43
from shop2020.thriftpy.model.v1.inventory.ttypes import \
44
from shop2020.thriftpy.model.v1.inventory.ttypes import \
44
    InventoryServiceException, WarehouseType, InventoryType, \
45
    InventoryServiceException, WarehouseType, InventoryType, \
Line 323... Line 324...
323
        """
324
        """
324
        try:
325
        try:
325
            return [to_t_vendor_item_pricing(vid) for vid in get_all_item_pricing(itemId)]
326
            return [to_t_vendor_item_pricing(vid) for vid in get_all_item_pricing(itemId)]
326
        finally:
327
        finally:
327
            close_session()
328
            close_session()
-
 
329
            
-
 
330
    def getAllVendorItemPricing(self, itemId, vendorId):
-
 
331
        """
-
 
332
        Returns list of all stored pricing information for given itemId and vendorId.
-
 
333
        
-
 
334
        Parameters:
-
 
335
         - itemId
-
 
336
         - vendorId
-
 
337
        """
-
 
338
        try:
-
 
339
            return [to_t_vendor_item_pricing(vid) for vid in get_all_vendor_item_pricing(itemId, vendorId)]
-
 
340
        finally:
-
 
341
            close_session()
328
 
342
 
329
    def addVendorItemPricing(self, vendorItemPricing):
343
    def addVendorItemPricing(self, vendorItemPricing):
330
        """
344
        """
331
        Adds vendor prices corresponding to the item. If pricing already exists then updates the prices. 
345
        Adds vendor prices corresponding to the item. If pricing already exists then updates the prices. 
332
        Raises an exception if either the item or vendor can't be found corresponding to their ids.
346
        Raises an exception if either the item or vendor can't be found corresponding to their ids.
Line 693... Line 707...
693
        try:
707
        try:
694
            return [to_t_oos_status(oos) for oos in get_oos_statuses_for_x_days_for_item(itemId, sourceId, days)]
708
            return [to_t_oos_status(oos) for oos in get_oos_statuses_for_x_days_for_item(itemId, sourceId, days)]
695
        finally:
709
        finally:
696
            close_session()
710
            close_session()
697
            
711
            
-
 
712
    def getOosStatusesForXDays(self, sourceId, days):
-
 
713
        """
-
 
714
        Get OOSStatus Objects for "days" number of days and sourceId for source. If sourceId is zero return for all sources.
-
 
715
        """
-
 
716
        try:
-
 
717
            return [to_t_oos_status(oos) for oos in get_oos_statuses_for_x_days(sourceId, days)]
-
 
718
        finally:
-
 
719
            close_session()
-
 
720
        
698
    def getNonZeroItemStockPurchaseParams(self):
721
    def getNonZeroItemStockPurchaseParams(self):
699
        """
722
        """
700
        Get All ItemStockPurchaseParam objects where either minStockLevel or minNumOfDaysOfStock is zero 
723
        Get All ItemStockPurchaseParam objects where either minStockLevel or minNumOfDaysOfStock is zero 
701
        """
724
        """
702
        try:
725
        try: