Interface BookingService
- All Known Subinterfaces:
ShoppingBookingService
- All Known Implementing Classes:
DefaultBookingService,DefaultShoppingBookingService
public interface BookingService
BookingService interface that provides functionality to manage Bookings.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequestToRoomStayBooking(String request, int roomStayRefNumber, String bookingReference) Add an user request against a room stay bookingbooleanatleastOneAdultTravellerRemaining(String orderCode, String cancelledTravellerCode) Validates if atleast one adult traveller belongs to booking(apart from the one removed currently), while removing traveller from the booking.calculateTaxValueForEntries(AbstractOrderModel abstractOrder, List<AbstractOrderEntryModel> entries) Calculate accommodation tax value after Tax Compensation.calculateTotalRefundForCancelledTraveller(AbstractOrderModel abstractOrder) Calculate refund for cancelled travellerbooleancancelOrder(OrderModel order) Performs the cancellation of the order with the given orderCodevoidcancelOrder(OrderModel order, UserModel requestor) Performs the cancellation of the order.booleancancelPartialOrder(BigDecimal totalToRefund, OrderEntryType orderEntryType) Proceeds with cancellation of a part of the order, creates a refund transaction if there is any refund availablebooleancancelTraveller(BigDecimal totalToRefund) Deprecated.Deprecated since version 2.0.booleancancelTraveller(BigDecimal totalToRefund, TravellerData travellerData) Proceeds with cancellation of traveller, creates a refund transaction if there is any refund availablebooleancheckBundleToAmendProduct(AbstractOrderModel abstractOrderModel, String productCode, long qty, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes) Checks if a product is included in a bundlebooleancheckIfAnyOrderEntryByType(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType) Check if the abstractOrderModel has at least one orderEntry with type equals to the given orderEntryTypevoidcheckIfPartialCancelPossible(OrderModel order, OrderEntryType orderEntryType) Checks if the order cancellation possible for the given requestor.createRefundPaymentTransaction(AbstractOrderModel abstractOrder, BigDecimal amountToRefund) Deprecated.Deprecated since version 2.0.createRefundPaymentTransaction(AbstractOrderModel abstractOrder, BigDecimal amountToRefund, List<AbstractOrderEntryModel> entries) Creates a payment transaction for refundgetAccommodationDetailsParameters(AbstractOrderModel abstractOrderModel) Retrieves a map of parameters needed to access accommodation details page (accommodation offering, check in date, check out date)getAccommodationOrderEntryGroup(int roomStayRefNum, AbstractOrderModel abstractOrder) Returns AccommodationOrderEntryGroupModel based on roomStayRefNumber and cart numbergetAccommodationOrderEntryGroupRefs(AbstractOrderModel abstractOrderModel) Returns a list of AccommodationOrderEntryGroup reference numbers for the groups that have all entries in AmendStatus.NEWgetAccommodationOrderEntryGroups(AbstractOrderModel abstractOrder) Returns list of AccommodationOrderEntryGroups that are in the abstract order.getActiveEntries(OrderModel order, OrderEntryType excludedType) Returns active order entries whose type is not equal to given type to exclude.getAllOrders(String orderCode, BaseStoreModel baseStore) Return a list of all the orders for the given orderCode and baseStoredoublegetBookingTotalByOrderEntryType(AbstractOrderModel abstractOrder, OrderEntryType orderEntryType) Calculates the base price total amount for the orderEntryType in the abstract ordergetGlobalDiscountForEntryType(AbstractOrderModel abstractOrder, OrderEntryType entryType) Return the portio of global discounts relative to the given entry typegetLastActiveOrderForType(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType) Returns the last active order for the specified OrderEntryTypegetNewAccommodationOrderEntryGroupRefs(AbstractOrderModel abstractOrderModel) Returns a list of AccommodationOrderEntryGroup reference numbers for the groups that have all entries in AmendStatus.NEWgetOldAccommodationOrderEntryGroupRefs(AbstractOrderModel abstractOrderModel) Returns a list of AccommodationOrderEntryGroup reference numbers for the groups that have all entries in AmendStatus.SAMERetrieves the orderModel for the specified bookingReference.Get Order model from code or guidgetOrderEntries(AbstractOrderModel abstractOrderModel, String productCode, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes, boolean bundleNoCheckRequired) Retrieves abstractOrderEntry list from given abstractOrderModelgetOrderEntry(AbstractOrderModel abstractOrderModel, String productCode, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes, boolean bundleNoCheckRequired) Retrieves abstractOrderEntry from given abstractOrderModelgetOrderForCurrentUser(String code) Returns the specified order for the current user and store.getOrderModelByOriginalOrderCode(String bookingReference) Gets order with original order code equal to booking referencegetOrderModelFromStore(String bookingReference) Gets order model from store.getOrderTotalPaid(AbstractOrderModel abstractOrder) Calculates the total already paid for a given ordergetOrderTotalPaidByEntryGroup(AbstractOrderModel abstractOrder, AbstractOrderEntryGroupModel entryGroup) Calculates the total already paid for products belonging to a given entry group within the given ordergetOrderTotalPaidForOrderEntryType(AbstractOrderModel abstractOrder, OrderEntryType orderEntryType) Calculates the total already paid for products of the given orderEntryType and for the given ordergetOrderTotalPriceByType(AbstractOrderModel abstractOrder, OrderEntryType orderEntryType) Returns the orderTotal related to the given orderEntryType part of the order.Calculates the total to pay for change dates for the order in cartgetOriginalOrder(AbstractOrderModel abstractOrder) returns an original ordergetOriginalOrderEntry(AbstractOrderModel abstractOrderModel, String productCode, int roomStayRefNumber) Retrieves abstractOrderEntry from given abstractOrderModelgetOriginalOrderEntry(String originalOrderCode, String productCode, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes, Boolean bundleNoCheckRequired) Retrieves abstractOrderEntry from given abstractOrderModel's codegetProductQuantityInOrderForTransportOffering(String bookingReference, ProductModel productModel, TransportOfferingModel transportOfferingModel) Returns the quantity of products in the Order for a transportOffering.getRequestToRoomStayBooking(int roomStayRefNumber, OrderModel bookingReference) Get an user request against a room stay bookinggetTotalRefundAmountByEntryType(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType) Gets total refund amount by entry type.getTotalToRefund(OrderModel order) Calculate the total amount to be refundedgetTotalToRefund(OrderModel order, OrderEntryType orderEntryType) Calculate the total amount to refund based on the given orderEntryTypebooleanChecks if user made any changes during amendmentbooleanisAbstractOrderOfType(AbstractOrderModel abstractOrder, String bookingType) Checks if is abstract Order is of type.booleanisCancelPossible(OrderModel order) Check if the cancel order is possible for the order with the given orderCodebooleanisReservationCancelled(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType) Check if the reservation for the specified orderEntryType has been cancelled.booleanisValidPassengerReference(AbstractOrderModel abstractOrder, String passengerReference) Checks if the passenger reference is valid for the provided abstract orderbooleanlinkEntriesToOldPaymentTransactions(AccommodationOrderEntryGroupModel orderEntryGroup, List<AbstractOrderEntryModel> entries) This method will replace all the old RoomRateModel entries belonging to specific group transaction entries , with new Entries.voidremoveRequestFromRoomStayBooking(String requestCode, int roomStayRefNumber, String bookingReference) Remove an user request from a room stay bookingbooleanunlinkBooking(UserModel user, OrderModel order) Unlinks the booking from user accountvoidupdateOrderStatus(OrderModel orderModel, OrderStatus status) Updates the order with the status provided as a param
-
Method Details
-
createRefundPaymentTransaction
@Deprecated Boolean createRefundPaymentTransaction(AbstractOrderModel abstractOrder, BigDecimal amountToRefund) Deprecated.Deprecated since version 2.0. UsecreateRefundPaymentTransaction(AbstractOrderModel, BigDecimal, List)instead.Creates a payment transaction for refund- Parameters:
abstractOrder- the abstract orderamountToRefund- the amount to refund- Returns:
- true if successfully created transaction
-
createRefundPaymentTransaction
Boolean createRefundPaymentTransaction(AbstractOrderModel abstractOrder, BigDecimal amountToRefund, List<AbstractOrderEntryModel> entries) Creates a payment transaction for refund- Parameters:
abstractOrder- the abstract orderamountToRefund- the amount to refundentries- the entries the transaction is linked to- Returns:
- true if successfully created transaction
-
getAllOrders
Return a list of all the orders for the given orderCode and baseStore- Parameters:
orderCode- the order codebaseStore- the base store- Returns:
- the list of OrderModel
-
isCancelPossible
Check if the cancel order is possible for the order with the given orderCode- Parameters:
order- as the order to be cancelled- Returns:
- true if the cancellation is possible, false otherwise
-
cancelOrder
Performs the cancellation of the order with the given orderCode- Parameters:
order- as the order to be cancelled- Returns:
- true if the cancellation of the order was successful, false otherwise
-
getTotalToRefund
Calculate the total amount to be refunded- Parameters:
order- as the order- Returns:
- the BigDecimal value to be refunded
-
getTotalToRefund
Calculate the total amount to refund based on the given orderEntryType- Parameters:
order- as the orderorderEntryType- as the orderEntryType- Returns:
- the BigDecimal value to refund
-
cancelTraveller
Deprecated.Deprecated since version 2.0. UsecancelTraveller(BigDecimal, TravellerData)instead.Proceeds with cancellation of traveller, creates a refund transaction if there is any refund available- Parameters:
totalToRefund- the total to refund- Returns:
- true if successfully created refund payment transaction
-
cancelTraveller
Proceeds with cancellation of traveller, creates a refund transaction if there is any refund available- Parameters:
totalToRefund- the total to refundtravellerData- the travellerData for which to create the refund payment- Returns:
- true if successfully created refund payment transaction
-
getOrderModelFromStore
Gets order model from store.- Parameters:
bookingReference- the booking reference- Returns:
- OrderModel order model from store
-
getOrderEntry
AbstractOrderEntryModel getOrderEntry(AbstractOrderModel abstractOrderModel, String productCode, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes, boolean bundleNoCheckRequired) Retrieves abstractOrderEntry from given abstractOrderModel- Parameters:
abstractOrderModel- - the abstract order modelproductCode- the productCodetravelRouteCode- the travel Route CodetransportOfferingCodes- list of transport Offering CodetravellerCodes- the Traveller unique idbundleNoCheckRequired- flag to check if bundle no. check is required.- Returns:
- AbstractOrderEntryModel order entry
-
getOrderEntries
List<AbstractOrderEntryModel> getOrderEntries(AbstractOrderModel abstractOrderModel, String productCode, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes, boolean bundleNoCheckRequired) Retrieves abstractOrderEntry list from given abstractOrderModel- Parameters:
abstractOrderModel- - the abstract order modelproductCode- the productCodetravelRouteCode- the travel Route CodetransportOfferingCodes- list of transport Offering CodetravellerCodes- the Traveller unique idbundleNoCheckRequired- flag to check if bundle no. check is required.- Returns:
- AbstractOrderEntryModel order entry
-
getOriginalOrderEntry
AbstractOrderEntryModel getOriginalOrderEntry(String originalOrderCode, String productCode, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes, Boolean bundleNoCheckRequired) Retrieves abstractOrderEntry from given abstractOrderModel's code- Parameters:
originalOrderCode- the original order codeproductCode- the product codetravelRouteCode- the travel route codetransportOfferingCodes- the transport offering codestravellerCodes- the traveller codesbundleNoCheckRequired- the bundle no check required- Returns:
- order entry for given code of abstract order model
-
hasCartBeenAmended
boolean hasCartBeenAmended()Checks if user made any changes during amendment- Returns:
- true if something has been changed
-
getOrder
Retrieves the orderModel for the specified bookingReference.- Parameters:
bookingReference- the booking reference- Returns:
- OrderModel object.
-
getProductQuantityInOrderForTransportOffering
Long getProductQuantityInOrderForTransportOffering(String bookingReference, ProductModel productModel, TransportOfferingModel transportOfferingModel) Returns the quantity of products in the Order for a transportOffering.- Parameters:
bookingReference- the booking referenceproductModel- the product modeltransportOfferingModel- the transport offering model- Returns:
- a Long
-
checkBundleToAmendProduct
boolean checkBundleToAmendProduct(AbstractOrderModel abstractOrderModel, String productCode, long qty, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes) Checks if a product is included in a bundle- Parameters:
abstractOrderModel- the abstract order modelproductCode- the product codeqty- the qtytravelRouteCode- the travel route codetransportOfferingCodes- the transport offering codestravellerCodes- the traveller codes- Returns:
- true if the product is included in a bundle, false otherwise
-
atleastOneAdultTravellerRemaining
Validates if atleast one adult traveller belongs to booking(apart from the one removed currently), while removing traveller from the booking.- Parameters:
orderCode- the order codecancelledTravellerCode- the cancelled traveller code- Returns:
- boolean boolean
-
getOrderModelByOriginalOrderCode
Gets order with original order code equal to booking reference- Parameters:
bookingReference- the booking reference- Returns:
- order model by original order code
-
updateOrderStatus
Updates the order with the status provided as a param- Parameters:
orderModel- the order modelstatus- the status
-
getAccommodationOrderEntryGroups
List<AccommodationOrderEntryGroupModel> getAccommodationOrderEntryGroups(AbstractOrderModel abstractOrder) Returns list of AccommodationOrderEntryGroups that are in the abstract order.- Parameters:
abstractOrder- the abstract order- Returns:
- accommodation order entry groups
-
getAccommodationOrderEntryGroup
AccommodationOrderEntryGroupModel getAccommodationOrderEntryGroup(int roomStayRefNum, AbstractOrderModel abstractOrder) Returns AccommodationOrderEntryGroupModel based on roomStayRefNumber and cart number- Parameters:
roomStayRefNum- the room stay ref numabstractOrder- the abstract order- Returns:
- accommodation order entry group
-
isReservationCancelled
boolean isReservationCancelled(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType) Check if the reservation for the specified orderEntryType has been cancelled.- Parameters:
abstractOrderModel- as the abstractOrderModel to be checkedorderEntryType- as theOrderEntryTypecorresponding to the reservation to be checked- Returns:
- true if all the orderEntries for the specified orderEntryType are inactive or if quantity is equals to 0
-
checkIfAnyOrderEntryByType
boolean checkIfAnyOrderEntryByType(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType) Check if the abstractOrderModel has at least one orderEntry with type equals to the given orderEntryType- Parameters:
abstractOrderModel- as the abstractOrderModel to be checkedorderEntryType- as theOrderEntryTypeto be checked- Returns:
- true if there is at least one orderEntry with type equals to the given orderEntryType, false otherwise
-
addRequestToRoomStayBooking
void addRequestToRoomStayBooking(String request, int roomStayRefNumber, String bookingReference) throws de.hybris.platform.servicelayer.exceptions.ModelSavingException, RequestKeyGeneratorException Add an user request against a room stay booking- Parameters:
request- the requestroomStayRefNumber- the room stay ref numberbookingReference- the booking reference- Throws:
de.hybris.platform.servicelayer.exceptions.ModelSavingException- the model saving exceptionRequestKeyGeneratorException- the request key generator exception
-
removeRequestFromRoomStayBooking
void removeRequestFromRoomStayBooking(String requestCode, int roomStayRefNumber, String bookingReference) throws de.hybris.platform.servicelayer.exceptions.ModelNotFoundException, de.hybris.platform.servicelayer.exceptions.ModelRemovalException Remove an user request from a room stay booking- Parameters:
requestCode- the request coderoomStayRefNumber- the room stay ref numberbookingReference- the booking reference- Throws:
de.hybris.platform.servicelayer.exceptions.ModelNotFoundException- the model not found exceptionde.hybris.platform.servicelayer.exceptions.ModelRemovalException- the model removal exception
-
getAccommodationDetailsParameters
Retrieves a map of parameters needed to access accommodation details page (accommodation offering, check in date, check out date)- Parameters:
abstractOrderModel- the abstract order model- Returns:
- accommodation details parameters
-
getAccommodationOrderEntryGroupRefs
Returns a list of AccommodationOrderEntryGroup reference numbers for the groups that have all entries in AmendStatus.NEW- Parameters:
abstractOrderModel- the abstract order model- Returns:
- new accommodation order entry group refs
-
getNewAccommodationOrderEntryGroupRefs
Returns a list of AccommodationOrderEntryGroup reference numbers for the groups that have all entries in AmendStatus.NEW- Parameters:
abstractOrderModel- the abstract order model- Returns:
- new accommodation order entry group refs
-
getOldAccommodationOrderEntryGroupRefs
Returns a list of AccommodationOrderEntryGroup reference numbers for the groups that have all entries in AmendStatus.SAME- Parameters:
abstractOrderModel- the abstract order model- Returns:
- new accommodation order entry group refs
-
getOrderTotalPriceByType
Returns the orderTotal related to the given orderEntryType part of the order.- Parameters:
abstractOrder- the abstract orderorderEntryType- the order entry type- Returns:
- the Double value of the totalPrice for the given orderEntryType
-
cancelPartialOrder
Proceeds with cancellation of a part of the order, creates a refund transaction if there is any refund available- Parameters:
totalToRefund- the total to refundorderEntryType- the order entry type- Returns:
- true if successfully created refund payment transaction
-
unlinkBooking
Unlinks the booking from user account- Parameters:
user- the userorder- the order- Returns:
- boolean
-
getLastActiveOrderForType
AbstractOrderModel getLastActiveOrderForType(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType) Returns the last active order for the specified OrderEntryType- Parameters:
abstractOrderModel- as the abstractOrderModelorderEntryType- as the orderEntryType- Returns:
- the last active OrderModel
-
getOrderTotalPaid
Calculates the total already paid for a given order- Parameters:
abstractOrder- the abstract order- Returns:
- order total paid
-
getOrderTotalPaidByEntryGroup
BigDecimal getOrderTotalPaidByEntryGroup(AbstractOrderModel abstractOrder, AbstractOrderEntryGroupModel entryGroup) Calculates the total already paid for products belonging to a given entry group within the given order- Parameters:
abstractOrder- the abstract orderentryGroup- the entry group- Returns:
- order total paid by entry group
-
getOrderTotalPaidForOrderEntryType
BigDecimal getOrderTotalPaidForOrderEntryType(AbstractOrderModel abstractOrder, OrderEntryType orderEntryType) Calculates the total already paid for products of the given orderEntryType and for the given order- Parameters:
abstractOrder- the abstract orderorderEntryType- the order entry type- Returns:
- order total paid for order entry type
-
getOrderTotalToPayForChangeDates
BigDecimal getOrderTotalToPayForChangeDates()Calculates the total to pay for change dates for the order in cart- Returns:
- totalAmountToPay order total to pay for change dates
-
linkEntriesToOldPaymentTransactions
boolean linkEntriesToOldPaymentTransactions(AccommodationOrderEntryGroupModel orderEntryGroup, List<AbstractOrderEntryModel> entries) This method will replace all the old RoomRateModel entries belonging to specific group transaction entries , with new Entries.- Parameters:
orderEntryGroup- the order entry groupentries- the entries- Returns:
- boolean
-
getOriginalOrderEntry
AbstractOrderEntryModel getOriginalOrderEntry(AbstractOrderModel abstractOrderModel, String productCode, int roomStayRefNumber) Retrieves abstractOrderEntry from given abstractOrderModel- Parameters:
abstractOrderModel- - the abstract order modelproductCode- the productCoderoomStayRefNumber- the room stay reference number- Returns:
- AbstractOrderEntryModel order entry
-
isAbstractOrderOfType
Checks if is abstract Order is of type.- Parameters:
abstractOrder- the orderbookingType- the booking type- Returns:
- true, if current cart is of type
-
getBookingTotalByOrderEntryType
double getBookingTotalByOrderEntryType(AbstractOrderModel abstractOrder, OrderEntryType orderEntryType) Calculates the base price total amount for the orderEntryType in the abstract order- Parameters:
abstractOrder- the orderorderEntryType- the orderEntryType- Returns:
- totalAmount booking total by order entry type
-
isValidPassengerReference
Checks if the passenger reference is valid for the provided abstract order- Parameters:
abstractOrder- the abstractOrderpassengerReference- the passengerReference- Returns:
- boolean
-
calculateTotalRefundForCancelledTraveller
Calculate refund for cancelled traveller- Parameters:
abstractOrder- the abstract order- Returns:
- big decimal
-
getOriginalOrder
returns an original order- Parameters:
abstractOrder- the abstract order- Returns:
- original order
-
getGlobalDiscountForEntryType
BigDecimal getGlobalDiscountForEntryType(AbstractOrderModel abstractOrder, OrderEntryType entryType) Return the portio of global discounts relative to the given entry type- Parameters:
abstractOrder- the abstract orderentryType- the entry type- Returns:
- global discount for entry type
-
calculateTaxValueForEntries
Double calculateTaxValueForEntries(AbstractOrderModel abstractOrder, List<AbstractOrderEntryModel> entries) Calculate accommodation tax value after Tax Compensation.- Parameters:
abstractOrder- the abstract orderentries- the entries- Returns:
- the big decimal
-
getOrderForCurrentUser
Returns the specified order for the current user and store.- Parameters:
code- the code of the order to retrieve- Returns:
- the order
-
getTotalRefundAmountByEntryType
BigDecimal getTotalRefundAmountByEntryType(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType) Gets total refund amount by entry type.- Parameters:
abstractOrderModel- the abstract order modelorderEntryType- the order entry type- Returns:
- the total refund amount by entry type
-
cancelOrder
Performs the cancellation of the order.- Parameters:
order- the order to be cancelledrequestor- the requestor- Throws:
BookingCancelException- if the order cannot be cancelled
-
checkIfPartialCancelPossible
void checkIfPartialCancelPossible(OrderModel order, OrderEntryType orderEntryType) throws OrderCancelDeniedException Checks if the order cancellation possible for the given requestor.- Parameters:
order- the order to be cancelled- Throws:
OrderCancelDeniedException- when cancel is denied
-
getActiveEntries
Returns active order entries whose type is not equal to given type to exclude.- Parameters:
order- the orderexcludedType- the order entry type to exclude- Returns:
- order entries
-
getOrder
Get Order model from code or guid- Parameters:
orderCode-isOrderGuid-- Returns:
-
getRequestToRoomStayBooking
SpecialRequestDetailModel getRequestToRoomStayBooking(int roomStayRefNumber, OrderModel bookingReference) throws SpecialRequestException Get an user request against a room stay booking- Parameters:
roomStayRefNumber- the room stay ref numberbookingReference- the booking reference- Returns:
- true if the operation of adding the request is successfully performed, false otherwise
- Throws:
SpecialRequestException- the special request exception
-