Class TransportCartsController
java.lang.Object
de.hybris.platform.coretravelcommonsocc.controllers.TravelBaseController
de.hybris.platform.coretransportocc.controllers.TransportCartsController
@Controller
@RequestMapping("/{baseSiteId}/users/{userId}/carts/{cartId}")
public class TransportCartsController
extends TravelBaseController
Web Service Transport Carts Controller for services related to the cart.
-
Field Summary
Fields inherited from class de.hybris.platform.coretravelcommonsocc.controllers.TravelBaseController
BASIC_FIELD_SET, DEFAULT_CURRENT_PAGE, DEFAULT_PAGE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntityaddAncillaryToCart(String salesApplication, AncillaryEntryRequest ancillaryEntryRQ, javax.servlet.http.HttpServletRequest httpServletRequest) org.springframework.http.ResponseEntityaddSeatsToCart(String salesApplication, SeatEntryRequest seatEntryRQ, javax.servlet.http.HttpServletRequest httpServletRequest) org.springframework.http.ResponseEntityaddTransportBundleToCart(String salesApplication, AddBoundToCartRequest addBundleToCart, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) Add a transport bundle to the cart.org.springframework.http.ResponseEntityaddTravellersToCart(TravellerQuantityList travellerQuantityList) Add travellers to the given cart.protected voidfilterOfferRequestByTransportOfferingCodes(List<String> transportOfferingCodes, OfferRequestData offersRequest) Filter offer request by removing transport offerings that doesn't contain in transportOfferingCodes.org.springframework.http.ResponseEntitygetAncillaryEntry(Integer entryId) org.springframework.http.ResponseEntity<AncillaryResponse>getAvailableAncillaries(String salesApplication, List<String> transportOfferingCodes) Search ancillary productsorg.springframework.http.ResponseEntitygetSeatEntry(Integer entryId) org.springframework.http.ResponseEntity<SeatMapResponse>getSeatMap(String salesApplication, List<String> transportOfferingCodes) Gets seat map.org.springframework.http.ResponseEntitygetTraveller(String travellerId) org.springframework.http.ResponseEntityorg.springframework.http.ResponseEntityremoveAncillaryCartEntry(Integer entryId) Performs the deletes ancillary entry.org.springframework.http.ResponseEntityremoveBoundFromCart(String salesApplication, String boundId) Remove a bound from cart.org.springframework.http.ResponseEntityremoveSeatEntry(Integer entryId) Remove seat entry response entity.org.springframework.http.ResponseEntityremoveTraveller(String travellerId) org.springframework.http.ResponseEntityupdateCartEntry(String salesApplication, Integer entryId, @NotNull AncillaryEntryRequest ancillaryEntryRQ) voidupdateTraveller(String travellerId, Traveller traveller, boolean saveInProfile, javax.servlet.http.HttpServletResponse httpServletResponse) protected voidvalidateAddAncillaryRequest(AncillaryEntryRequest ancillaryEntryRQ) Validate add ancillary request by AddToCartCriteria restrictionprotected voidvalidateIfTransportOfferingsExistInCart(OfferRequestData offersRequest, List<String> transportOfferingCodes) Validate if transport offerings exists in cart.Methods inherited from class de.hybris.platform.coretravelcommonsocc.controllers.TravelBaseController
getAbsoluteLocationURL, getDataMapper, getErrorCode, getErrorCodeResolver, handleAccessDeniedException, handleMissingRequestHeaderException, handleTravelModelNotFoundException, sanitize, validate, validate
-
Constructor Details
-
TransportCartsController
public TransportCartsController()
-
-
Method Details
-
addTravellersToCart
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/travellers", method=POST) public org.springframework.http.ResponseEntity addTravellersToCart(@RequestBody TravellerQuantityList travellerQuantityList) throws AddTravellersToCartWsException Add travellers to the given cart.- Parameters:
travellerQuantityList- the list of travellers, described as type of passenger and quantity to add.- Returns:
- the response entity
- Throws:
AddTravellersToCartWsException- this exception is thrown whenever a business validation fail in the add travellers method in travel facades. E.g.: a ptcCode does not exist in the system, the quantity exceed, etc.
-
getTravellers
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/travellers", method=GET) @ResponseStatus(OK) public org.springframework.http.ResponseEntity getTravellers() -
getTraveller
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/travellers/{travellerId}", method=GET) @ResponseStatus(OK) public org.springframework.http.ResponseEntity getTraveller(@PathVariable String travellerId) -
getAncillaryEntry
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/ancillaryEntries/{entryId}", method=GET) @ResponseBody public org.springframework.http.ResponseEntity getAncillaryEntry(@PathVariable(name="entryId") Integer entryId) -
addAncillaryToCart
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/ancillaryEntries", method=POST) @ResponseBody public org.springframework.http.ResponseEntity addAncillaryToCart(@RequestHeader(name="sap.cx-sales-application") String salesApplication, @RequestBody AncillaryEntryRequest ancillaryEntryRQ, javax.servlet.http.HttpServletRequest httpServletRequest) throws InternalErrorWsException - Throws:
InternalErrorWsException
-
addSeatsToCart
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/seatEntries", method=POST) @ResponseBody public org.springframework.http.ResponseEntity addSeatsToCart(@RequestHeader(name="sap.cx-sales-application") String salesApplication, @RequestBody SeatEntryRequest seatEntryRQ, javax.servlet.http.HttpServletRequest httpServletRequest) throws InternalErrorWsException, TravelWebserviceException -
getSeatEntry
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/seatEntries/{entryId}", method=GET) @ResponseBody public org.springframework.http.ResponseEntity getSeatEntry(@PathVariable Integer entryId) throws UnknownResourceWsException, InternalErrorWsException, de.hybris.platform.webservicescommons.errors.exceptions.WebserviceValidationException, CartEntryWsException - Throws:
UnknownResourceWsExceptionInternalErrorWsExceptionde.hybris.platform.webservicescommons.errors.exceptions.WebserviceValidationExceptionCartEntryWsException
-
getSeatMap
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/seatmap", method=GET) @ResponseBody public org.springframework.http.ResponseEntity<SeatMapResponse> getSeatMap(@RequestHeader(name="sap.cx-sales-application") String salesApplication, @RequestParam(required=false) List<String> transportOfferingCodes) throws TransportOfferingsNotInCartWsException Gets seat map.- Parameters:
transportOfferingCodes- the transport offering codes- Returns:
- the seat map
- Throws:
TransportOfferingsNotInCartWsException- the transport offerings not in cart ws exception
-
addTransportBundleToCart
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/bounds", method=POST) @ResponseStatus(NO_CONTENT) public org.springframework.http.ResponseEntity addTransportBundleToCart(@RequestHeader(name="sap.cx-sales-application") String salesApplication, @RequestBody AddBoundToCartRequest addBundleToCart, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws AddTransportBundleToCartWsException Add a transport bundle to the cart.- Parameters:
addBundleToCart- the addBundleToCart ws dto- Returns:
- the response entity
- Throws:
AddTransportBundleToCartWsException- This exception is thrown whenever a business validation fails in the addTransportBundleToCart method of the travelCartFacade
-
removeBoundFromCart
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/bounds/{boundId}", method=DELETE) @ResponseStatus(NO_CONTENT) public org.springframework.http.ResponseEntity removeBoundFromCart(@RequestHeader(name="sap.cx-sales-application") String salesApplication, @PathVariable String boundId) Remove a bound from cart.- Returns:
- the response entity
-
removeSeatEntry
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/seatEntries/{entryId}", method=DELETE) @ResponseBody public org.springframework.http.ResponseEntity removeSeatEntry(@PathVariable Integer entryId) throws InternalErrorWsException, CartEntryWsException, UnknownResourceWsException Remove seat entry response entity.- Parameters:
entryId- the entry number- Returns:
- the response entity
- Throws:
InternalErrorWsExceptionCartEntryWsExceptionUnknownResourceWsException
-
updateCartEntry
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/ancillaryEntries/{entryId}", method=PATCH) @ResponseBody public org.springframework.http.ResponseEntity updateCartEntry(@RequestHeader(name="sap.cx-sales-application") String salesApplication, @PathVariable(name="entryId") Integer entryId, @NotNull @RequestBody @NotNull AncillaryEntryRequest ancillaryEntryRQ) throws InvalidSessionCartWsException, UnknownResourceWsException, ProductNotEligibleWsException, ProductPartOfBundleWsException, ProductTravelRestrictionWsException, ProductStockNotAvailableWsException, UpdateAncillaryEntryWsException, InternalErrorWsException -
removeAncillaryCartEntry
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/ancillaryEntries/{entryId}", method=DELETE) @ResponseBody public org.springframework.http.ResponseEntity removeAncillaryCartEntry(@PathVariable(name="entryId") Integer entryId) throws InvalidSessionCartWsException, UnknownResourceWsException, ProductNotEligibleWsException, ProductPartOfBundleWsException, RemoveAncillaryEntryWsException, InternalErrorWsException Performs the deletes ancillary entry.- Parameters:
entryId- the entry number- Returns:
- the response entity
- Throws:
InvalidSessionCartWsExceptionUnknownResourceWsExceptionProductNotEligibleWsExceptionProductPartOfBundleWsExceptionRemoveAncillaryEntryWsExceptionInternalErrorWsException
-
updateTraveller
@Secured({"ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/travellers/{travellerId}", method=PATCH) @ResponseStatus(NO_CONTENT) public void updateTraveller(@PathVariable String travellerId, @RequestBody Traveller traveller, @RequestParam(required=false) boolean saveInProfile, javax.servlet.http.HttpServletResponse httpServletResponse) -
removeTraveller
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/travellers/{travellerId}", method=DELETE) @ResponseStatus(NO_CONTENT) public org.springframework.http.ResponseEntity removeTraveller(@PathVariable String travellerId) -
getAvailableAncillaries
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/ancillaries", method=GET, produces="application/json") @ResponseBody public org.springframework.http.ResponseEntity<AncillaryResponse> getAvailableAncillaries(@RequestHeader(name="sap.cx-sales-application") String salesApplication, @RequestParam(required=false) List<String> transportOfferingCodes) Search ancillary products- Returns:
AncillaryResponse
-
validateIfTransportOfferingsExistInCart
protected void validateIfTransportOfferingsExistInCart(OfferRequestData offersRequest, List<String> transportOfferingCodes) throws TransportOfferingsNotInCartWsException Validate if transport offerings exists in cart.- Parameters:
offersRequest- the offers requesttransportOfferingCodes- the transport offering codes- Throws:
TransportOfferingsNotInCartWsException- the transport offerings not in cart ws exception
-
filterOfferRequestByTransportOfferingCodes
protected void filterOfferRequestByTransportOfferingCodes(List<String> transportOfferingCodes, OfferRequestData offersRequest) Filter offer request by removing transport offerings that doesn't contain in transportOfferingCodes.- Parameters:
transportOfferingCodes- the transport offering codesoffersRequest- the offers request
-
validateAddAncillaryRequest
Validate add ancillary request by AddToCartCriteria restriction- Parameters:
ancillaryEntryRQ- the add ancillary request
-