Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

- :warning: changed property `line` of type `GraphQLErrorLocation` from type `integer` to `number`
- :warning: changed property `column` of type `GraphQLErrorLocation` from type `integer` to `number`
- :warning: changed property `totalPrice` of type `StagedOrder` from type `TypedMoney` to `CentPrecisionMoney`
- :warning: changed property `totalPrice` of type `Order` from type `TypedMoney` to `CentPrecisionMoney`
</details>


Expand Down
8 changes: 4 additions & 4 deletions lib/commercetools-api/src/Models/Order/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
use Commercetools\Api\Models\Common\Address;
use Commercetools\Api\Models\Common\AddressCollection;
use Commercetools\Api\Models\Common\BaseResource;
use Commercetools\Api\Models\Common\CentPrecisionMoney;
use Commercetools\Api\Models\Common\CreatedBy;
use Commercetools\Api\Models\Common\LastModifiedBy;
use Commercetools\Api\Models\Common\TypedMoney;
use Commercetools\Api\Models\CustomerGroup\CustomerGroupReference;
use Commercetools\Api\Models\OrderEdit\StagedOrder;
use Commercetools\Api\Models\Quote\QuoteReference;
Expand Down Expand Up @@ -190,7 +190,7 @@ public function getCustomLineItems();
* <p>Taxes are included if <a href="ctp:api:type:TaxRate">TaxRate</a> <code>includedInPrice</code> is <code>true</code> for each price.</p>
*

* @return null|TypedMoney
* @return null|CentPrecisionMoney
*/
public function getTotalPrice();

Expand Down Expand Up @@ -580,9 +580,9 @@ public function setLineItems(?LineItemCollection $lineItems): void;
public function setCustomLineItems(?CustomLineItemCollection $customLineItems): void;

/**
* @param ?TypedMoney $totalPrice
* @param ?CentPrecisionMoney $totalPrice
*/
public function setTotalPrice(?TypedMoney $totalPrice): void;
public function setTotalPrice(?CentPrecisionMoney $totalPrice): void;

/**
* @param ?TaxedPrice $taxedPrice
Expand Down
18 changes: 9 additions & 9 deletions lib/commercetools-api/src/Models/Order/OrderBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
use Commercetools\Api\Models\Common\AddressCollection;
use Commercetools\Api\Models\Common\BaseResource;
use Commercetools\Api\Models\Common\BaseResourceBuilder;
use Commercetools\Api\Models\Common\CentPrecisionMoney;
use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder;
use Commercetools\Api\Models\Common\CreatedBy;
use Commercetools\Api\Models\Common\CreatedByBuilder;
use Commercetools\Api\Models\Common\LastModifiedBy;
use Commercetools\Api\Models\Common\LastModifiedByBuilder;
use Commercetools\Api\Models\Common\TypedMoney;
use Commercetools\Api\Models\Common\TypedMoneyBuilder;
use Commercetools\Api\Models\CustomerGroup\CustomerGroupReference;
use Commercetools\Api\Models\CustomerGroup\CustomerGroupReferenceBuilder;
use Commercetools\Api\Models\OrderEdit\StagedOrder;
Expand Down Expand Up @@ -148,7 +148,7 @@ final class OrderBuilder implements Builder

/**

* @var null|TypedMoney|TypedMoneyBuilder
* @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder
*/
private $totalPrice;

Expand Down Expand Up @@ -530,11 +530,11 @@ public function getCustomLineItems()
* <p>Taxes are included if <a href="ctp:api:type:TaxRate">TaxRate</a> <code>includedInPrice</code> is <code>true</code> for each price.</p>
*

* @return null|TypedMoney
* @return null|CentPrecisionMoney
*/
public function getTotalPrice()
{
return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
return $this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
}

