@Path(value="shops/{shopId}/sales")
@RolesAllowed(value="orders_read")
public class SaleResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
CREATED_AFTER |
(package private) static java.lang.String |
CREATED_BEFORE |
private ShopRequestContext.Builder |
ctxBuilder |
private SalesDao |
saleDao |
private SaleService |
service |
Constructor and Description |
---|
SaleResource(java.lang.String shopId,
ShopRequestContextService shopService,
SalesDao saleDao,
SaleService service) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
getSalesForProduct(SalesSummaryDateRange dateRange,
GUID productId)
A Sale is the sum of before tax amount of the line-item container of all
non-cancelled order within the time range
|
static final java.lang.String CREATED_BEFORE
static final java.lang.String CREATED_AFTER
private final ShopRequestContext.Builder ctxBuilder
private final SaleService service
private SalesDao saleDao
@Inject public SaleResource(@PathParam(value="shopId") java.lang.String shopId, ShopRequestContextService shopService, SalesDao saleDao, SaleService service)
@GET @Produces(value="application/vnd.epages.v1+json, application/json") public javax.ws.rs.core.Response getSalesForProduct(@BeanParam SalesSummaryDateRange dateRange, @QueryParam(value="productId") GUID productId)
dateRange
- date range max 1 year