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.
  • 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
      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:
      UnknownResourceWsException
      InternalErrorWsException
      de.hybris.platform.webservicescommons.errors.exceptions.WebserviceValidationException
      CartEntryWsException
    • 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:
      InternalErrorWsException
      CartEntryWsException
      UnknownResourceWsException
    • 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
      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:
      InvalidSessionCartWsException
      UnknownResourceWsException
      ProductNotEligibleWsException
      ProductPartOfBundleWsException
      RemoveAncillaryEntryWsException
      InternalErrorWsException
    • 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 request
      transportOfferingCodes - 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 codes
      offersRequest - the offers request
    • validateAddAncillaryRequest

      protected void validateAddAncillaryRequest(AncillaryEntryRequest ancillaryEntryRQ)
      Validate add ancillary request by AddToCartCriteria restriction
      Parameters:
      ancillaryEntryRQ - the add ancillary request