Interface NDCOrderService
- All Known Implementing Classes:
DefaultNDCOrderService
public interface NDCOrderService
The ndc 18.2 Order Service interface.
-
Method Summary
Modifier and TypeMethodDescriptioncreateOrderEntry(OrderModel order, ProductModel product, Set<Integer> orderEntryGroupNumber, List<TransportOfferingModel> transportOfferings, TravellerModel traveller, String routeCode, int originDestinationRefNumber, long quantity, Integer bundleNumber, BundleTemplateModel bundleTemplate) Creates an order entry.voidcreateSelectedAccommodations(ProductModel product, BigDecimal rowSeat, String columnSeat, List<String> transportOfferingCodes, TravellerModel traveller, OrderModel order, String routeCode) Creates a selected accommodation for each transport offering associated to the selected seat.getOriginalOrderCode(OrderModel orderModel) Gets original order code.Gets product catalog id from baseSite.booleanisAmendedOrderEntry(AbstractOrderEntryModel orderEntry) Checks if the order entry has amend status equal to NEW or CHANGED.isAmendmentOrder(OrderModel orderModel) Is amendment order boolean.booleanisSamePassenger(AbstractOrderEntryModel orderEntry, TravellerModel traveller) Checks if the traveller in the orderEntry is the same.booleanisSameTransportOfferingList(AbstractOrderEntryModel orderEntry, List<String> transportOfferings, int originDestiRefNumber) Checks if the list of transport offerings is the same with the one in the order entry, together with the originDestinationRefNumber.voidremoveOrder(OrderModel order) Checks if the order has already been saved and, in case, deletes it.voidupdateEntriesAmendStatus(List<AbstractOrderEntryModel> entries, AmendStatus status) Update entries amend status.voidvalidatePaymentInfoAgainstOrderEntries(OrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount) Validates the amount of the payment info against the total amount of the order entries associated to it.voidvalidateProductAgainstMaximumQuantityRestriction(long selectedOfferItemQty, AbstractOrderEntryModel existingProduct, ProductModel product, OrderModel order) Validates the product against the maximum quantity restriction.
-
Method Details
-
removeOrder
Checks if the order has already been saved and, in case, deletes it.- Parameters:
order- the order
-
validatePaymentInfoAgainstOrderEntries
void validatePaymentInfoAgainstOrderEntries(OrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount) throws NDCException Validates the amount of the payment info against the total amount of the order entries associated to it.- Parameters:
order- the orderorderEntries- the order entriespaymentInfoAmount- the payment info amount- Throws:
NDCException- the ndc exception
-
validateProductAgainstMaximumQuantityRestriction
void validateProductAgainstMaximumQuantityRestriction(long selectedOfferItemQty, AbstractOrderEntryModel existingProduct, ProductModel product, OrderModel order) throws NDCException Validates the product against the maximum quantity restriction.- Parameters:
selectedOfferItemQty- the selectedOfferItemQtyexistingProduct- the existing productproduct- the productorder- the order- Throws:
NDCException- the ndc exception
-
createSelectedAccommodations
void createSelectedAccommodations(ProductModel product, BigDecimal rowSeat, String columnSeat, List<String> transportOfferingCodes, TravellerModel traveller, OrderModel order, String routeCode) throws NDCException Creates a selected accommodation for each transport offering associated to the selected seat. Verifies if the seat belongs to the right class of the fare product, is already present in the order for the same traveller and if it is already occupied by someone else.- Parameters:
product- the productrowSeat- the row seatcolumnSeat- the column seattransportOfferingCodes- the transport offering codestraveller- the travellerorder- the orderrouteCode- the route code- Throws:
NDCException- the ndc exception
-
isSameTransportOfferingList
boolean isSameTransportOfferingList(AbstractOrderEntryModel orderEntry, List<String> transportOfferings, int originDestiRefNumber) Checks if the list of transport offerings is the same with the one in the order entry, together with the originDestinationRefNumber.- Parameters:
orderEntry- the order entrytransportOfferings- the transport offeringsoriginDestiRefNumber- the origin desti ref number- Returns:
- true if the transport offerings and the originDestinationRefNumber is the same.
-
isSamePassenger
Checks if the traveller in the orderEntry is the same.- Parameters:
orderEntry- the order entrytraveller- the traveller- Returns:
- the boolean
-
isAmendedOrderEntry
Checks if the order entry has amend status equal to NEW or CHANGED.- Parameters:
orderEntry- the order entry- Returns:
- the boolean
-
getProductCatalogIdFromBaseSite
Gets product catalog id from baseSite.- Returns:
- the product catalog
- Throws:
NDCException- the ndc exception
-
createOrderEntry
OrderEntryModel createOrderEntry(OrderModel order, ProductModel product, Set<Integer> orderEntryGroupNumber, List<TransportOfferingModel> transportOfferings, TravellerModel traveller, String routeCode, int originDestinationRefNumber, long quantity, Integer bundleNumber, BundleTemplateModel bundleTemplate) Creates an order entry.- Parameters:
order- the orderproduct- the productorderEntryGroupNumber- the order entry group numbertransportOfferings- the transport offeringstraveller- the travellerrouteCode- the route codeoriginDestinationRefNumber- the origin destination ref numberquantity- the quantitybundleNumber- the bundleNumberbundleTemplate- the bundleTemplate- Returns:
- the order entry model
-
updateEntriesAmendStatus
Update entries amend status.- Parameters:
entries- the entriesstatus- the status
-
isAmendmentOrder
Is amendment order boolean.- Parameters:
orderModel- the order model- Returns:
- the boolean
-
getOriginalOrderCode
Gets original order code.- Parameters:
orderModel- the order model- Returns:
- the original order code
-