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 persistingInventoryLocation
s.- Author:
- Kelly Tisdell (ktisdell)
-
-
Field Summary
Fields Modifier and Type Field Description static String
INVENTORY_LOCATION_URI
-
Constructor Summary
Constructors Constructor Description InventoryLocationEndpoint(InventoryLocationService<InventoryLocation> inventoryLocationService, SkuInventoryService<SkuInventory> skuInventoryService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InventoryLocation
createNewInventoryLocation(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, InventoryLocation inventoryLocation)
Creates a brand newInventoryLocation
.SkuInventory
createSkuInventoryRecord(javax.servlet.http.HttpServletRequest request, String inventoryLocationId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, SkuInventory skuInventoryRecord)
void
deleteInventoryLocation(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id)
Deletes or archives an existingInventoryLocation
.void
deleteSkuInventory(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String inventoryLocationId, String skuInventoryId)
protected InventoryLocationService<InventoryLocation>
getInventoryLocationService()
protected SkuInventoryService<SkuInventory>
getSkuInventoryService()
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
getTranslationEntityService()
org.springframework.data.domain.Page<InventoryLocation>
readAllLocations(String nameOrNumberQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
org.springframework.data.domain.Page<SkuInventory>
readAllSkuInventoryByInventoryLocationId(String inventoryLocationId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
InventoryLocation
readInventoryLocationByContextId(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads anInventoryLocation
by context ID.Optional<InventoryLocation>
readInventoryLocationByLocationNumber(String inventoryLocationNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads anInventoryLocation
by an arbitrary location number.org.springframework.data.domain.Page<InventoryLocation>
readInventoryLocationsByCoordinates(Double latitude, Double longitude, Double radius, DistanceType distanceType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references within a given area, within the radius of a point identified by latitude and longitude coordinates.org.springframework.data.domain.Page<InventoryLocation>
readInventoryLocationsByPostalCode(String countryCode, String postalCode, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references within a given country and for a given postal code.org.springframework.data.domain.Page<InventoryLocation>
readInventoryLocationsByStateProvinceRegion(String countryCode, String stateProvinceRegionCode, String city, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references within a given country and for a given state or province or region, based on region code.org.springframework.data.domain.Page<InventoryLocation>
readPickupLocationsByCoordinates(Double latitude, Double longitude, Double radius, DistanceType distanceType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references that allow pickup within a given area, within the radius of a point identified by latitude and longitude coordinates.org.springframework.data.domain.Page<InventoryLocation>
readPickupLocationsByPostalCode(String countryCode, String postalCode, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references that are flagged as pickup locations within a given country and for a given postal code.org.springframework.data.domain.Page<InventoryLocation>
readPickupLocationsByStateProvinceRegion(String countryCode, String stateProvinceRegionCode, String city, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references that are flagged as pickup locations within a given country and for a given state or province or region, based on region code.org.springframework.data.domain.Page<InventoryLocation>
readShippingLocationsByCoordinates(Double latitude, Double longitude, Double radius, DistanceType distanceType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references that allow shipping within a given area, within the radius of a point identified by latitude and longitude coordinates.org.springframework.data.domain.Page<InventoryLocation>
readShippingLocationsByPostalCode(String countryCode, String postalCode, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references that are flagged as shipping locations within a given country and for a given postal code.org.springframework.data.domain.Page<InventoryLocation>
readShippingLocationsByStateProvinceRegion(String countryCode, String stateProvinceRegionCode, String city, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references that are flagged as shipping locations within a given country and for a given state or province or region, based on region code.org.springframework.data.domain.Page<InventoryLocation>
readStoreLocationsByCoordinates(Double latitude, Double longitude, Double radius, DistanceType distanceType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references that allow shipping within a given area, within the radius of a point identified by latitude and longitude coordinates.org.springframework.data.domain.Page<InventoryLocation>
readStoreLocationsByPostalCode(String countryCode, String postalCode, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references that are flagged as "Store" locations within a given country and for a given postal code.org.springframework.data.domain.Page<InventoryLocation>
readStoreLocationsByStateProvinceRegion(String countryCode, String stateProvinceRegionCode, String city, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads allInventoryLocation
references that are flagged as pickup locations within a given country and for a given state or province or region, based on region code.InventoryLocation
replaceInventoryLocation(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, InventoryLocation inventoryLocation)
Replaces an existingInventoryLocation
.com.broadleafcommerce.translation.service.dto.TranslationsPayload
replaceInventoryLocationTranslations(com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest, String id, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
SkuInventory
replaceSkuInventoryRecord(javax.servlet.http.HttpServletRequest request, String inventoryLocationId, String skuInventoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, SkuInventory skuInventoryRecord)
SkuInventory
updateSkuInventoryRecord(javax.servlet.http.HttpServletRequest request, String inventoryLocationId, String skuInventoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, SkuInventory skuInventoryRecord)
-
-
-
Field Detail
-
INVENTORY_LOCATION_URI
public static final String INVENTORY_LOCATION_URI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InventoryLocationEndpoint
public InventoryLocationEndpoint(InventoryLocationService<InventoryLocation> inventoryLocationService, SkuInventoryService<SkuInventory> skuInventoryService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
-
-
Method Detail
-
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 anInventoryLocation
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 anInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 allInventoryLocation
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 newInventoryLocation
.- 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 existingInventoryLocation
.- 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 existingInventoryLocation
.- 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(javax.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(javax.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(javax.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(javax.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()
-
-