Class DealCartsController

java.lang.Object
de.hybris.platform.coretravelcommonsocc.controllers.TravelBaseController
de.hybris.platform.coretravelpackagesocc.controllers.DealCartsController

@Controller @RequestMapping("/{baseSiteId}/users/{userId}/carts/{cartId}") public class DealCartsController extends TravelBaseController
Controller for adding a deal to cart
  • Constructor Details

    • DealCartsController

      public DealCartsController()
  • Method Details

    • addDealToCart

      @Secured({"ROLE_CLIENT","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/deals", method=POST) public org.springframework.http.ResponseEntity addDealToCart(@RequestHeader(name="sap.cx-sales-application",required=true) String salesApplication, @RequestBody AddDealToCart addDealToCart, @PathVariable(name="cartId") String cartId)
    • validateBusinessErrors

      protected void validateBusinessErrors(AddDealToCart addDealToCart, String cartId)
      Validate the business errors of the given request
      Parameters:
      addDealToCart - the addDealToCartRequest
    • validateDealBundleRoutes

      protected void validateDealBundleRoutes(DealBundleTemplateModel dealBundleTemplateById, List<TravelSectorData> sortedOutBoundSectors, List<TravelSectorData> sortedInBoundSectors)
      Check if the dealBundleTemplateById allows the given outbound and inbound sectors
      Parameters:
      dealBundleTemplateById - the dealBundleTemplateById
      sortedOutBoundSectors - the TravelSectorData sorted by departure date
      sortedInBoundSectors - the TravelSectorData sorted by departure date
    • checkDealRoutes

      protected void checkDealRoutes(List<TravelSectorData> sortedBoundSectors, RouteBundleTemplateModel routeBundleTemplateModel)
      Check if the deal routes allows the given travelSector list
      Parameters:
      sortedBoundSectors - the TravelSectorData sorted by departure date
      routeBundleTemplateModel - the routeBundleTemplateModel
    • validateOriginDestinationLocation

      protected void validateOriginDestinationLocation(List<TravelSectorData> sectorDataList) throws InvalidOriginDestinationWsException
      Validate origin destination location. 1) checks if the destination location of a route is equal to origin location of the next one, 2) for the last route checks if the destination location is equal to the origin location of the first route
      Parameters:
      sectorDataList - the sectorDataList list
      Throws:
      InvalidOriginDestinationWsException - the InvalidOriginDestinationWsException