|
5 | 5 |
|
6 | 6 | namespace Commercetools\Core\Model\Cart; |
7 | 7 |
|
8 | | -use Commercetools\Core\Model\Common\JsonObject; |
9 | 8 | use Commercetools\Core\Model\Common\Money; |
10 | 9 | use Commercetools\Core\Model\Order\DeliveryCollection; |
| 10 | +use Commercetools\Core\Model\Order\ShippingInfoImportDraft; |
11 | 11 | use Commercetools\Core\Model\ShippingMethod\ShippingMethodReference; |
12 | 12 | use Commercetools\Core\Model\ShippingMethod\ShippingRate; |
13 | | -use Commercetools\Core\Model\TaxCategory\TaxCategory; |
14 | 13 | use Commercetools\Core\Model\TaxCategory\TaxRate; |
15 | 14 | use Commercetools\Core\Model\Common\TaxedItemPrice; |
| 15 | +use Commercetools\Core\Model\TaxCategory\TaxCategoryReference; |
16 | 16 |
|
17 | 17 | /** |
18 | 18 | * @package Commercetools\Core\Model\Cart |
19 | 19 | * @link https://docs.commercetools.com/http-api-projects-carts.html#shippinginfo |
| 20 | + * |
20 | 21 | * @method string getShippingMethodName() |
21 | 22 | * @method ShippingInfo setShippingMethodName(string $shippingMethodName = null) |
22 | 23 | * @method Money getPrice() |
|
25 | 26 | * @method ShippingInfo setShippingRate(ShippingRate $shippingRate = null) |
26 | 27 | * @method TaxRate getTaxRate() |
27 | 28 | * @method ShippingInfo setTaxRate(TaxRate $taxRate = null) |
28 | | - * @method TaxCategory getTaxCategory() |
29 | | - * @method ShippingInfo setTaxCategory(TaxCategory $taxCategory = null) |
| 29 | + * @method TaxCategoryReference getTaxCategory() |
| 30 | + * @method ShippingInfo setTaxCategory(TaxCategoryReference $taxCategory = null) |
30 | 31 | * @method ShippingMethodReference getShippingMethod() |
31 | 32 | * @method ShippingInfo setShippingMethod(ShippingMethodReference $shippingMethod = null) |
32 | 33 | * @method DeliveryCollection getDeliveries() |
33 | 34 | * @method ShippingInfo setDeliveries(DeliveryCollection $deliveries = null) |
34 | | - * @method TaxedItemPrice getTaxedPrice() |
35 | | - * @method ShippingInfo setTaxedPrice(TaxedItemPrice $taxedPrice = null) |
36 | 35 | * @method DiscountedLineItemPrice getDiscountedPrice() |
37 | 36 | * @method ShippingInfo setDiscountedPrice(DiscountedLineItemPrice $discountedPrice = null) |
38 | 37 | * @method string getShippingMethodState() |
39 | 38 | * @method ShippingInfo setShippingMethodState(string $shippingMethodState = null) |
| 39 | + * @method TaxedItemPrice getTaxedPrice() |
| 40 | + * @method ShippingInfo setTaxedPrice(TaxedItemPrice $taxedPrice = null) |
40 | 41 | */ |
41 | | -class ShippingInfo extends JsonObject |
| 42 | +class ShippingInfo extends ShippingInfoImportDraft |
42 | 43 | { |
43 | | - const SHIPPING_METHOD_MATCH = 'MatchesCart'; |
44 | | - const SHIPPING_METHOD_DONT_MATCH = 'DoesNotMatchCart'; |
45 | | - |
46 | 44 | public function fieldDefinitions() |
47 | 45 | { |
48 | | - return [ |
49 | | - 'shippingMethodName' => [static::TYPE => 'string'], |
50 | | - 'price' => [static::TYPE => Money::class], |
51 | | - 'shippingRate' => [static::TYPE => ShippingRate::class], |
52 | | - 'taxedPrice' => [static::TYPE => TaxedItemPrice::class], |
53 | | - 'taxRate' => [static::TYPE => TaxRate::class], |
54 | | - 'taxCategory' => [static::TYPE => TaxCategory::class], |
55 | | - 'shippingMethod' => [static::TYPE => ShippingMethodReference::class], |
56 | | - 'deliveries' => [static::TYPE => DeliveryCollection::class], |
57 | | - 'discountedPrice' => [static::TYPE => DiscountedLineItemPrice::class], |
58 | | - 'shippingMethodState' => [static::TYPE => 'string'] |
59 | | - ]; |
| 46 | + $fields = parent::fieldDefinitions(); |
| 47 | + $fields['taxedPrice'] = [static::TYPE => TaxedItemPrice::class]; |
| 48 | + |
| 49 | + return $fields; |
60 | 50 | } |
61 | 51 | } |
0 commit comments