Skip to content

Commit dab08ab

Browse files
committed
MAGETWO-55657: Implement new service OrderInvoice
- rename exception classes - fix statics
1 parent 87381c7 commit dab08ab

21 files changed

+135
-198
lines changed

app/code/Magento/Sales/Model/Order/SalesOperationFailedException.php renamed to app/code/Magento/Sales/Api/CouldNotInvoiceException.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Sales\Model\Order;
7+
namespace Magento\Sales\Api;
88

99
use Magento\Framework\Exception\LocalizedException;
1010

1111
/**
12-
* Class SalesOperationFailedException
12+
* Class CouldNotInvoiceException
13+
* @api
1314
*/
14-
class SalesOperationFailedException extends LocalizedException
15+
class CouldNotInvoiceException extends LocalizedException
1516
{
17+
1618
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
/**
1010
* Interface InvoiceCommentCreationInterface
11+
*
12+
* @api
1113
*/
1214
interface InvoiceCommentCreationInterface extends \Magento\Sales\Api\Data\CommentInterface
1315
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @api
1414
*/
1515
interface InvoiceCommentInterface extends
16-
\Magento\Framework\Api\ExtensibleDataInterface, \Magento\Sales\Api\Data\InvoiceCommentCreationInterface
16+
\Magento\Framework\Api\ExtensibleDataInterface, \Magento\Sales\Api\Data\InvoiceCommentCreationInterface
1717
{
1818
/**#@+
1919
* Constants for keys of data array. Identical to the name of the getter in snake case.

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,6 @@ interface InvoiceInterface extends \Magento\Framework\Api\ExtensibleDataInterfac
201201
*/
202202
const COMMENTS = 'comments';
203203

204-
/**
205-
* Invoice states
206-
*/
207-
const STATE_OPEN = 1;
208-
209-
const STATE_PAID = 2;
210-
211-
const STATE_CANCELED = 3;
212-
213204
/**
214205
* Gets the base currency code for the invoice.
215206
*

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Input argument for invoice creation
1111
*
1212
* Interface InvoiceItemCreationInterface
13+
*
14+
* @api
1315
*/
1416
interface InvoiceItemCreationInterface extends LineItemInterface
1517
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ interface InvoiceItemInterface extends \Magento\Sales\Api\Data\InvoiceItemCreati
113113
* Base discount tax compensation amount.
114114
*/
115115
const BASE_DISCOUNT_TAX_COMPENSATION_AMOUNT = 'base_discount_tax_compensation_amount';
116+
116117
/**
117118
* Invoice
118119
*/
119120
const INVOICE = 'invoice';
121+
120122
/**
121123
* Gets the additional data for the invoice item.
122124
*

app/code/Magento/Sales/Model/Order/SalesDocumentValidationException.php renamed to app/code/Magento/Sales/Api/DocumentValidationException.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Sales\Model\Order;
7+
namespace Magento\Sales\Api;
88

99
use Magento\Framework\Exception\LocalizedException;
1010

1111
/**
12-
* Class SalesDocumentValidationException
12+
* Class DocumentValidationException
13+
* @api
1314
*/
14-
class SalesDocumentValidationException extends LocalizedException
15+
class DocumentValidationException extends LocalizedException
1516
{
1617
}

app/code/Magento/Sales/Api/OrderInvoiceInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
/**
1010
* Class OrderInvoiceInterface
11-
* Should be part of OrderManagementInterface::invoice()
1211
*
1312
* @api
1413
*/

app/code/Magento/Sales/Model/Order/Invoice.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
*/
2323
class Invoice extends AbstractModel implements EntityInterface, InvoiceInterface
2424
{
25+
/**#@+
26+
* Invoice states
27+
*/
28+
const STATE_OPEN = 1;
29+
30+
const STATE_PAID = 2;
31+
32+
const STATE_CANCELED = 3;
33+
/**#@-*/
34+
2535
const CAPTURE_ONLINE = 'online';
2636

2737
const CAPTURE_OFFLINE = 'offline';

app/code/Magento/Sales/Model/Order/Invoice/NotifierInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © 2016 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Sales\Model\Order\Invoice;
78

89
/**

0 commit comments

Comments
 (0)