Class InventoryLocationEndpoint

java.lang.Object
com.broadleafcommerce.inventory.web.endpoint.InventoryLocationEndpoint

@FrameworkRestController @FrameworkMapping("/inventory-location") @DataRouteByKey("inventory") public class InventoryLocationEndpoint extends Object
REST Endpoint for retrieving and persisting InventoryLocations.
Author:
Kelly Tisdell (ktisdell)
  • Field Details

  • Constructor Details

  • Method Details

    • readAllLocations

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping public org.springframework.data.domain.Page<InventoryLocation> readAllLocations(@RequestParam(value="q",required=false) String nameOrNumberQuery, 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)
    • readInventoryLocationByContextId

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/{id}") public InventoryLocation readInventoryLocationByContextId(@PathVariable("id") String id, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads an InventoryLocation by context ID.
      Parameters:
      id -
      context -
      Returns:
    • readInventoryLocationByLocationNumber

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/location-number/{inventoryLocationNumber}") public Optional<InventoryLocation> readInventoryLocationByLocationNumber(@PathVariable("inventoryLocationNumber") String inventoryLocationNumber, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads an InventoryLocation by an arbitrary location number. This is typically a store number, warehouse ID, or other external reference number.
      Parameters:
      inventoryLocationNumber -
      context -
      Returns:
    • readInventoryLocationsByPostalCode

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/all-locations/country-code/{countryCode}/postal-code/{postalCode}") public org.springframework.data.domain.Page<InventoryLocation> readInventoryLocationsByPostalCode(@PathVariable("countryCode") String countryCode, @PathVariable("postalCode") String postalCode, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references within a given country and for a given postal code.
      Parameters:
      countryCode -
      postalCode -
      page -
      context -
      Returns:
    • readShippingLocationsByPostalCode

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/shipping-locations/country-code/{countryCode}/postal-code/{postalCode}") public org.springframework.data.domain.Page<InventoryLocation> readShippingLocationsByPostalCode(@PathVariable("countryCode") String countryCode, @PathVariable("postalCode") String postalCode, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references that are flagged as shipping locations within a given country and for a given postal code.
      Parameters:
      countryCode -
      postalCode -
      page -
      context -
      Returns:
    • readPickupLocationsByPostalCode

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/pickup-locations/country-code/{countryCode}/postal-code/{postalCode}") public org.springframework.data.domain.Page<InventoryLocation> readPickupLocationsByPostalCode(@PathVariable("countryCode") String countryCode, @PathVariable("postalCode") String postalCode, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references that are flagged as pickup locations within a given country and for a given postal code.
      Parameters:
      countryCode -
      postalCode -
      page -
      context -
      Returns:
    • readStoreLocationsByPostalCode

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/store-locations/country-code/{countryCode}/postal-code/{postalCode}") public org.springframework.data.domain.Page<InventoryLocation> readStoreLocationsByPostalCode(@PathVariable("countryCode") String countryCode, @PathVariable("postalCode") String postalCode, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references that are flagged as "Store" locations within a given country and for a given postal code.
      Parameters:
      countryCode -
      postalCode -
      page -
      context -
      Returns:
    • readInventoryLocationsByStateProvinceRegion

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/all-locations/country-code/{countryCode}/region-code/{stateProvinceRegionCode}") public org.springframework.data.domain.Page<InventoryLocation> readInventoryLocationsByStateProvinceRegion(@PathVariable("countryCode") String countryCode, @PathVariable("stateProvinceRegionCode") String stateProvinceRegionCode, @RequestParam(value="city",required=false) String city, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references within a given country and for a given state or province or region, based on region code.
      Parameters:
      countryCode -
      stateProvinceRegionCode -
      city -
      page -
      context -
      Returns:
    • readShippingLocationsByStateProvinceRegion

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/shipping-locations/country-code/{countryCode}/region-code/{stateProvinceRegionCode}") public org.springframework.data.domain.Page<InventoryLocation> readShippingLocationsByStateProvinceRegion(@PathVariable("countryCode") String countryCode, @PathVariable("stateProvinceRegionCode") String stateProvinceRegionCode, @RequestParam(value="city",required=false) String city, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references that are flagged as shipping locations within a given country and for a given state or province or region, based on region code.
      Parameters:
      countryCode -
      stateProvinceRegionCode -
      city -
      page -
      context -
      Returns:
    • readPickupLocationsByStateProvinceRegion

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/pickup-locations/country-code/{countryCode}/region-code/{stateProvinceRegionCode}") public org.springframework.data.domain.Page<InventoryLocation> readPickupLocationsByStateProvinceRegion(@PathVariable("countryCode") String countryCode, @PathVariable("stateProvinceRegionCode") String stateProvinceRegionCode, @RequestParam(value="city",required=false) String city, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references that are flagged as pickup locations within a given country and for a given state or province or region, based on region code.
      Parameters:
      countryCode -
      stateProvinceRegionCode -
      city -
      page -
      context -
      Returns:
    • readStoreLocationsByStateProvinceRegion

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/store-locations/country-code/{countryCode}/region-code/{stateProvinceRegionCode}") public org.springframework.data.domain.Page<InventoryLocation> readStoreLocationsByStateProvinceRegion(@PathVariable("countryCode") String countryCode, @PathVariable("stateProvinceRegionCode") String stateProvinceRegionCode, @RequestParam(value="city",required=false) String city, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references that are flagged as pickup locations within a given country and for a given state or province or region, based on region code.
      Parameters:
      countryCode -
      stateProvinceRegionCode -
      city -
      page -
      context -
      Returns:
    • readInventoryLocationsByCoordinates

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/all-locations/within-area") public org.springframework.data.domain.Page<InventoryLocation> readInventoryLocationsByCoordinates(@RequestParam("latitude") Double latitude, @RequestParam("longitude") Double longitude, @RequestParam("radius") Double radius, @RequestParam(value="distanceType",defaultValue="KILOMETERS") DistanceType distanceType, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references within a given area, within the radius of a point identified by latitude and longitude coordinates.
      Parameters:
      latitude -
      longitude -
      radius -
      distanceType -
      page -
      context -
      Returns:
    • readPickupLocationsByCoordinates

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/pickup-locations/within-area") public org.springframework.data.domain.Page<InventoryLocation> readPickupLocationsByCoordinates(@RequestParam("latitude") Double latitude, @RequestParam("longitude") Double longitude, @RequestParam("radius") Double radius, @RequestParam(value="distanceType",defaultValue="KILOMETERS") DistanceType distanceType, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references that allow pickup within a given area, within the radius of a point identified by latitude and longitude coordinates.
      Parameters:
      latitude -
      longitude -
      radius -
      distanceType -
      page -
      context -
      Returns:
    • readShippingLocationsByCoordinates

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/shipping-locations/within-area") public org.springframework.data.domain.Page<InventoryLocation> readShippingLocationsByCoordinates(@RequestParam("latitude") Double latitude, @RequestParam("longitude") Double longitude, @RequestParam("radius") Double radius, @RequestParam(value="distanceType",defaultValue="KILOMETERS") DistanceType distanceType, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references that allow shipping within a given area, within the radius of a point identified by latitude and longitude coordinates.
      Parameters:
      latitude -
      longitude -
      radius -
      distanceType -
      page -
      context -
      Returns:
    • readStoreLocationsByCoordinates

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkGetMapping("/store-locations/within-area") public org.springframework.data.domain.Page<InventoryLocation> readStoreLocationsByCoordinates(@RequestParam("latitude") Double latitude, @RequestParam("longitude") Double longitude, @RequestParam("radius") Double radius, @RequestParam(value="distanceType",defaultValue="KILOMETERS") DistanceType distanceType, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all InventoryLocation references that allow shipping within a given area, within the radius of a point identified by latitude and longitude coordinates.
      Parameters:
      latitude -
      longitude -
      radius -
      distanceType -
      page -
      context -
      Returns:
    • createNewInventoryLocation

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkPostMapping(consumes="application/json") public InventoryLocation createNewInventoryLocation(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody InventoryLocation inventoryLocation)
      Creates a brand new InventoryLocation.
      Parameters:
      context -
      inventoryLocation -
      Returns:
    • replaceInventoryLocation

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkPutMapping(value="/{id}", consumes="application/json") public InventoryLocation replaceInventoryLocation(@PathVariable("id") String id, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody InventoryLocation inventoryLocation)
      Replaces an existing InventoryLocation.
      Parameters:
      id -
      context -
      inventoryLocation -
      Returns:
    • deleteInventoryLocation

      @Policy(permissionRoots="INVENTORY_LOCATION") @FrameworkDeleteMapping("/{id}") public void deleteInventoryLocation(@ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id)
      Deletes or archives an existing InventoryLocation.
      Parameters:
      context -
      id -
    • readAllSkuInventoryByInventoryLocationId

      @FrameworkGetMapping("/{id}/sku-inventory") @Policy(permissionRoots="INVENTORY") public org.springframework.data.domain.Page<SkuInventory> readAllSkuInventoryByInventoryLocationId(@PathVariable("id") String inventoryLocationId, 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)
    • createSkuInventoryRecord

      @FrameworkPostMapping("/{id}/sku-inventory") @Policy(permissionRoots="INVENTORY") public SkuInventory createSkuInventoryRecord(jakarta.servlet.http.HttpServletRequest request, @PathVariable("id") String inventoryLocationId, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody SkuInventory skuInventoryRecord)
    • updateSkuInventoryRecord

      @FrameworkPatchMapping("/{id}/sku-inventory/{skuInventoryId}") @Policy(permissionRoots="INVENTORY") public SkuInventory updateSkuInventoryRecord(jakarta.servlet.http.HttpServletRequest request, @PathVariable("id") String inventoryLocationId, @PathVariable("skuInventoryId") String skuInventoryId, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody SkuInventory skuInventoryRecord)
    • replaceSkuInventoryRecord

      @FrameworkPutMapping("/{id}/sku-inventory/{skuInventoryId}") @Policy(permissionRoots="INVENTORY") public SkuInventory replaceSkuInventoryRecord(jakarta.servlet.http.HttpServletRequest request, @PathVariable("id") String inventoryLocationId, @PathVariable("skuInventoryId") String skuInventoryId, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody SkuInventory skuInventoryRecord)
    • deleteSkuInventory

      @FrameworkDeleteMapping("/{id}/sku-inventory/{skuInventoryId}") @Policy(permissionRoots="INVENTORY") public void deleteSkuInventory(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String inventoryLocationId, @PathVariable("skuInventoryId") String skuInventoryId)
    • replaceInventoryLocationTranslations

      @FrameworkPutMapping(value="/{id}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="INVENTORY_LOCATION") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceInventoryLocationTranslations(@RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest, @PathVariable("id") String id, @PathVariable("locale") Locale locale, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • getInventoryLocationService

      @NonNull protected InventoryLocationService<InventoryLocation> getInventoryLocationService()
    • getSkuInventoryService

      @NonNull protected SkuInventoryService<SkuInventory> getSkuInventoryService()
    • getTranslationEntityService

      protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService()