-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCustomLineItem.php
More file actions
269 lines (214 loc) · 8.46 KB
/
Copy pathCustomLineItem.php
File metadata and controls
269 lines (214 loc) · 8.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<?php
declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/
namespace Commercetools\Api\Models\Cart;
use Commercetools\Api\Models\Common\CentPrecisionMoney;
use Commercetools\Api\Models\Common\LocalizedString;
use Commercetools\Api\Models\Common\TypedMoney;
use Commercetools\Api\Models\Order\ItemStateCollection;
use Commercetools\Api\Models\TaxCategory\TaxCategoryReference;
use Commercetools\Api\Models\TaxCategory\TaxRate;
use Commercetools\Api\Models\Type\CustomFields;
use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;
interface CustomLineItem extends JsonObject
{
public const FIELD_ID = 'id';
public const FIELD_KEY = 'key';
public const FIELD_NAME = 'name';
public const FIELD_MONEY = 'money';
public const FIELD_TAXED_PRICE = 'taxedPrice';
public const FIELD_TAXED_PRICE_PORTIONS = 'taxedPricePortions';
public const FIELD_TOTAL_PRICE = 'totalPrice';
public const FIELD_SLUG = 'slug';
public const FIELD_QUANTITY = 'quantity';
public const FIELD_STATE = 'state';
public const FIELD_TAX_CATEGORY = 'taxCategory';
public const FIELD_TAX_RATE = 'taxRate';
public const FIELD_PER_METHOD_TAX_RATE = 'perMethodTaxRate';
public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity';
public const FIELD_CUSTOM = 'custom';
public const FIELD_SHIPPING_DETAILS = 'shippingDetails';
public const FIELD_PRICE_MODE = 'priceMode';
/**
* <p>Unique identifier of the Custom Line Item.</p>
*
* @return null|string
*/
public function getId();
/**
* <p>User-defined unique identifier of the Custom Line Item.</p>
*
* @return null|string
*/
public function getKey();
/**
* <p>Name of the Custom Line Item.</p>
*
* @return null|LocalizedString
*/
public function getName();
/**
* <p>Money value of the Custom Line Item.</p>
*
* @return null|TypedMoney
*/
public function getMoney();
/**
* <p>Automatically set after the <code>taxRate</code> is set.</p>
*
* @return null|TaxedItemPrice
*/
public function getTaxedPrice();
/**
* <p>Total taxed prices based on the quantity of the Custom Line Item assigned to each <a href="ctp:api:type:ShippingMethod">Shipping Method</a>. Only applicable for Carts with <code>Multiple</code> <a href="ctp:api:type:ShippingMode">ShippingMode</a>.
* Automatically set after <code>perMethodTaxRate</code> is set.</p>
*
* @return null|MethodTaxedPriceCollection
*/
public function getTaxedPricePortions();
/**
* <p>Total price of the Custom Line Item (<code>money</code> multiplied by <code>quantity</code>).
* If the Custom Line Item is discounted, the total price is <code>discountedPricePerQuantity</code> multiplied by <code>quantity</code>.</p>
* <p>Includes taxes if the <a href="ctp:api:type:TaxRate">TaxRate</a> <code>includedInPrice</code> is <code>true</code>.</p>
*
* @return null|CentPrecisionMoney
*/
public function getTotalPrice();
/**
* <p>User-defined identifier used in a deep-link URL for the Custom Line Item.
* It matches the pattern <code>[a-zA-Z0-9_-]{2,256}</code>.</p>
*
* @return null|string
*/
public function getSlug();
/**
* <p>Number of Custom Line Items in the <a href="ctp:api:type:Cart">Cart</a> or <a href="ctp:api:type:Order">Order</a>.</p>
*
* @return null|int
*/
public function getQuantity();
/**
* <p>Tracks specific quantities of the Custom Line Item within a given State. When a Custom Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Custom Line Items are managed on the <a href="ctp:api:type:Order">Order</a>.</p>
*
* @return null|ItemStateCollection
*/
public function getState();
/**
* <p>Used to select a Tax Rate when a Cart has the <code>Platform</code> <a href="ctp:api:type:TaxMode">TaxMode</a>.</p>
*
* @return null|TaxCategoryReference
*/
public function getTaxCategory();
/**
* <ul>
* <li>For a Cart with <code>Platform</code> <a href="ctp:api:type:TaxMode">TaxMode</a>, the <code>taxRate</code> of Custom Line Items is set automatically once a shipping address is set. The rate is based on the <a href="ctp:api:type:TaxCategory">TaxCategory</a> that applies for the shipping address.</li>
* <li>For a Cart with <code>External</code> TaxMode, the <code>taxRate</code> of Custom Line Items can be set using <a href="ctp:api:type:ExternalTaxRateDraft">ExternalTaxRateDraft</a>.</li>
* </ul>
*
* @return null|TaxRate
*/
public function getTaxRate();
/**
* <p>Tax Rate per Shipping Method for a Cart with <code>Multiple</code> <a href="ctp:api:type:ShippingMode">ShippingMode</a>. For a Cart with <code>Platform</code> <a href="ctp:api:type:TaxMode">TaxMode</a> it is automatically set after the <a href="ctp:api:type:CartAddShippingMethodAction">Shipping Method is added</a>.
* For a Cart with <code>External</code> <a href="ctp:api:type:TaxMode">TaxMode</a>, the Tax Rate must be set with <a href="ctp:api:type:ExternalTaxRateDraft">ExternalTaxRateDraft</a>.</p>
*
* @return null|MethodTaxRateCollection
*/
public function getPerMethodTaxRate();
/**
* <p>Discounted price of a single quantity of the Custom Line Item.</p>
*
* @return null|DiscountedLineItemPriceForQuantityCollection
*/
public function getDiscountedPricePerQuantity();
/**
* <p>Custom Fields of the Custom Line Item.</p>
*
* @return null|CustomFields
*/
public function getCustom();
/**
* <p>Container for Custom Line Item-specific addresses.</p>
*
* @return null|ItemShippingDetails
*/
public function getShippingDetails();
/**
* <p>Indicates whether Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</p>
*
* @return null|string
*/
public function getPriceMode();
/**
* @param ?string $id
*/
public function setId(?string $id): void;
/**
* @param ?string $key
*/
public function setKey(?string $key): void;
/**
* @param ?LocalizedString $name
*/
public function setName(?LocalizedString $name): void;
/**
* @param ?TypedMoney $money
*/
public function setMoney(?TypedMoney $money): void;
/**
* @param ?TaxedItemPrice $taxedPrice
*/
public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void;
/**
* @param ?MethodTaxedPriceCollection $taxedPricePortions
*/
public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void;
/**
* @param ?CentPrecisionMoney $totalPrice
*/
public function setTotalPrice(?CentPrecisionMoney $totalPrice): void;
/**
* @param ?string $slug
*/
public function setSlug(?string $slug): void;
/**
* @param ?int $quantity
*/
public function setQuantity(?int $quantity): void;
/**
* @param ?ItemStateCollection $state
*/
public function setState(?ItemStateCollection $state): void;
/**
* @param ?TaxCategoryReference $taxCategory
*/
public function setTaxCategory(?TaxCategoryReference $taxCategory): void;
/**
* @param ?TaxRate $taxRate
*/
public function setTaxRate(?TaxRate $taxRate): void;
/**
* @param ?MethodTaxRateCollection $perMethodTaxRate
*/
public function setPerMethodTaxRate(?MethodTaxRateCollection $perMethodTaxRate): void;
/**
* @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity
*/
public function setDiscountedPricePerQuantity(?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity): void;
/**
* @param ?CustomFields $custom
*/
public function setCustom(?CustomFields $custom): void;
/**
* @param ?ItemShippingDetails $shippingDetails
*/
public function setShippingDetails(?ItemShippingDetails $shippingDetails): void;
/**
* @param ?string $priceMode
*/
public function setPriceMode(?string $priceMode): void;
}