SalesEventInterface.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\InventorySalesApi\Api\Data;
  8. /**
  9. * Represents the sales event that brings to appending reservations.
  10. *
  11. * @api
  12. */
  13. interface SalesEventInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  14. {
  15. /**#@+
  16. * Constants for event types
  17. */
  18. const EVENT_ORDER_PLACED = 'order_placed';
  19. const EVENT_ORDER_CANCELED = 'order_canceled';
  20. const EVENT_SHIPMENT_CREATED = 'shipment_created';
  21. const EVENT_CREDITMEMO_CREATED = 'creditmemo_created';
  22. const EVENT_INVOICE_CREATED = 'invoice_created';
  23. /**#@-*/
  24. /**#@+
  25. * Constants for event object types
  26. */
  27. const OBJECT_TYPE_ORDER = 'order';
  28. /**#@-*/
  29. /**
  30. * @return string
  31. */
  32. public function getType(): string;
  33. /**
  34. * @return string
  35. */
  36. public function getObjectType(): string;
  37. /**
  38. * @return string
  39. */
  40. public function getObjectId(): string;
  41. /**
  42. * Retrieve existing extension attributes object
  43. *
  44. * @return \Magento\InventorySalesApi\Api\Data\SalesEventExtensionInterface|null
  45. */
  46. public function getExtensionAttributes(): ?\Magento\InventorySalesApi\Api\Data\SalesEventExtensionInterface;
  47. /**
  48. * Set an extension attributes object
  49. *
  50. * @param \Magento\InventorySalesApi\Api\Data\SalesEventExtensionInterface $extensionAttributes
  51. * @return void
  52. */
  53. public function setExtensionAttributes(
  54. \Magento\InventorySalesApi\Api\Data\SalesEventExtensionInterface $extensionAttributes
  55. ): void;
  56. }