Skip to content

Commit 83d6a78

Browse files
committed
MAGETWO-56429: Shipment creation through API change order status. Back port for 2.0.x
1 parent dac894b commit 83d6a78

File tree

71 files changed

+3765
-453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3765
-453
lines changed

app/code/Magento/Sales/Api/Data/CommentInterface.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
*/
1313
interface CommentInterface
1414
{
15+
/*
16+
* Is-visible-on-storefront flag.
17+
*/
18+
const IS_VISIBLE_ON_FRONT = 'is_visible_on_front';
19+
20+
/*
21+
* Comment.
22+
*/
23+
const COMMENT = 'comment';
24+
1525
/**
1626
* Gets the comment for the invoice.
1727
*
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Sales\Api\Data;
7+
8+
/**
9+
* Interface EntityInterface
10+
* @api
11+
*/
12+
interface EntityInterface
13+
{
14+
/*
15+
* Entity ID.
16+
*/
17+
const ENTITY_ID = 'entity_id';
18+
19+
/*
20+
* Created-at timestamp.
21+
*/
22+
const CREATED_AT = 'created_at';
23+
24+
/**
25+
* Gets the created-at timestamp for the invoice.
26+
*
27+
* @return string|null Created-at timestamp.
28+
*/
29+
public function getCreatedAt();
30+
31+
/**
32+
* Sets the created-at timestamp for the invoice.
33+
*
34+
* @param string $createdAt timestamp
35+
* @return $this
36+
*/
37+
public function setCreatedAt($createdAt);
38+
39+
/**
40+
* Gets the ID for the invoice.
41+
*
42+
* @return int|null Invoice ID.
43+
*/
44+
public function getEntityId();
45+
46+
/**
47+
* Sets entity ID.
48+
*
49+
* @param int $entityId
50+
* @return $this
51+
*/
52+
public function setEntityId($entityId);
53+
}

app/code/Magento/Sales/Api/Data/InvoiceCommentCreationInterface.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,29 @@
66

77
namespace Magento\Sales\Api\Data;
88

9+
use Magento\Framework\Api\ExtensibleDataInterface;
10+
911
/**
1012
* Interface InvoiceCommentCreationInterface
1113
*
1214
* @api
1315
*/
14-
interface InvoiceCommentCreationInterface extends \Magento\Sales\Api\Data\CommentInterface
16+
interface InvoiceCommentCreationInterface extends ExtensibleDataInterface, CommentInterface
1517
{
18+
/**
19+
* Retrieve existing extension attributes object or create a new one.
20+
*
21+
* @return \Magento\Sales\Api\Data\InvoiceCommentCreationExtensionInterface|null
22+
*/
23+
public function getExtensionAttributes();
1624

25+
/**
26+
* Set an extension attributes object.
27+
*
28+
* @param \Magento\Sales\Api\Data\InvoiceCommentCreationExtensionInterface $extensionAttributes
29+
* @return $this
30+
*/
31+
public function setExtensionAttributes(
32+
\Magento\Sales\Api\Data\InvoiceCommentCreationExtensionInterface $extensionAttributes
33+
);
1734
}

app/code/Magento/Sales/Api/Data/InvoiceCommentInterface.php

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,20 @@
55
*/
66
namespace Magento\Sales\Api\Data;
77

8+
use Magento\Framework\Api\ExtensibleDataInterface;
9+
810
/**
911
* Invoice comment interface.
1012
*
1113
* An invoice is a record of the receipt of payment for an order. An invoice can include comments that detail the
1214
* invoice history.
1315
* @api
1416
*/
15-
interface InvoiceCommentInterface extends \Magento\Framework\Api\ExtensibleDataInterface,
16-
\Magento\Sales\Api\Data\InvoiceCommentCreationInterface
17+
interface InvoiceCommentInterface extends ExtensibleDataInterface, CommentInterface, EntityInterface
1718
{
1819
/**#@+
1920
* Constants for keys of data array. Identical to the name of the getter in snake case.
2021
*/
21-
/*
22-
* Entity ID.
23-
*/
24-
const ENTITY_ID = 'entity_id';
2522
/*
2623
* Parent ID.
2724
*/
@@ -30,48 +27,6 @@ interface InvoiceCommentInterface extends \Magento\Framework\Api\ExtensibleDataI
3027
* Is-customer-notified flag.
3128
*/
3229
const IS_CUSTOMER_NOTIFIED = 'is_customer_notified';
33-
/*
34-
* Is-visible-on-storefront flag.
35-
*/
36-
const IS_VISIBLE_ON_FRONT = 'is_visible_on_front';
37-
/*
38-
* Comment.
39-
*/
40-
const COMMENT = 'comment';
41-
/*
42-
* Created-at timestamp.
43-
*/
44-
const CREATED_AT = 'created_at';
45-
46-
/**
47-
* Gets the created-at timestamp for the invoice.
48-
*
49-
* @return string|null Created-at timestamp.
50-
*/
51-
public function getCreatedAt();
52-
53-
/**
54-
* Sets the created-at timestamp for the invoice.
55-
*
56-
* @param string $createdAt timestamp
57-
* @return $this
58-
*/
59-
public function setCreatedAt($createdAt);
60-
61-
/**
62-
* Gets the ID for the invoice.
63-
*
64-
* @return int|null Invoice ID.
65-
*/
66-
public function getEntityId();
67-
68-
/**
69-
* Sets entity ID.
70-
*
71-
* @param int $entityId
72-
* @return $this
73-
*/
74-
public function setEntityId($entityId);
7530

7631
/**
7732
* Gets the is-customer-notified flag value for the invoice.

app/code/Magento/Sales/Api/Data/InvoiceItemCreationInterface.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,31 @@
66

77
namespace Magento\Sales\Api\Data;
88

9+
use Magento\Framework\Api\ExtensibleDataInterface;
10+
911
/**
1012
* Input argument for invoice creation
1113
*
1214
* Interface InvoiceItemCreationInterface
1315
*
1416
* @api
1517
*/
16-
interface InvoiceItemCreationInterface extends LineItemInterface
18+
interface InvoiceItemCreationInterface extends LineItemInterface, ExtensibleDataInterface
1719
{
20+
/**
21+
* Retrieve existing extension attributes object or create a new one.
22+
*
23+
* @return \Magento\Sales\Api\Data\InvoiceItemCreationExtensionInterface|null
24+
*/
25+
public function getExtensionAttributes();
1826

27+
/**
28+
* Set an extension attributes object.
29+
*
30+
* @param \Magento\Sales\Api\Data\InvoiceItemCreationExtensionInterface $extensionAttributes
31+
* @return $this
32+
*/
33+
public function setExtensionAttributes(
34+
\Magento\Sales\Api\Data\InvoiceItemCreationExtensionInterface $extensionAttributes
35+
);
1936
}

app/code/Magento/Sales/Api/Data/InvoiceItemInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
*/
66
namespace Magento\Sales\Api\Data;
77

8+
use Magento\Framework\Api\ExtensibleDataInterface;
9+
810
/**
911
* Invoice item interface.
1012
*
1113
* An invoice is a record of the receipt of payment for an order. An invoice item is a purchased item in an invoice.
1214
* @api
1315
*/
14-
interface InvoiceItemInterface extends \Magento\Sales\Api\Data\InvoiceItemCreationInterface,
15-
\Magento\Framework\Api\ExtensibleDataInterface
16+
interface InvoiceItemInterface extends ExtensibleDataInterface, LineItemInterface
1617
{
1718
/**#@+
1819
* Constants for keys of data array. Identical to the name of the getter in snake case.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Sales\Api\Data;
7+
8+
use Magento\Framework\Api\ExtensibleDataInterface;
9+
10+
/**
11+
* Interface ShipmentCommentCreationInterface
12+
* @api
13+
*/
14+
interface ShipmentCommentCreationInterface extends ExtensibleDataInterface, CommentInterface
15+
{
16+
/**
17+
* Retrieve existing extension attributes object or create a new one.
18+
*
19+
* @return \Magento\Sales\Api\Data\ShipmentCommentCreationExtensionInterface|null
20+
*/
21+
public function getExtensionAttributes();
22+
23+
/**
24+
* Set an extension attributes object.
25+
*
26+
* @param \Magento\Sales\Api\Data\ShipmentCommentCreationExtensionInterface $extensionAttributes
27+
* @return $this
28+
*/
29+
public function setExtensionAttributes(
30+
\Magento\Sales\Api\Data\ShipmentCommentCreationExtensionInterface $extensionAttributes
31+
);
32+
}

app/code/Magento/Sales/Api/Data/ShipmentCommentInterface.php

Lines changed: 3 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@
55
*/
66
namespace Magento\Sales\Api\Data;
77

8+
use Magento\Framework\Api\ExtensibleDataInterface;
9+
810
/**
911
* Shipment comment interface.
1012
*
1113
* A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This
1214
* document lists the products and their quantities in the delivery package. A shipment document can contain comments.
1315
* @api
1416
*/
15-
interface ShipmentCommentInterface extends \Magento\Framework\Api\ExtensibleDataInterface
17+
interface ShipmentCommentInterface extends ExtensibleDataInterface, CommentInterface, EntityInterface
1618
{
1719
/**#@+
1820
* Constants for keys of data array. Identical to the name of the getter in snake case.
1921
*/
20-
/*
21-
* Entity ID.
22-
*/
23-
const ENTITY_ID = 'entity_id';
2422
/*
2523
* Parent ID.
2624
*/
@@ -29,55 +27,6 @@ interface ShipmentCommentInterface extends \Magento\Framework\Api\ExtensibleData
2927
* Is-customer-notified flag.
3028
*/
3129
const IS_CUSTOMER_NOTIFIED = 'is_customer_notified';
32-
/*
33-
* Is-visible-on-storefront flag.
34-
*/
35-
const IS_VISIBLE_ON_FRONT = 'is_visible_on_front';
36-
/*
37-
* Comment.
38-
*/
39-
const COMMENT = 'comment';
40-
/*
41-
* Created-at timestamp.
42-
*/
43-
const CREATED_AT = 'created_at';
44-
45-
/**
46-
* Gets the comment for the shipment.
47-
*
48-
* @return string Comment.
49-
*/
50-
public function getComment();
51-
52-
/**
53-
* Gets the created-at timestamp for the shipment comment.
54-
*
55-
* @return string|null Created-at timestamp.
56-
*/
57-
public function getCreatedAt();
58-
59-
/**
60-
* Sets the created-at timestamp for the shipment comment.
61-
*
62-
* @param string $createdAt timestamp
63-
* @return $this
64-
*/
65-
public function setCreatedAt($createdAt);
66-
67-
/**
68-
* Gets the ID for the shipment comment.
69-
*
70-
* @return int|null Shipment comment ID.
71-
*/
72-
public function getEntityId();
73-
74-
/**
75-
* Sets entity ID.
76-
*
77-
* @param int $entityId
78-
* @return $this
79-
*/
80-
public function setEntityId($entityId);
8130

8231
/**
8332
* Gets the is-customer-notified flag value for the shipment comment.
@@ -86,13 +35,6 @@ public function setEntityId($entityId);
8635
*/
8736
public function getIsCustomerNotified();
8837

89-
/**
90-
* Gets the is-visible-on-storefront flag value for the shipment comment.
91-
*
92-
* @return int Is-visible-on-storefront flag value.
93-
*/
94-
public function getIsVisibleOnFront();
95-
9638
/**
9739
* Gets the parent ID for the shipment comment.
9840
*
@@ -116,22 +58,6 @@ public function setParentId($id);
11658
*/
11759
public function setIsCustomerNotified($isCustomerNotified);
11860

119-
/**
120-
* Sets the is-visible-on-storefront flag value for the shipment comment.
121-
*
122-
* @param int $isVisibleOnFront
123-
* @return $this
124-
*/
125-
public function setIsVisibleOnFront($isVisibleOnFront);
126-
127-
/**
128-
* Sets the comment for the shipment.
129-
*
130-
* @param string $comment
131-
* @return $this
132-
*/
133-
public function setComment($comment);
134-
13561
/**
13662
* Retrieve existing extension attributes object or create a new one.
13763
*

0 commit comments

Comments
 (0)