net.sf.oness.inventory.model.facade
Interface InventoryFacadeDelegate

All Known Implementing Classes:
InventorySpringFacadeDelegate

public interface InventoryFacadeDelegate

Facade that models the service of inventory management

Version:
$Revision: 1.12 $
Author:
Carlos Sanchez

Method Summary
 Model createModel(Model model, java.lang.Long sizeGroupId, java.util.Collection colorIds)
          Create a model and a product for each size and color.
 void deleteModel(java.lang.Long id)
           
 Model editPrices(java.lang.Long modelId)
          Get a model for editing its prices
 Model findModel(java.lang.Long id)
          Find a model without its products nor sizes of its sizeGroup
 net.sf.oness.common.model.util.PaginatedList findModel(Model model, int firstElement, int maxElements)
          Find a model without products
 Model findModelWithDetails(java.lang.Long id)
          Find a model with all its products and sizes of its sizeGroup
 java.util.Map findProducts(java.util.Collection productIds)
          Find products by ids
 Product findProductWithDetails(java.lang.Long id)
          Find a product with all its stocks and prices
 java.util.List getAllColors()
          Get all colors
 java.util.List getAllFares()
          Get all fares
 java.util.List getAllSizeGroups()
          Get all size groups with its sizes
 java.util.List getAllWarehouses()
          Get all Warehouses
 Model updateModel(Model model)
           
 Model updatePrices(java.util.Map productPrices)
          Update the prices for some products.
 

Method Detail

createModel

public Model createModel(Model model,
                         java.lang.Long sizeGroupId,
                         java.util.Collection colorIds)
Create a model and a product for each size and color.

Parameters:
model -
sizeGroupId -
colorIds -
Returns:
The model created
Throws:
org.springframework.dao.DataAccessException

updateModel

public Model updateModel(Model model)
Parameters:
model -
Returns:
the model updated
Throws:
org.springframework.dao.DataAccessException

deleteModel

public void deleteModel(java.lang.Long id)
Parameters:
id -
Throws:
org.springframework.dao.DataRetrievalFailureException
org.springframework.dao.DataAccessException

findModel

public Model findModel(java.lang.Long id)
Find a model without its products nor sizes of its sizeGroup

Parameters:
id -
Returns:
the model
Throws:
org.springframework.dao.DataRetrievalFailureException
org.springframework.dao.DataAccessException

findModelWithDetails

public Model findModelWithDetails(java.lang.Long id)
Find a model with all its products and sizes of its sizeGroup

Parameters:
id -
Returns:
the model
Throws:
org.springframework.dao.DataRetrievalFailureException
org.springframework.dao.DataAccessException

findProductWithDetails

public Product findProductWithDetails(java.lang.Long id)
Find a product with all its stocks and prices

Parameters:
id -
Returns:
the product
Throws:
org.springframework.dao.DataRetrievalFailureException
org.springframework.dao.DataAccessException

findModel

public net.sf.oness.common.model.util.PaginatedList findModel(Model model,
                                                              int firstElement,
                                                              int maxElements)
Find a model without products

Parameters:
model -
firstElement -
maxElements -
Returns:
List of Model objects
Throws:
org.springframework.dao.DataAccessException

getAllSizeGroups

public java.util.List getAllSizeGroups()
Get all size groups with its sizes

Returns:
List of SizeGroup objects

getAllColors

public java.util.List getAllColors()
Get all colors

Returns:
List of Color objects

getAllWarehouses

public java.util.List getAllWarehouses()
Get all Warehouses

Returns:
List of Warehouse objects

getAllFares

public java.util.List getAllFares()
Get all fares

Returns:
List of Fare objects

editPrices

public Model editPrices(java.lang.Long modelId)
Get a model for editing its prices

Parameters:
modelId - id of the model
Returns:
the model with all products and prices
Throws:
org.springframework.dao.DataAccessException

updatePrices

public Model updatePrices(java.util.Map productPrices)
Update the prices for some products. Prices that already don't exist for a fare and product will be created, else they will be updated if the amount has been modified or deleted if amount is null. All products must be from the same model.

Parameters:
productPrices - Map with product ids as keys and a map (fare id, price amount as BigDecimal) as value.
Returns:
the model with prices updated
Throws:
org.springframework.dao.DataAccessException

findProducts

public java.util.Map findProducts(java.util.Collection productIds)
Find products by ids

Parameters:
productIds -
Returns:
Map with product ids as keys
Throws:
org.springframework.dao.DataAccessException


Copyright © 2003-2005 ONess Project. All Rights Reserved.