This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Order): add actions to update customer email, shipping and billi…
…ng address for orders Closes #238
- Loading branch information
Jens Schulze
committed
Aug 8, 2016
1 parent
4deb11f
commit 23e0193
Showing
28 changed files
with
330 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* @author @jayS-de <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
namespace Commercetools\Core\Model\Message; | ||
|
||
use Commercetools\Core\Model\Common\DateTimeDecorator; | ||
use Commercetools\Core\Model\Common\Reference; | ||
use Commercetools\Core\Model\Common\Address; | ||
|
||
/** | ||
* @package Commercetools\Core\Model\Message | ||
* @link https://dev.commercetools.com/http-api-projects-messages.html#orderbillingaddressset-message | ||
* | ||
* @method string getId() | ||
* @method OrderBillingAddressSetMessage setId(string $id = null) | ||
* @method int getVersion() | ||
* @method OrderBillingAddressSetMessage setVersion(int $version = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method OrderBillingAddressSetMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method DateTimeDecorator getLastModifiedAt() | ||
* @method OrderBillingAddressSetMessage setLastModifiedAt(\DateTime $lastModifiedAt = null) | ||
* @method int getSequenceNumber() | ||
* @method OrderBillingAddressSetMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method OrderBillingAddressSetMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method OrderBillingAddressSetMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method OrderBillingAddressSetMessage setType(string $type = null) | ||
* @method Address getAddress() | ||
* @method OrderBillingAddressSetMessage setAddress(Address $address = null) | ||
*/ | ||
class OrderBillingAddressSetMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'OrderBillingAddressSet'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['address'] = [static::TYPE => '\Commercetools\Core\Model\Common\Address']; | ||
|
||
return $definitions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* @author @jayS-de <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
namespace Commercetools\Core\Model\Message; | ||
|
||
use Commercetools\Core\Model\Common\DateTimeDecorator; | ||
use Commercetools\Core\Model\Common\Reference; | ||
|
||
/** | ||
* @package Commercetools\Core\Model\Message | ||
* @link https://dev.commercetools.com/http-api-projects-messages.html#ordercustomeremailset-message | ||
* | ||
* @method string getId() | ||
* @method OrderCustomerEmailSetMessage setId(string $id = null) | ||
* @method int getVersion() | ||
* @method OrderCustomerEmailSetMessage setVersion(int $version = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method OrderCustomerEmailSetMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method DateTimeDecorator getLastModifiedAt() | ||
* @method OrderCustomerEmailSetMessage setLastModifiedAt(\DateTime $lastModifiedAt = null) | ||
* @method int getSequenceNumber() | ||
* @method OrderCustomerEmailSetMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method OrderCustomerEmailSetMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method OrderCustomerEmailSetMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method OrderCustomerEmailSetMessage setType(string $type = null) | ||
* @method string getEmail() | ||
* @method OrderCustomerEmailSetMessage setEmail(string $email = null) | ||
*/ | ||
class OrderCustomerEmailSetMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'OrderCustomerEmailSet'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['email'] = [static::TYPE => 'string']; | ||
|
||
return $definitions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* @author @jayS-de <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
namespace Commercetools\Core\Model\Message; | ||
|
||
use Commercetools\Core\Model\Common\DateTimeDecorator; | ||
use Commercetools\Core\Model\Common\Reference; | ||
use Commercetools\Core\Model\Common\Address; | ||
|
||
/** | ||
* @package Commercetools\Core\Model\Message | ||
* @link https://dev.commercetools.com/http-api-projects-messages.html#ordershippingaddressset-message | ||
* | ||
* @method string getId() | ||
* @method OrderShippingAddressSetMessage setId(string $id = null) | ||
* @method int getVersion() | ||
* @method OrderShippingAddressSetMessage setVersion(int $version = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method OrderShippingAddressSetMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method DateTimeDecorator getLastModifiedAt() | ||
* @method OrderShippingAddressSetMessage setLastModifiedAt(\DateTime $lastModifiedAt = null) | ||
* @method int getSequenceNumber() | ||
* @method OrderShippingAddressSetMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method OrderShippingAddressSetMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method OrderShippingAddressSetMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method OrderShippingAddressSetMessage setType(string $type = null) | ||
* @method Address getAddress() | ||
* @method OrderShippingAddressSetMessage setAddress(Address $address = null) | ||
*/ | ||
class OrderShippingAddressSetMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'OrderShippingAddressSet'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['address'] = [static::TYPE => '\Commercetools\Core\Model\Common\Address']; | ||
|
||
return $definitions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* @author @jayS-de <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
namespace Commercetools\Core\Request\Orders\Command; | ||
|
||
use Commercetools\Core\Model\Common\Context; | ||
use Commercetools\Core\Request\AbstractAction; | ||
use Commercetools\Core\Model\Common\Address; | ||
|
||
/** | ||
* @package Commercetools\Core\Request\Orders\Command | ||
* | ||
* @method string getAction() | ||
* @method OrderSetBillingAddress setAction(string $action = null) | ||
* @method Address getAddress() | ||
* @method OrderSetBillingAddress setAddress(Address $address = null) | ||
*/ | ||
class OrderSetBillingAddress extends AbstractAction | ||
{ | ||
public function fieldDefinitions() | ||
{ | ||
return [ | ||
'action' => [static::TYPE => 'string'], | ||
'address' => [static::TYPE => '\Commercetools\Core\Model\Common\Address'], | ||
]; | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @param Context|callable $context | ||
*/ | ||
public function __construct(array $data = [], $context = null) | ||
{ | ||
parent::__construct($data, $context); | ||
$this->setAction('setBillingAddress'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* @author @jayS-de <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
namespace Commercetools\Core\Request\Orders\Command; | ||
|
||
use Commercetools\Core\Model\Common\Context; | ||
use Commercetools\Core\Request\AbstractAction; | ||
|
||
/** | ||
* @package Commercetools\Core\Request\Orders\Command | ||
* | ||
* @method string getAction() | ||
* @method OrderSetCustomerEmail setAction(string $action = null) | ||
* @method string getEmail() | ||
* @method OrderSetCustomerEmail setEmail(string $email = null) | ||
*/ | ||
class OrderSetCustomerEmail extends AbstractAction | ||
{ | ||
public function fieldDefinitions() | ||
{ | ||
return [ | ||
'action' => [static::TYPE => 'string'], | ||
'email' => [static::TYPE => 'string'], | ||
]; | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @param Context|callable $context | ||
*/ | ||
public function __construct(array $data = [], $context = null) | ||
{ | ||
parent::__construct($data, $context); | ||
$this->setAction('setCustomerEmail'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* @author @jayS-de <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
namespace Commercetools\Core\Request\Orders\Command; | ||
|
||
use Commercetools\Core\Model\Common\Context; | ||
use Commercetools\Core\Request\AbstractAction; | ||
use Commercetools\Core\Model\Common\Address; | ||
|
||
/** | ||
* @package Commercetools\Core\Request\Orders\Command | ||
* | ||
* @method string getAction() | ||
* @method OrderSetShippingAddress setAction(string $action = null) | ||
* @method Address getAddress() | ||
* @method OrderSetShippingAddress setAddress(Address $address = null) | ||
*/ | ||
class OrderSetShippingAddress extends AbstractAction | ||
{ | ||
public function fieldDefinitions() | ||
{ | ||
return [ | ||
'action' => [static::TYPE => 'string'], | ||
'address' => [static::TYPE => '\Commercetools\Core\Model\Common\Address'], | ||
]; | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @param Context|callable $context | ||
*/ | ||
public function __construct(array $data = [], $context = null) | ||
{ | ||
parent::__construct($data, $context); | ||
$this->setAction('setShippingAddress'); | ||
} | ||
} |
Oops, something went wrong.