Class DefaultNDCCarrierOfferDataValidationStrategy

java.lang.Object
de.hybris.platform.ndc182shoppingfacades.facades.order.strategies.impl.DefaultNDCCarrierOfferDataValidationStrategy
All Implemented Interfaces:
OrderCreateRequestValidationStrategy<NDCCarrierOfferData>

public class DefaultNDCCarrierOfferDataValidationStrategy extends Object implements OrderCreateRequestValidationStrategy<NDCCarrierOfferData>
The ndc 18.2 implementation of OrderCreateRequestValidationStrategy interface.
  • Constructor Details

    • DefaultNDCCarrierOfferDataValidationStrategy

      public DefaultNDCCarrierOfferDataValidationStrategy()
  • Method Details

    • validate

      public void validate(List<NDCCarrierOfferData> ndcOfferDataList, IATAOrderCreateRQ orderCreateRQ) throws NDCException
      This method validates a NDCCarrierOfferData. Checks if 1) the offer is identical to the one in the orderCreateRQ message, 2) all the distinct transport offerings included in the offer are present in the paxSegmentList of the request message, 3) the journey is not an open journey (the destination of the inbound (if present) is equal to the origin of the outbound.
      Specified by:
      validate in interface OrderCreateRequestValidationStrategy<NDCCarrierOfferData>
      Parameters:
      ndcOfferDataList - the ndcOfferDataList
      orderCreateRQ - the orderCreateRQ
      Throws:
      NDCException
    • validateOffer

      protected void validateOffer(NDCCarrierOfferData carrierOfferData, SelectedOfferType selectedOffer, List<PaxType> paxList) throws NDCException
      This method checks if each offer listed in the orderCreateRQ message is identical to the offer (with the same ID) retrieved from the cache.
      Parameters:
      carrierOfferData - the carrier offer data
      selectedOffer - the selected offer
      paxList - the pax list
      Throws:
      NDCException - the ndc exception
    • validateNdcOfferDataByPaxList

      protected void validateNdcOfferDataByPaxList(List<NDCPassengerData> ndcPassengerDataList, List<String> selectedOfferPaxList, List<PaxType> paxTypeList) throws NDCException
      Validates the ndc offer data by pax list. For each offerItem checks if the list of the passengers (and the type) is the same. Note that an offerItem has the type of passenger in its paxList.
      Parameters:
      ndcPassengerDataList - the ndcPassengerDataList
      selectedOfferPaxList - the selectedOfferPaxList
      paxTypeList - the pax type list
      Throws:
      NDCException - the ndc exception
    • validateFlights

      protected void validateFlights(NDCCarrierOfferData ndcCarrierOfferData, List<PaxSegmentType> paxSegmentList) throws NDCException
      Validates all the (distinct) transport offerings included in the offer. For each transport offering retrieves the transport offering model from the db and (if exists) verifies if: 1) the departure date is in the future, 2) the transport offering is listed in the paxSegmentList and all the informations in the paxSegment are identical.
      Parameters:
      ndcCarrierOfferData - the ndc carrier offer data
      paxSegmentList - the pax segment list
      Throws:
      NDCException - the ndc exception
    • validatePaxSegment

      protected void validatePaxSegment(TransportOfferingModel transportOfferingModel, PaxSegmentType paxSegment) throws NDCException
      This method verifies if the paxSegment associated to the transport offering has the same informations (dep/arrival date, flight number, origin/destination location codes and carrierDesignCode).
      Parameters:
      transportOfferingModel - the transport offering model
      paxSegment - the pax segment
      Throws:
      NDCException - the ndc exception
    • validatePaxSegmentDepartureAndArrivalDate

      protected void validatePaxSegmentDepartureAndArrivalDate(PaxSegmentType paxSegment, TransportOfferingModel transportOfferingModel, String transportOfferingCode) throws NDCException
      Validates pax segment departure and arrival date.
      Parameters:
      paxSegment - the pax segment
      transportOfferingModel - the transport offering model
      transportOfferingCode - the transport offering code
      Throws:
      NDCException - the ndc exception
    • getTransportOfferingService

      protected TransportOfferingService getTransportOfferingService()
      Gets transport offering service.
      Returns:
      the transport offering service
    • setTransportOfferingService

      public void setTransportOfferingService(TransportOfferingService transportOfferingService)
      Sets transport offering service.
      Parameters:
      transportOfferingService - the transport offering service
    • getTransportFacilityService

      protected TransportFacilityService getTransportFacilityService()
      Gets transport facility service.
      Returns:
      the transport facility service
    • setTransportFacilityService

      public void setTransportFacilityService(TransportFacilityService transportFacilityService)
      Sets transport facility service.
      Parameters:
      transportFacilityService - the transport facility service
    • getNdcPassengerTypeService

      protected NDCPassengerTypeService getNdcPassengerTypeService()
      Gets ndc passenger type service.
      Returns:
      the ndc passenger type service
    • setNdcPassengerTypeService

      public void setNdcPassengerTypeService(NDCPassengerTypeService ndcPassengerTypeService)
      Sets ndc passenger type service.
      Parameters:
      ndcPassengerTypeService - the ndc passenger type service
    • getConfigurationService

      protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()
      Gets configuration service.
      Returns:
      the configuration service
    • setConfigurationService

      public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService)
      Sets configuration service.
      Parameters:
      configurationService - the configuration service