Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat(ImportOrder): add custom fields to ImportOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed Oct 28, 2015
1 parent 26c9626 commit 008702f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model/Common/PriceDraftCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
/**
* @package Commercetools\Core\Model\Common
*
* @method PriceDraft getAt($offset)
* @method PriceDraftCollection add(PriceDraft $element)
* @method PriceDraft current()
* @method PriceDraft getAt($offset)
*/
class PriceDraftCollection extends Collection
{
Expand Down
4 changes: 4 additions & 0 deletions src/Model/Order/ImportOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Commercetools\Core\Model\CustomerGroup\CustomerGroupReference;
use Commercetools\Core\Model\Cart\ShippingInfo;
use Commercetools\Core\Model\Common\DateTimeDecorator;
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft;

/**
* @package Commercetools\Core\Model\Order
Expand Down Expand Up @@ -48,6 +49,8 @@
* @method ImportOrder setShippingInfo(ShippingInfo $shippingInfo = null)
* @method DateTimeDecorator getCompletedAt()
* @method ImportOrder setCompletedAt(\DateTime $completedAt = null)
* @method CustomFieldObjectDraft getCustom()
* @method ImportOrder setCustom(CustomFieldObjectDraft $custom = null)
*/
class ImportOrder extends JsonObject
{
Expand All @@ -73,6 +76,7 @@ public function fieldDefinitions()
static::TYPE => '\DateTime',
static::DECORATOR => '\Commercetools\Core\Model\Common\DateTimeDecorator'
],
'custom' => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObjectDraft']
];
}
}
4 changes: 4 additions & 0 deletions src/Model/Order/LineItemImportDraft.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Commercetools\Core\Model\Common\Price;
use Commercetools\Core\Model\Channel\ChannelReference;
use Commercetools\Core\Model\TaxCategory\TaxRate;
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft;

/**
* @package Commercetools\Core\Model\Order
Expand All @@ -29,6 +30,8 @@
* @method LineItemImportDraft setSupplyChannel(ChannelReference $supplyChannel = null)
* @method TaxRate getTaxRate()
* @method LineItemImportDraft setTaxRate(TaxRate $taxRate = null)
* @method CustomFieldObjectDraft getCustom()
* @method LineItemImportDraft setCustom(CustomFieldObjectDraft $custom = null)
*/
class LineItemImportDraft extends JsonObject
{
Expand All @@ -43,6 +46,7 @@ public function fieldDefinitions()
'state' => [static::TYPE => '\Commercetools\Core\Model\Order\ItemStateCollection'],
'supplyChannel' => [static::TYPE => '\Commercetools\Core\Model\Channel\ChannelReference'],
'taxRate' => [static::TYPE => '\Commercetools\Core\Model\TaxCategory\TaxRate'],
'custom' => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObjectDraft']
];
}
}
2 changes: 2 additions & 0 deletions tests/fixtures/models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ importOrder:
- paymentState
- shippingInfo
- completedAt
- custom

lineItemImportDraft:
domain: order
Expand All @@ -836,6 +837,7 @@ lineItemImportDraft:
- state
- supplyChannel
- taxRate
- custom

productVariantImportDraft:
domain: order
Expand Down

0 comments on commit 008702f

Please # to comment.