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
-
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.ResponseEntityaddDealToCart(String salesApplication, AddDealToCart addDealToCart, String cartId) protected voidcheckDealRoutes(List<TravelSectorData> sortedBoundSectors, RouteBundleTemplateModel routeBundleTemplateModel) Check if the deal routes allows the given travelSector listprotected voidvalidateBusinessErrors(AddDealToCart addDealToCart, String cartId) Validate the business errors of the given requestprotected voidvalidateDealBundleRoutes(DealBundleTemplateModel dealBundleTemplateById, List<TravelSectorData> sortedOutBoundSectors, List<TravelSectorData> sortedInBoundSectors) Check if the dealBundleTemplateById allows the given outbound and inbound sectorsprotected voidvalidateOriginDestinationLocation(List<TravelSectorData> sectorDataList) Validate origin destination location.Methods inherited from class de.hybris.platform.coretravelcommonsocc.controllers.TravelBaseController
getAbsoluteLocationURL, getDataMapper, getErrorCode, getErrorCodeResolver, handleAccessDeniedException, handleMissingRequestHeaderException, handleTravelModelNotFoundException, sanitize, validate, validate
-
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
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 dealBundleTemplateByIdsortedOutBoundSectors- the TravelSectorData sorted by departure datesortedInBoundSectors- 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 daterouteBundleTemplateModel- 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
-