ShipmentReferenceRepositoryInterface.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Model\ResourceModel\Repository;
  6. /**
  7. * Temando Shipment Reference Repository Interface.
  8. *
  9. * A shipment entity is registered at the Temando platform in order to create
  10. * shipping labels and other documentation. A reference to the external shipment
  11. * is stored locally.
  12. *
  13. * This interface can be used to create/read/update the local reference.
  14. *
  15. * @package Temando\Shipping\Model
  16. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  17. * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  18. * @link https://www.temando.com/
  19. */
  20. interface ShipmentReferenceRepositoryInterface
  21. {
  22. /**
  23. * Load local track info.
  24. *
  25. * @param string $trackingNumber
  26. * @param string $carrierCode
  27. * @return \Magento\Sales\Api\Data\ShipmentTrackInterface
  28. * @throws \Magento\Framework\Exception\LocalizedException
  29. */
  30. public function getShipmentTrack($trackingNumber, $carrierCode);
  31. /**
  32. * Save local reference to external shipment entity.
  33. *
  34. * @param \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface $shipment
  35. * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
  36. * @throws \Magento\Framework\Exception\CouldNotSaveException
  37. */
  38. public function save(\Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface $shipment);
  39. /**
  40. * Load local reference to external shipment entity.
  41. *
  42. * @param int $entityId
  43. * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
  44. * @throws \Magento\Framework\Exception\NoSuchEntityException
  45. */
  46. public function getById($entityId);
  47. /**
  48. * Load local reference to external shipment entity by Magento shipment ID.
  49. *
  50. * @param int $shipmentId
  51. * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
  52. * @throws \Magento\Framework\Exception\NoSuchEntityException
  53. */
  54. public function getByShipmentId($shipmentId);
  55. /**
  56. * Load local reference to external shipment entity by Temando shipment ID.
  57. *
  58. * @param string $extShipmentId
  59. * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
  60. * @throws \Magento\Framework\Exception\NoSuchEntityException
  61. */
  62. public function getByExtShipmentId($extShipmentId);
  63. /**
  64. * Load local reference to external shipment entity by Temando return shipment ID.
  65. *
  66. * @param string $extShipmentId
  67. *
  68. * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
  69. * @throws \Magento\Framework\Exception\NoSuchEntityException
  70. */
  71. public function getByExtReturnShipmentId($extShipmentId);
  72. /**
  73. * List shipment references that match specified search criteria.
  74. *
  75. * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
  76. * @return \Temando\Shipping\Model\ResourceModel\Shipment\ShipmentReferenceCollection
  77. */
  78. public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
  79. }