Subversion Repositories SmartDukaan

Rev

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

Rev 7438 Rev 7460
Line 39... Line 39...
39
    update_insurance_declared_amount, get_freebie_for_item, \
39
    update_insurance_declared_amount, get_freebie_for_item, \
40
    add_or_update_freebie_for_item, get_all_amazon_listed_items, get_store_pricing, \
40
    add_or_update_freebie_for_item, get_all_amazon_listed_items, get_store_pricing, \
41
    update_store_pricing, get_amazon_item_details, update_amazon_item_details, \
41
    update_store_pricing, get_amazon_item_details, update_amazon_item_details, \
42
    add_amazon_item, get_asin_items, get_all_fba_listed_items, \
42
    add_amazon_item, get_asin_items, get_all_fba_listed_items, \
43
    get_all_nonfba_listed_items, add_or_update_brand_info, get_brand_info, \
43
    get_all_nonfba_listed_items, add_or_update_brand_info, get_brand_info, \
44
    get_items_status
44
    get_items_status, update_item_inventory
45
from shop2020.thriftpy.model.v1.catalog.ttypes import status
45
from shop2020.thriftpy.model.v1.catalog.ttypes import status
46
from shop2020.utils.Utils import log_entry, to_py_date
46
from shop2020.utils.Utils import log_entry, to_py_date
47
import datetime
47
import datetime
48
 
48
 
49
class CatalogServiceHandler:
49
class CatalogServiceHandler:
Line 1133... Line 1133...
1133
                amazonlisteditems.append(to_t_Amazonlisted(amazonlisteditem))
1133
                amazonlisteditems.append(to_t_Amazonlisted(amazonlisteditem))
1134
            return amazonlisteditems
1134
            return amazonlisteditems
1135
        finally:
1135
        finally:
1136
            close_session()             
1136
            close_session()             
1137
            
1137
            
-
 
1138
    def updateItemInventory(self,itemId,holdInventory,defaultInventory):
-
 
1139
        try:
-
 
1140
            update_item_inventory(itemId,holdInventory,defaultInventory)
-
 
1141
            return True
-
 
1142
        finally:
-
 
1143
            close_session()
1138
            
1144
            
1139
def is_valid(item):
1145
def is_valid(item):
1140
    if item.status in [status.ACTIVE, status.PAUSED, status.PAUSED_BY_RISK]:
1146
    if item.status in [status.ACTIVE, status.PAUSED, status.PAUSED_BY_RISK]:
1141
        if item.startDate:
1147
        if item.startDate:
1142
            return not(datetime.datetime.now() < item.startDate or item.sellingPrice == 0)
1148
            return not(datetime.datetime.now() < item.startDate or item.sellingPrice == 0)