Class SkuInventoryEndpoint
java.lang.Object
com.broadleafcommerce.inventory.web.endpoint.SkuInventoryEndpoint
@FrameworkRestController
@FrameworkMapping("/sku-inventory")
@DataRouteByKey("inventory")
public class SkuInventoryEndpoint
extends Object
REST Endpoint to allow for the creation, selection, and read of
SkuInventory
data,
especially given an InventoryLocation
.- Author:
- Kelly Tisdell (ktisdell)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Necessary in scenarios where there may be too many SKU codes to pass through request parameters. -
Field Summary
-
Constructor Summary
ConstructorDescriptionSkuInventoryEndpoint
(SkuInventoryService<SkuInventory> skuInventoryService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, SkuInventorySummaryService<SkuInventoryAvailabilitySummary> skuInventorySummaryService) -
Method Summary
Modifier and TypeMethodDescriptioncreateSkuInventoryRecord
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, SkuInventory skuInventoryRecord) void
delete
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id) protected SkuInventoryService<SkuInventory>
protected com.broadleafcommerce.common.extension.TypeFactory
org.springframework.data.domain.Page<SkuInventory>
readAllSkuInventory
(String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) readConsolidatedAvailability
(jakarta.servlet.http.HttpServletRequest request, Set<String> skuCodes, int minimumQuantity, Boolean forShipping, Boolean forPickup, Boolean inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) readConsolidatedInventoryQuantities
(jakarta.servlet.http.HttpServletRequest request, SkuInventoryEndpoint.SkuCodesRequestBody skuCodesRequestBody, Boolean forShipping, Boolean forPickup, Boolean inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) readSkuInventoryByContextId
(jakarta.servlet.http.HttpServletRequest request, String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) updateSkuInventoryRecord
(jakarta.servlet.http.HttpServletRequest request, String skuInventoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, SkuInventory skuInventoryRecord)
-
Field Details
-
SKU_INVENTORY_URI
- See Also:
-
-
Constructor Details
-
SkuInventoryEndpoint
public SkuInventoryEndpoint(SkuInventoryService<SkuInventory> skuInventoryService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, SkuInventorySummaryService<SkuInventoryAvailabilitySummary> skuInventorySummaryService)
-
-
Method Details
-
readAllSkuInventory
@FrameworkGetMapping @Policy(permissionRoots="INVENTORY") public org.springframework.data.domain.Page<SkuInventory> readAllSkuInventory(@RequestParam(value="q",required=false) String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
readSkuInventoryByContextId
@FrameworkGetMapping("/{id}") @Policy(permissionRoots="INVENTORY") public SkuInventory readSkuInventoryByContextId(jakarta.servlet.http.HttpServletRequest request, @PathVariable("id") String id, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
delete
@FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="INVENTORY") public void delete(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id) -
createSkuInventoryRecord
@FrameworkPostMapping @Policy(permissionRoots="INVENTORY") public SkuInventory createSkuInventoryRecord(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody SkuInventory skuInventoryRecord) -
updateSkuInventoryRecord
@FrameworkPutMapping("/{id}") @Policy(permissionRoots="INVENTORY") public SkuInventory updateSkuInventoryRecord(jakarta.servlet.http.HttpServletRequest request, @PathVariable("id") String skuInventoryId, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody SkuInventory skuInventoryRecord) -
readConsolidatedAvailability
@FrameworkGetMapping("/availability-summary") @Policy(permissionRoots="CONSOLIDATED_INVENTORY_AVAILABILITY") public ConsolidatedInventoryResponse readConsolidatedAvailability(jakarta.servlet.http.HttpServletRequest request, @RequestParam("skuCodes") Set<String> skuCodes, @RequestParam(value="minimumQuantity",defaultValue="1") int minimumQuantity, @RequestParam(name="forShipping",defaultValue="true") Boolean forShipping, @RequestParam(name="forPickup",defaultValue="true") Boolean forPickup, @RequestParam(required=false,name="inStore") Boolean inStore, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
readConsolidatedInventoryQuantities
@FrameworkPostMapping("/available-quantities") @Policy(permissionRoots="CONSOLIDATED_INVENTORY_AVAILABILITY") public Map<String,Long> readConsolidatedInventoryQuantities(jakarta.servlet.http.HttpServletRequest request, @RequestBody SkuInventoryEndpoint.SkuCodesRequestBody skuCodesRequestBody, @RequestParam(name="forShipping",defaultValue="true") Boolean forShipping, @RequestParam(name="forPickup",defaultValue="true") Boolean forPickup, @RequestParam(required=false,name="inStore") Boolean inStore, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
getSkuInventoryService
-
getTypeFactory
@NonNull protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getSkuInventorySummaryService
@NonNull protected SkuInventorySummaryService<SkuInventoryAvailabilitySummary> getSkuInventorySummaryService()
-