Interface ConsignmentTrackingService

All Known Implementing Classes:
DefaultConsignmentTrackingService

public interface ConsignmentTrackingService
Service that provide consignment tracking related methods.
  • Method Details

    • getTrackingUrlForConsignment

      URL getTrackingUrlForConsignment(ConsignmentModel consignment)
      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

      boolean isTrackingIdValid(ConsignmentModel consignment)
      check if the tracking ID is valid in a carrier provider
      Parameters:
      consignment - the specific consignment
      Returns:
      true if valid, otherwise false
    • getConsignmentEvents

      List<ConsignmentEventData> getConsignmentEvents(ConsignmentModel consignment)
      used by controller to handle incremental routes from carrier
      Parameters:
      consignment - the specific consignment
      Returns:
      latest consignment events
    • getConsignmentForCode

      Optional<ConsignmentModel> getConsignmentForCode(String orderCode, String consignmentCode)
      Query a ConsignmentModel for code.
      Parameters:
      orderCode - the code of this consignment's order
      consignmentCode - 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 order
      consignmentCode - the specific consignmentCode
      status - the new status from carrier
    • getDeliveryLeadTime

      int getDeliveryLeadTime(ConsignmentModel consignment)
      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

      List<ConsignmentModel> getConsignmentsForOrder(String orderCode)
      Get all consignments under the order
      Parameters:
      orderCode - the order code
      Returns:
      all consignment for the order