ShipmentReferenceRepositoryInterface.php 3.09 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
<?php
/**
 * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
 */
namespace Temando\Shipping\Model\ResourceModel\Repository;

/**
 * Temando Shipment Reference Repository Interface.
 *
 * A shipment entity is registered at the Temando platform in order to create
 * shipping labels and other documentation. A reference to the external shipment
 * is stored locally.
 *
 * This interface can be used to create/read/update the local reference.
 *
 * @package Temando\Shipping\Model
 * @author  Christoph Aßmann <christoph.assmann@netresearch.de>
 * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @link    https://www.temando.com/
 */
interface ShipmentReferenceRepositoryInterface
{
    /**
     * Load local track info.
     *
     * @param string $trackingNumber
     * @param string $carrierCode
     * @return \Magento\Sales\Api\Data\ShipmentTrackInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function getShipmentTrack($trackingNumber, $carrierCode);

    /**
     * Save local reference to external shipment entity.
     *
     * @param \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface $shipment
     * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
     * @throws \Magento\Framework\Exception\CouldNotSaveException
     */
    public function save(\Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface $shipment);

    /**
     * Load local reference to external shipment entity.
     *
     * @param int $entityId
     * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     */
    public function getById($entityId);

    /**
     * Load local reference to external shipment entity by Magento shipment ID.
     *
     * @param int $shipmentId
     * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     */
    public function getByShipmentId($shipmentId);

    /**
     * Load local reference to external shipment entity by Temando shipment ID.
     *
     * @param string $extShipmentId
     * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     */
    public function getByExtShipmentId($extShipmentId);

    /**
     * Load local reference to external shipment entity by Temando return shipment ID.
     *
     * @param string $extShipmentId
     *
     * @return \Temando\Shipping\Api\Data\Shipment\ShipmentReferenceInterface
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     */
    public function getByExtReturnShipmentId($extShipmentId);

    /**
     * List shipment references that match specified search criteria.
     *
     * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
     * @return \Temando\Shipping\Model\ResourceModel\Shipment\ShipmentReferenceCollection
     */
    public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
}