Skip to content

Commit

Permalink
[API] CS fixes in configuration of api resources
Browse files Browse the repository at this point in the history
  • Loading branch information
GSadee committed Mar 13, 2020
1 parent 30399dd commit 81e51af
Show file tree
Hide file tree
Showing 15 changed files with 245 additions and 94 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
<?xml version="1.0" ?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<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.currency.class%"
shortName="Currency"
>
xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd"
>
<resource class="%sylius.model.currency.class%" shortName="Currency">
<attribute name="validation_groups">sylius</attribute>

<collectionOperations>
<collectionOperation name="get" />
<collectionOperation name="post" />
</collectionOperations>

<itemOperations>
<itemOperation name="get" />
</itemOperations>

<property name="id" identifier="false" writable="false" />
<property name="code" identifier="true" required="true" />
<property name="createdAt" writable="false" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<?xml version="1.0" ?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<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.customer.class%"
shortName="Customer"
>
<resource class="%sylius.model.customer.class%" shortName="Customer">
<attribute name="normalization_context">
<attribute name="groups">
<attribute>customer:read</attribute>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
<?xml version="1.0" ?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<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.customer_group.class%"
shortName="CustomerGroup"
>
xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd"
>
<resource class="%sylius.model.customer_group.class%" shortName="CustomerGroup">
<attribute name="normalization_context">
<attribute name="groups">
<attribute>customer_group:read</attribute>
</attribute>
</attribute>

<attribute name="denormalization_context">
<attribute name="groups">
<attribute>customer_group:create</attribute>
</attribute>
</attribute>

<attribute name="validation_groups">sylius</attribute>

<collectionOperations>
<collectionOperation name="get" />
<collectionOperation name="post" />
</collectionOperations>

<itemOperations>
<itemOperation name="get" />
<itemOperation name="put">
Expand All @@ -32,6 +44,7 @@
</itemOperation>
<itemOperation name="delete" />
</itemOperations>

<property name="id" identifier="false" writable="false" />
<property name="code" identifier="true" required="true" />
<property name="name" writable="true"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
<?xml version="1.0" ?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<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.exchange_rate.class%"
shortName="ExchangeRate"
>
<attribute name="validation_groups">sylius</attribute>
xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd"
>
<resource class="%sylius.model.exchange_rate.class%" shortName="ExchangeRate">
<attribute name="normalization_context">
<attribute name="groups">
<attribute>exchange_rate:read</attribute>
</attribute>
</attribute>

<attribute name="validation_groups">sylius</attribute>

<collectionOperations>
<collectionOperation name="get" >
<attribute name="filters">
<attribute>exchange_rate_filter</attribute>
<attribute>sylius.api.exchange_rate_filter</attribute>
</attribute>
</collectionOperation>
<collectionOperation name="post">
Expand All @@ -26,6 +36,7 @@
</attribute>
</collectionOperation>
</collectionOperations>

<itemOperations>
<itemOperation name="get" />
<itemOperation name="put">
Expand All @@ -35,6 +46,7 @@
</itemOperation>
<itemOperation name="delete" />
</itemOperations>

<property name="id" identifier="true" writable="false" />
<property name="ratio" identifier="false" required="true" />
<property name="sourceCurrency" identifier="false" required="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<?xml version="1.0" ?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<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"
>
<resource class="%sylius.model.order.class%" shortName="Order">
<attribute name="normalization_context">
<attribute name="groups">
<attribute>order:read</attribute>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
<?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.payment.class%"
shortName="Payment"
>
<attribute name="validation_groups">sylius</attribute>
This file is part of the Sylius package.
<attribute name="order">
<attribute name="createdAt">DESC</attribute>
</attribute>
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<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.payment.class%" shortName="Payment">
<attribute name="normalization_context">
<attribute name="groups">
<attribute>payment:read</attribute>
</attribute>
</attribute>

<attribute name="validation_groups">sylius</attribute>

<attribute name="order">
<attribute name="createdAt">DESC</attribute>
</attribute>

<collectionOperations>
<collectionOperation name="get">
<attribute name="filters">
Expand All @@ -30,7 +38,7 @@

<itemOperations>
<itemOperation name="get" />
<itemOperation name="complete_payment">
<itemOperation name="complete">
<attribute name="method">PATCH</attribute>
<attribute name="path">/payments/{id}/complete</attribute>
<attribute name="controller">sylius.api.payment_state_machine_transition_applicator:complete</attribute>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<?xml version="1.0" ?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<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.payment_method.class%"
shortName="PaymentMethod"
>
<resource class="%sylius.model.payment_method.class%" shortName="PaymentMethod">
<attribute name="normalization_context">
<attribute name="groups">
<attribute>payment_method:read</attribute>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<?xml version="1.0" ?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<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.product.class%"
shortName="Product"
>
<resource class="%sylius.model.product.class%" shortName="Product">
<attribute name="normalization_context">
<attribute name="groups">
<attribute>product:read</attribute>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
<?xml version="1.0" ?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<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.product_option.class%"
shortName="ProductOption"
>
<attribute name="order">
<attribute name="position">ASC</attribute>
</attribute>
xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd"
>
<resource class="%sylius.model.product_option.class%" shortName="ProductOption">
<attribute name="normalization_context">
<attribute name="groups">
<attribute>product_option:read</attribute>
</attribute>
</attribute>

<attribute name="validation_groups">sylius</attribute>

<attribute name="order">
<attribute name="position">ASC</attribute>
</attribute>

<collectionOperations>
<collectionOperation name="get" />
<collectionOperation name="post">
Expand All @@ -25,6 +36,7 @@
</attribute>
</collectionOperation>
</collectionOperations>

<itemOperations>
<itemOperation name="get" />
<itemOperation name="put">
Expand All @@ -33,12 +45,13 @@
</attribute>
</itemOperation>
</itemOperations>

<property name="id" identifier="false" writable="false" />
<property name="code" identifier="true" required="true" />
<property name="createdAt" writable="false" />
<property name="updatedAt" writable="false" />
<property name="values" readable="true" writable="true">
<subresource resourceClass="Sylius\Component\Product\Model\ProductOptionValue" collection="true" />
<subresource resourceClass="%sylius.model.product_option_value.class%" collection="true" />
</property>
<property name="translations" readable="true" writable="true" />
</resource>
Expand Down
Loading

0 comments on commit 81e51af

Please sign in to comment.