Interface AccommodationCommerceCartService
- All Known Implementing Classes:
DefaultAccommodationCommerceCartService
public interface AccommodationCommerceCartService
This service provides functionality of adding, removing and modifying order entries specific to accommodations.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanamendOrderEntryGroup(AccommodationOrderEntryGroupModel accommodationOrderEntryGroup, List<Integer> entryNumbers, String paymentType) Link accommodationOrderEntryGroup to new Entries of the amended Order based on the paymentType and the paymentMethod used during original methodvoidcleanupCartBeforeAddition(String accommodationOfferingCode, String checkInDateTime, String checkOutDateTime) Checks if the accommodationOfferingCode matches the one that is currently in the cart.voidcreateOrderEntryGroup(List<Integer> entryNumbers, Date checkInDate, Date checkOutDate, String accOffCode, String accCode, String ratePlanCode, int refNumber) Creates order entry group which will hold a set of data related to one of the roomStays.voidRemoves all the entries in the cart.Retrieves AccommodationOffering that is currently in the cartgetEntriesForProductAndAccommodation(CartModel cartModel, ProductModel product, CartEntryModel cartEntryModel) Retrieves a list ofCartEntryModelthat matches the providedProductModelandAccommodationModelin theCartModelintIdentifies the maximum roomStayRefNumber based on the AccommodationOrderEntryGroups that are currently in the cart.getNewAccommodationOrderEntryGroups(String accommodationOfferingCode, String accommodationCode, String ratePlanCode) Retrieves a list of AccommodationOrderEntryGroup from current session cart which match given accommodationOfferingCode, accommodationCode and ratePlan set.intReturns a number of AccommodationOrderEntryGroups that are currently in the cart.getPaymentTypeForChangeDates(AccommodationOrderEntryGroupModel accommodationOrderEntryGroup, List<Integer> entryNumbers) Identifies which payment type will occur on changing datesbooleanisAccommodationExistInCart(String accommodationOfferingCode, Date checkInDate, Date checkOutDate, List<AccommodationOrderEntryGroupModel> entryGroups) Check whether accommodation exist in the cart.booleanCheck whether new room is added into the cart.voidpopulateAccommodationDetailsOnRoomRateEntry(int entryNumber, List<Date> dates) Populates entry type, dates and amend status on a accommodationOrderEntryInfo attribute of a given entryremoveAccommodationOrderEntryGroup(int roomStayReference) Removes accommodation order entry group and entries associated to it from the cartvoidremoveAccommodationOrderEntryGroups(List<AccommodationOrderEntryGroupModel> accommodationOrderEntryGroups, int numberToRemove) Deprecated, for removal: This API element is subject to removal in a future version.Since 2003removeAccommodations(List<AccommodationOrderEntryGroupModel> accommodationOrderEntryGroups, int numberToRemove) Removes a number of given AccommodationOrderEntryGroups from cart and all entries associated to them.voidremoveRoomStay(Integer roomStayRefNumber) Removes accommodation order entry and related entries from the cart without room stay ref normalisationvoidrollbackAccommodationEntries(String accommodationCode, String accommodationOfferingCode, String ratePlanCode) Removes the accommodationOfferingEntries that were associated with the option which was affected during add to cart.booleanvalidateCart(String accommodationOfferingCode, String checkInDateTime, String checkOutDateTime, List<AccommodationOrderEntryGroupModel> entryGroups)
-
Method Details
-
populateAccommodationDetailsOnRoomRateEntry
Populates entry type, dates and amend status on a accommodationOrderEntryInfo attribute of a given entry- Parameters:
entryNumber- the entry numberdates- the dates
-
createOrderEntryGroup
void createOrderEntryGroup(List<Integer> entryNumbers, Date checkInDate, Date checkOutDate, String accOffCode, String accCode, String ratePlanCode, int refNumber) Creates order entry group which will hold a set of data related to one of the roomStays. It will also be linked to all order entries related to this roomStay.- Parameters:
entryNumbers- the entry numberscheckInDate- the check in datecheckOutDate- the check out dateaccOffCode- the acc off codeaccCode- the acc coderatePlanCode- the rate plan coderefNumber- the ref number
-
amendOrderEntryGroup
boolean amendOrderEntryGroup(AccommodationOrderEntryGroupModel accommodationOrderEntryGroup, List<Integer> entryNumbers, String paymentType) Link accommodationOrderEntryGroup to new Entries of the amended Order based on the paymentType and the paymentMethod used during original method- Parameters:
accommodationOrderEntryGroup- the accommodation order entry groupentryNumbers- the entry numberspaymentType- then type of transaction to create- Returns:
- true/false
-
getNewAccommodationOrderEntryGroups
List<AccommodationOrderEntryGroupModel> getNewAccommodationOrderEntryGroups(String accommodationOfferingCode, String accommodationCode, String ratePlanCode) Retrieves a list of AccommodationOrderEntryGroup from current session cart which match given accommodationOfferingCode, accommodationCode and ratePlan set.- Parameters:
accommodationOfferingCode- the accommodation offering codeaccommodationCode- the accommodation coderatePlanCode- the rate plan code- Returns:
- list of AccommodationOrderEntryGroup
-
getMaxRoomStayRefNumber
int getMaxRoomStayRefNumber()Identifies the maximum roomStayRefNumber based on the AccommodationOrderEntryGroups that are currently in the cart.- Returns:
- maxRoomStayRefNumber max room stay ref number
-
removeAccommodationOrderEntryGroups
@Deprecated(since="2003", forRemoval=true) void removeAccommodationOrderEntryGroups(List<AccommodationOrderEntryGroupModel> accommodationOrderEntryGroups, int numberToRemove) Deprecated, for removal: This API element is subject to removal in a future version.Since 2003Removes a number of given AccommodationOrderEntryGroups from cart and all entries associated to them. It then normalises the roomStayRefNumbers not to lose track of them.- Parameters:
accommodationOrderEntryGroups- - accommodationOrderEntryGroups currently in cartnumberToRemove- - specifies how many AccommodationOrderEntryGroups should be removed.
-
removeAccommodations
CommerceCartModification removeAccommodations(List<AccommodationOrderEntryGroupModel> accommodationOrderEntryGroups, int numberToRemove) Removes a number of given AccommodationOrderEntryGroups from cart and all entries associated to them. It then normalises the roomStayRefNumbers not to lose track of them.- Parameters:
accommodationOrderEntryGroups- - accommodationOrderEntryGroups currently in cartnumberToRemove-- Returns:
CommerceCartModification
-
rollbackAccommodationEntries
void rollbackAccommodationEntries(String accommodationCode, String accommodationOfferingCode, String ratePlanCode) Removes the accommodationOfferingEntries that were associated with the option which was affected during add to cart.- Parameters:
accommodationCode- the accommodation codeaccommodationOfferingCode- the accommodation offering coderatePlanCode- the rate plan code
-
cleanupCartBeforeAddition
void cleanupCartBeforeAddition(String accommodationOfferingCode, String checkInDateTime, String checkOutDateTime) Checks if the accommodationOfferingCode matches the one that is currently in the cart. If not, all AccommodationOrderEntryGroups should be removed from cart because multi accommodation offering booking is not supported- Parameters:
accommodationOfferingCode- the accommodation offering codecheckInDateTime- the check in date timecheckOutDateTime- the check out date time
-
validateCart
boolean validateCart(String accommodationOfferingCode, String checkInDateTime, String checkOutDateTime, List<AccommodationOrderEntryGroupModel> entryGroups) - Parameters:
accommodationOfferingCode- accommodation offering codecheckInDateTime- check in datecheckOutDateTime- check out dateentryGroups- accommodation order entry groups- Returns:
- true if cart is valid
-
isAccommodationExistInCart
boolean isAccommodationExistInCart(String accommodationOfferingCode, Date checkInDate, Date checkOutDate, List<AccommodationOrderEntryGroupModel> entryGroups) Check whether accommodation exist in the cart.- Parameters:
accommodationOfferingCode- accommodation offering codecheckInDate- check in datecheckOutDate- check out dateentryGroups- accommodation order entry groups- Returns:
- true if accommodation exist in cart
-
emptyCart
void emptyCart()Removes all the entries in the cart. -
getNumberOfEntryGroupsInCart
int getNumberOfEntryGroupsInCart()Returns a number of AccommodationOrderEntryGroups that are currently in the cart.- Returns:
- number of entry groups in cart
-
removeAccommodationOrderEntryGroup
Removes accommodation order entry group and entries associated to it from the cart- Parameters:
roomStayReference- the room stay reference- Returns:
- boolean
-
getCurrentAccommodationOffering
String getCurrentAccommodationOffering()Retrieves AccommodationOffering that is currently in the cart- Returns:
- current accommodation offering
-
removeRoomStay
Removes accommodation order entry and related entries from the cart without room stay ref normalisation- Parameters:
roomStayRefNumber-
-
isNewRoomInCart
boolean isNewRoomInCart()Check whether new room is added into the cart.- Returns:
-
getEntriesForProductAndAccommodation
List<CartEntryModel> getEntriesForProductAndAccommodation(CartModel cartModel, ProductModel product, CartEntryModel cartEntryModel) Retrieves a list ofCartEntryModelthat matches the providedProductModelandAccommodationModelin theCartModel- Parameters:
cartModel-product-cartEntryModel-- Returns:
- current accommodation offering
-
getPaymentTypeForChangeDates
String getPaymentTypeForChangeDates(AccommodationOrderEntryGroupModel accommodationOrderEntryGroup, List<Integer> entryNumbers) Identifies which payment type will occur on changing dates- Parameters:
entryNumbers-- Returns:
-