/**
Expand Down Expand Up @@ -1109,10 +1109,10 @@ public function withCustomLineItems(?CustomLineItemCollection $customLineItems)
}

/**
* @param ?TypedMoney $totalPrice
* @param ?CentPrecisionMoney $totalPrice
* @return $this
*/
public function withTotalPrice(?TypedMoney $totalPrice)
public function withTotalPrice(?CentPrecisionMoney $totalPrice)
{
$this->totalPrice = $totalPrice;

Expand Down Expand Up @@ -1552,7 +1552,7 @@ public function withStoreBuilder(?StoreKeyReferenceBuilder $store)
* @deprecated use withTotalPrice() instead
* @return $this
*/
public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice)
public function withTotalPriceBuilder(?CentPrecisionMoneyBuilder $totalPrice)
{
$this->totalPrice = $totalPrice;

Expand Down Expand Up @@ -1741,7 +1741,7 @@ public function build(): Order
$this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
$this->lineItems,
$this->customLineItems,
$this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
$this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
$this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice,
$this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice,
$this->discountOnTotalPrice instanceof DiscountOnTotalPriceBuilder ? $this->discountOnTotalPrice->build() : $this->discountOnTotalPrice,
Expand Down
18 changes: 9 additions & 9 deletions lib/commercetools-api/src/Models/Order/OrderModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
use Commercetools\Api\Models\Common\AddressModel;
use Commercetools\Api\Models\Common\BaseResource;
use Commercetools\Api\Models\Common\BaseResourceModel;
use Commercetools\Api\Models\Common\CentPrecisionMoney;
use Commercetools\Api\Models\Common\CentPrecisionMoneyModel;
use Commercetools\Api\Models\Common\CreatedBy;
use Commercetools\Api\Models\Common\CreatedByModel;
use Commercetools\Api\Models\Common\LastModifiedBy;
use Commercetools\Api\Models\Common\LastModifiedByModel;
use Commercetools\Api\Models\Common\TypedMoney;
use Commercetools\Api\Models\Common\TypedMoneyModel;
use Commercetools\Api\Models\CustomerGroup\CustomerGroupReference;
use Commercetools\Api\Models\CustomerGroup\CustomerGroupReferenceModel;
use Commercetools\Api\Models\OrderEdit\StagedOrder;
Expand Down Expand Up @@ -147,7 +147,7 @@ final class OrderModel extends JsonObjectModel implements Order

/**
*
* @var ?TypedMoney
* @var ?CentPrecisionMoney
*/
protected $totalPrice;

Expand Down Expand Up @@ -386,7 +386,7 @@ public function __construct(
?StoreKeyReference $store = null,
?LineItemCollection $lineItems = null,
?CustomLineItemCollection $customLineItems = null,
?TypedMoney $totalPrice = null,
?CentPrecisionMoney $totalPrice = null,
?TaxedPrice $taxedPrice = null,
?TaxedPrice $taxedShippingPrice = null,
?DiscountOnTotalPrice $discountOnTotalPrice = null,
Expand Down Expand Up @@ -776,7 +776,7 @@ public function getCustomLineItems()
* <p>Taxes are included if <a href="ctp:api:type:TaxRate">TaxRate</a> <code>includedInPrice</code> is <code>true</code> for each price.</p>
*
*
* @return null|TypedMoney
* @return null|CentPrecisionMoney
*/
public function getTotalPrice()
{
Expand All @@ -786,8 +786,8 @@ public function getTotalPrice()
if (is_null($data)) {
return null;
}
$className = TypedMoneyModel::resolveDiscriminatorClass($data);
$this->totalPrice = $className::of($data);

$this->totalPrice = CentPrecisionMoneyModel::of($data);
}

return $this->totalPrice;
Expand Down Expand Up @@ -1667,9 +1667,9 @@ public function setCustomLineItems(?CustomLineItemCollection $customLineItems):
}

/**
* @param ?TypedMoney $totalPrice
* @param ?CentPrecisionMoney $totalPrice
*/
public function setTotalPrice(?TypedMoney $totalPrice): void
public function setTotalPrice(?CentPrecisionMoney $totalPrice): void
{
$this->totalPrice = $totalPrice;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
use Commercetools\Api\Models\Common\Address;
use Commercetools\Api\Models\Common\AddressBuilder;
use Commercetools\Api\Models\Common\AddressCollection;
use Commercetools\Api\Models\Common\CentPrecisionMoney;
use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder;
use Commercetools\Api\Models\Common\CreatedBy;
use Commercetools\Api\Models\Common\CreatedByBuilder;
use Commercetools\Api\Models\Common\LastModifiedBy;
use Commercetools\Api\Models\Common\LastModifiedByBuilder;
use Commercetools\Api\Models\Common\TypedMoney;
use Commercetools\Api\Models\Common\TypedMoneyBuilder;
use Commercetools\Api\Models\CustomerGroup\CustomerGroupReference;
use Commercetools\Api\Models\CustomerGroup\CustomerGroupReferenceBuilder;
use Commercetools\Api\Models\Order\Order;
Expand Down Expand Up @@ -150,7 +150,7 @@ final class StagedOrderBuilder implements Builder

/**

* @var null|TypedMoney|TypedMoneyBuilder
* @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder
*/
private $totalPrice;

Expand Down Expand Up @@ -532,11 +532,11 @@ public function getCustomLineItems()
* <p>Taxes are included if <a href="ctp:api:type:TaxRate">TaxRate</a> <code>includedInPrice</code> is <code>true</code> for each price.</p>
*

* @return null|TypedMoney
* @return null|CentPrecisionMoney
*/
public function getTotalPrice()
{
return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
return $this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
}

/**
Expand Down Expand Up @@ -1111,10 +1111,10 @@ public function withCustomLineItems(?CustomLineItemCollection $customLineItems)
}

/**
* @param ?TypedMoney $totalPrice
* @param ?CentPrecisionMoney $totalPrice
* @return $this
*/
public function withTotalPrice(?TypedMoney $totalPrice)
public function withTotalPrice(?CentPrecisionMoney $totalPrice)
{
$this->totalPrice = $totalPrice;

Expand Down Expand Up @@ -1554,7 +1554,7 @@ public function withStoreBuilder(?StoreKeyReferenceBuilder $store)
* @deprecated use withTotalPrice() instead
* @return $this
*/
public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice)
public function withTotalPriceBuilder(?CentPrecisionMoneyBuilder $totalPrice)
{
$this->totalPrice = $totalPrice;

Expand Down Expand Up @@ -1743,7 +1743,7 @@ public function build(): StagedOrder
$this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
$this->lineItems,
$this->customLineItems,
$this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
$this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
$this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice,
$this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice,
$this->discountOnTotalPrice instanceof DiscountOnTotalPriceBuilder ? $this->discountOnTotalPrice->build() : $this->discountOnTotalPrice,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
use Commercetools\Api\Models\Common\Address;
use Commercetools\Api\Models\Common\AddressCollection;
use Commercetools\Api\Models\Common\AddressModel;
use Commercetools\Api\Models\Common\CentPrecisionMoney;
use Commercetools\Api\Models\Common\CentPrecisionMoneyModel;
use Commercetools\Api\Models\Common\CreatedBy;
use Commercetools\Api\Models\Common\CreatedByModel;
use Commercetools\Api\Models\Common\LastModifiedBy;
use Commercetools\Api\Models\Common\LastModifiedByModel;
use Commercetools\Api\Models\Common\TypedMoney;
use Commercetools\Api\Models\Common\TypedMoneyModel;
use Commercetools\Api\Models\CustomerGroup\CustomerGroupReference;
use Commercetools\Api\Models\CustomerGroup\CustomerGroupReferenceModel;
use Commercetools\Api\Models\Order\Order;
Expand Down Expand Up @@ -149,7 +149,7 @@ final class StagedOrderModel extends JsonObjectModel implements StagedOrder

/**
*
* @var ?TypedMoney
* @var ?CentPrecisionMoney
*/
protected $totalPrice;

Expand Down Expand Up @@ -388,7 +388,7 @@ public function __construct(
?StoreKeyReference $store = null,
?LineItemCollection $lineItems = null,
?CustomLineItemCollection $customLineItems = null,
?TypedMoney $totalPrice = null,
?CentPrecisionMoney $totalPrice = null,
?TaxedPrice $taxedPrice = null,
?TaxedPrice $taxedShippingPrice = null,
?DiscountOnTotalPrice $discountOnTotalPrice = null,
Expand Down Expand Up @@ -778,7 +778,7 @@ public function getCustomLineItems()
* <p>Taxes are included if <a href="ctp:api:type:TaxRate">TaxRate</a> <code>includedInPrice</code> is <code>true</code> for each price.</p>
*
*
* @return null|TypedMoney
* @return null|CentPrecisionMoney
*/
public function getTotalPrice()
{
Expand All @@ -788,8 +788,8 @@ public function getTotalPrice()
if (is_null($data)) {
return null;
}
$className = TypedMoneyModel::resolveDiscriminatorClass($data);
$this->totalPrice = $className::of($data);

$this->totalPrice = CentPrecisionMoneyModel::of($data);
}

return $this->totalPrice;
Expand Down Expand Up @@ -1669,9 +1669,9 @@ public function setCustomLineItems(?CustomLineItemCollection $customLineItems):
}

/**
* @param ?TypedMoney $totalPrice
* @param ?CentPrecisionMoney $totalPrice
*/
public function setTotalPrice(?TypedMoney $totalPrice): void
public function setTotalPrice(?CentPrecisionMoney $totalPrice): void
{
$this->totalPrice = $totalPrice;
}
Expand Down
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,4 @@ ccf4522140c12b0093aefe0e2a27d62bcc4834a6
f254d17f05343dcc4299fc53ff9b335b5ef63d69
6892be230f1ad73f1150dd544c9fa7fee0e6b123
971c1b4ce06c29fcb8c2402dc2ca523b2907352c
b747e1fa4f246b748a89bccbfd8a43f5b6f51175