public interface SaleFacade
| Modifier and Type | Method and Description |
|---|---|
Sale |
addSale(long ean,
Date date,
int sold)
Adds one sale
|
List<Sale> |
getAllSales()
Get all sales
|
List<Sale> |
getSalesForCategory(Category category,
Date from,
Date to)
Get all sales for given category from given period of time
|
List<Sale> |
getSalesForProduct(Item item,
Date from,
Date to)
Get all sales for given item from given period of time
|
Sale |
storeSaleInDb(Sale s)
Store sale in db.
|
Sale addSale(long ean, Date date, int sold) throws EntityDoesNotExistException, NotEnoughStoredException
ean - EAN of itemdate - date of salesold - items soldEntityDoesNotExistException - if item with this EAN doesn't existNotEnoughStoredException - if there is not enough items of this item storedSale storeSaleInDb(Sale s) throws ServiceException
s - sale to storeServiceException - if sale is invalid or some error occursList<Sale> getSalesForCategory(Category category, Date from, Date to) throws IllegalArgumentException
category - categoryfrom - minimum date for salesto - maximum date for salesIllegalArgumentException - if category is nullList<Sale> getSalesForProduct(Item item, Date from, Date to) throws IllegalArgumentException
item - itemfrom - minimum date for salesto - maximum date for salesIllegalArgumentException - item is nullCopyright © 2017 Pivotal Software, Inc.. All rights reserved.