-
Notifications
You must be signed in to change notification settings - Fork 42
/
Order.xml
417 lines (389 loc) · 21.8 KB
/
Order.xml
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
<?xml version="1.0" ?>
<resources xmlns="https://api-platform.com/schema/metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd"
>
<resource class="%sylius.model.order.class%" shortName="Order">
<attribute name="normalization_context">
<attribute name="groups">
<attribute>admin:order:read</attribute>
</attribute>
</attribute>
<attribute name="validation_groups">sylius</attribute>
<collectionOperations>
<collectionOperation name="admin_get">
<attribute name="method">GET</attribute>
<attribute name="path">admin/orders</attribute>
</collectionOperation>
<collectionOperation name="shop_post">
<attribute name="method">POST</attribute>
<attribute name="path">/shop/orders</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Cart\PickupCart</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:order:create</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Pickups a new cart. Provided locale code has to be one of available for a particular channel.</attribute> </attribute>
</collectionOperation>
<collectionOperation name="shop_get">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/orders</attribute>
<attribute name="normalization_context">
<attribute name="groups">
<attribute>shop:order:read</attribute>
</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
<itemOperations>
<itemOperation name="admin_get">
<attribute name="method">GET</attribute>
<attribute name="path">/admin/orders/{tokenValue}</attribute>
</itemOperation>
<itemOperation name="shop_get">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/orders/{tokenValue}</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:cart:read</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_delete">
<attribute name="method">DELETE</attribute>
<attribute name="path">/shop/orders/{tokenValue}</attribute>
<attribute name="openapi_context">
<attribute name="summary">Deletes cart</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:order:read</attribute>
</attribute>
</itemOperation>
<itemOperation name="admin_cancel">
<attribute name="method">PATCH</attribute>
<attribute name="path">/admin/orders/{tokenValue}/cancel</attribute>
<attribute name="input">false</attribute>
<attribute name="controller">sylius.api.order_state_machine_transition_applicator:cancel</attribute>
<attribute name="denormalization_context">
<attribute name="groups">admin:order:update</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Cancels Order</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_add_item">
<attribute name="method">PATCH</attribute>
<attribute name="path">/shop/orders/{tokenValue}/items</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">Setono\SyliusGiftCardPlugin\Api\Command\AddItemToCart</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:cart:read</attribute>
</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:cart:add_item</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Adds Item to cart</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_address">
<attribute name="method">PATCH</attribute>
<attribute name="path">/shop/orders/{tokenValue}/address</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Checkout\AddressOrder</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:cart:address</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:cart:read</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Addresses cart to given location, logged in Customer does not have to provide an email</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_select_shipping_method">
<attribute name="method">PATCH</attribute>
<attribute name="validation_groups">
<attribute>sylius</attribute>
</attribute>
<attribute name="path">/shop/orders/{tokenValue}/shipments/{shipmentId}</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Checkout\ChooseShippingMethod</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:cart:select_shipping_method</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:cart:read</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Selects shipping methods for particular shipment</attribute>
<attribute name="parameters">
<attribute>
<attribute name="name">tokenValue</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
<attribute>
<attribute name="name">shipmentId</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_select_payment_method">
<attribute name="method">PATCH</attribute>
<attribute name="path">/shop/orders/{tokenValue}/payments/{paymentId}</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Checkout\ChoosePaymentMethod</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:cart:select_payment_method</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:cart:read</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Selects payment methods for particular payment</attribute>
<attribute name="parameters">
<attribute>
<attribute name="name">tokenValue</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
<attribute>
<attribute name="name">paymentId</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_account_change_payment_method">
<attribute name="method">PATCH</attribute>
<attribute name="path">/shop/account/orders/{tokenValue}/payments/{paymentId}</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Account\ChangePaymentMethod</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:order:account:change_payment_method</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:order:account:read</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Change the payment method as logged shop user</attribute>
<attribute name="parameters">
<attribute>
<attribute name="name">tokenValue</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
<attribute>
<attribute name="name">paymentId</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
</attribute>
</attribute>
</itemOperation>
<itemOperation name="get_configuration">
<attribute name="method">GET</attribute>
<attribute name="controller">sylius.api.get_configuration_action</attribute>
<attribute name="path">/shop/orders/{tokenValue}/payments/{paymentId}/configuration</attribute>
<attribute name="openapi_context">
<attribute name="summary">Retrieve payment method configuration</attribute>
<attribute name="parameters">
<attribute>
<attribute name="name">tokenValue</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
<attribute>
<attribute name="name">paymentId</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_complete">
<attribute name="method">PATCH</attribute>
<attribute name="path">/shop/orders/{tokenValue}/complete</attribute>
<attribute name="validation_groups">
<attribute>sylius</attribute>
<attribute>sylius_checkout_complete</attribute>
</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Checkout\CompleteOrder</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:cart:complete</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:cart:read</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Completes checkout</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_remove_item">
<attribute name="method">DELETE</attribute>
<attribute name="path">/shop/orders/{tokenValue}/items/{itemId}</attribute>
<attribute name="messenger">input</attribute>
<attribute name="controller">Sylius\Bundle\ApiBundle\Controller\DeleteOrderItemAction</attribute>
<attribute name="write">false</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:cart:remove_item</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="parameters">
<attribute>
<attribute name="name">tokenValue</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
<attribute>
<attribute name="name">itemId</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_change_quantity">
<attribute name="method">PATCH</attribute>
<attribute name="path">/shop/orders/{tokenValue}/items/{orderItemId}</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Cart\ChangeItemQuantityInCart</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:cart:change_quantity</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Changes quantity of order item</attribute>
<attribute name="parameters">
<attribute>
<attribute name="name">tokenValue</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
<attribute>
<attribute name="name">orderItemId</attribute>
<attribute name="in">path</attribute>
<attribute name="required">true</attribute>
<attribute name="schema">
<attribute name="type">string</attribute>
</attribute>
</attribute>
</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_apply_coupon">
<attribute name="method">PATCH</attribute>
<attribute name="path">/shop/orders/{tokenValue}/apply-coupon</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Cart\ApplyCouponToCart</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:cart:apply_coupon</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Applies coupon to cart</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_put">
<attribute name="method">PUT</attribute>
<attribute name="path">/shop/orders/{tokenValue}</attribute>
<attribute name="denormalization_context">
<attribute name="groups">admin:cart:update</attribute>
</attribute>
</itemOperation>
</itemOperations>
<subresourceOperations>
<subresourceOperation name="items_get_subresource">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/orders/{tokenValue}/items</attribute>
</subresourceOperation>
<subresourceOperation name="shipments_get_subresource">
<attribute name="method">GET</attribute>
<attribute name="path">/admin/orders/{tokenValue}/shipments</attribute>
</subresourceOperation>
<subresourceOperation name="payments_get_subresource">
<attribute name="method">GET</attribute>
<attribute name="path">/admin/orders/{tokenValue}/payments</attribute>
</subresourceOperation>
<subresourceOperation name="adjustments_get_subresource">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/orders/{tokenValue}/adjustments</attribute>
</subresourceOperation>
<subresourceOperation name="payments_methods_get_subresource">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/orders/{tokenValue}/payments/{payments}/methods</attribute>
</subresourceOperation>
<subresourceOperation name="shipments_methods_get_subresource">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/orders/{tokenValue}/shipments/{shipments}/methods</attribute>
</subresourceOperation>
<subresourceOperation name="items_adjustments_get_subresource">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/orders/{tokenValue}/items/{items}/adjustments</attribute>
</subresourceOperation>
</subresourceOperations>
<property name="id" identifier="false" writable="false" />
<property name="number" identifier="false" writable="false" />
<property name="tokenValue" identifier="true" writable="false" />
<property name="channel" writable="false" />
<property name="customer" writable="false" />
<property name="shipments" writable="false">
<subresource resourceClass="%sylius.model.shipment.class%" />
</property>
<property name="payments" writable="false">
<subresource resourceClass="%sylius.model.payment.class%" />
</property>
<property name="state" writable="false" />
<property name="paymentState" writable="false" />
<property name="shippingState" writable="false" />
<property name="total" writable="false" />
<property name="orderPromotionTotal" writable="false" />
<property name="items" readable="true" writable="true">
<subresource resourceClass="%sylius.model.order_item.class%" />
</property>
<property name="notes" writable="true" />
<property name="itemsTotal" readable="true" />
<property name="taxTotal" readable="true"/>
<property name="adjustments" writable="false">
<subresource resourceClass="%sylius.model.adjustment.class%" />
</property>
<property name="billingAddress" writable="false" />
<property name="shippingAddress" writable="false" />
<property name="localeCode" writable="true" />
</resource>
</resources>