OrderRepositoryInterface.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. use Temando\Shipping\Model\OrderInterface;
  7. use Temando\Shipping\Api\Data\Order\OrderReferenceInterface;
  8. /**
  9. * Temando Order Repository Interface.
  10. *
  11. * An order entity is created at the Temando platform as soon as shipping rates
  12. * are requested from the API. A reference to the external order is stored
  13. * locally.
  14. *
  15. * This public interface can be used to create/update orders at the Temando
  16. * platform as well as creating/reading/updating the local reference.
  17. *
  18. * @package Temando\Shipping\Model
  19. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  20. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  21. * @link http://www.temando.com/
  22. */
  23. interface OrderRepositoryInterface
  24. {
  25. /**
  26. * @param \Temando\Shipping\Model\OrderInterface $order
  27. * @return \Temando\Shipping\Webservice\Response\Type\OrderResponseType
  28. * @throws \Magento\Framework\Exception\CouldNotSaveException
  29. */
  30. public function save(OrderInterface $order);
  31. /**
  32. * @param \Temando\Shipping\Api\Data\Order\OrderReferenceInterface $orderReference
  33. * @return \Temando\Shipping\Api\Data\Order\OrderReferenceInterface
  34. * @throws \Magento\Framework\Exception\CouldNotSaveException
  35. */
  36. public function saveReference(OrderReferenceInterface $orderReference);
  37. /**
  38. * @param string $orderId Temando Order ID
  39. * @return \Temando\Shipping\Api\Data\Order\OrderReferenceInterface
  40. * @throws \Magento\Framework\Exception\NoSuchEntityException
  41. */
  42. public function getReferenceByExtOrderId($orderId);
  43. /**
  44. * @param int $orderId
  45. * @return \Temando\Shipping\Api\Data\Order\OrderReferenceInterface
  46. * @throws \Magento\Framework\Exception\NoSuchEntityException
  47. */
  48. public function getReferenceByOrderId($orderId);
  49. }