Interface ConsignmentTrackingService
- All Known Implementing Classes:
DefaultConsignmentTrackingService
public interface ConsignmentTrackingService
Service that provide consignment tracking related methods.
-
Method Summary
Modifier and TypeMethodDescriptionGet all carrier adaptors.getConsignmentEvents(ConsignmentModel consignment) used by controller to handle incremental routes from carriergetConsignmentForCode(String orderCode, String consignmentCode) Query a ConsignmentModel for code.getConsignmentsForOrder(String orderCode) Get all consignments under the orderintgetDeliveryLeadTime(ConsignmentModel consignment) provide the lead time of estimation from shipped to arrivalgetTrackingUrlForConsignment(ConsignmentModel consignment) tracking URL is given for display in frontend, if user wants to track package by jumping to carrier's websitebooleanisTrackingIdValid(ConsignmentModel consignment) check if the tracking ID is valid in a carrier providervoidupdateConsignmentStatusForCode(String orderCode, String consignmentCode, ConsignmentStatus status) update consignment status and set arrival date if complete
-
Method Details
-
getTrackingUrlForConsignment
tracking URL is given for display in frontend, if user wants to track package by jumping to carrier's website- Parameters:
consignment- the specific consignment- Returns:
- tracking URL
-
isTrackingIdValid
check if the tracking ID is valid in a carrier provider- Parameters:
consignment- the specific consignment- Returns:
- true if valid, otherwise false
-
getConsignmentEvents
used by controller to handle incremental routes from carrier- Parameters:
consignment- the specific consignment- Returns:
- latest consignment events
-
getConsignmentForCode
Query a ConsignmentModel for code.- Parameters:
orderCode- the code of this consignment's orderconsignmentCode- code of consignment- Returns:
- a instance of ConsignmentModel
-
updateConsignmentStatusForCode
void updateConsignmentStatusForCode(String orderCode, String consignmentCode, ConsignmentStatus status) update consignment status and set arrival date if complete- Parameters:
orderCode- the code of this consignment's orderconsignmentCode- the specific consignmentCodestatus- the new status from carrier
-
getDeliveryLeadTime
provide the lead time of estimation from shipped to arrival- Parameters:
consignment- the specific consignment- Returns:
- days of the lead time
-
getAllCarrierAdaptors
Map<String,CarrierAdaptor> getAllCarrierAdaptors()Get all carrier adaptors.- Returns:
- map of adaptors.
-
getConsignmentsForOrder
Get all consignments under the order- Parameters:
orderCode- the order code- Returns:
- all consignment for the order
-