Subversion Repositories SmartDukaan

Rev

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

Rev 122 Rev 379
Line 35... Line 35...
35
        return Item.query.filter_by(status=status).all()
35
        return Item.query.filter_by(status=status).all()
36
 
36
 
37
def get_Item(item_id):
37
def get_Item(item_id):
38
    return Item.get_by(id=item_id)
38
    return Item.get_by(id=item_id)
39
 
39
 
-
 
40
def get_item_by_catalog_id(catalog_id):
-
 
41
    return Item.get_by(catalog_item_id=catalog_id)
-
 
42
 
40
def get_Warehouse(warehouse_id):
43
def get_Warehouse(warehouse_id):
41
    return Warehouse.get_by(id=warehouse_id)
44
    return Warehouse.get_by(id=warehouse_id)
42
 
45
 
43
def get_all_warehouses_by_status(status):
46
def get_all_warehouses_by_status(status):
44
    if not status:
47
    if not status:
Line 197... Line 200...
197
    inventory = Item.get_by(id=item_id).currentInventory
200
    inventory = Item.get_by(id=item_id).currentInventory
198
    if not inventory:
201
    if not inventory:
199
        raise InventoryServiceException(108, "Some unforeseen error while updating inventory")
202
        raise InventoryServiceException(108, "Some unforeseen error while updating inventory")
200
    return inventory
203
    return inventory
201
 
204
 
-
 
205
def get_item_inventory(item_id):
-
 
206
    inventory = Item.get_by(catalog_item_id=item_id).currentInventory
-
 
207
    if not inventory:
-
 
208
        raise InventoryServiceException(108, "Some unforeseen error while updating inventory")
-
 
209
    return inventory
-
 
210
 
202
    
211
    
203
def retire_warehouse(warehouse_id):
212
def retire_warehouse(warehouse_id):
204
    if not warehouse_id:
213
    if not warehouse_id:
205
        raise InventoryServiceException(101, "Bad warehouse id")
214
        raise InventoryServiceException(101, "Bad warehouse id")
206
    warehouse = get_Warehouse(warehouse_id)
215
    warehouse = get_Warehouse(warehouse_id)