Skip to content

Commit

Permalink
refactor #15770 [API] Split read serialization group (TheMilek)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13 <!-- see the comment below -->                  |
| Bug fix?        | no                                                      |
| New feature?    | yes                                                       |
| BC breaks?      | no                                                       |
| Deprecations?   | no<!-- don't forget to update the UPGRADE-*.md file --> |
| License         | MIT                                                          |

<!--
 - Bug fixes must be submitted against the 1.12 branch
 - Features and deprecations must be submitted against the 1.13 branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->

here is only split of the read group to show and index, in another PR there is a [BC layer](#15780) to handle it



Commits
-------
  [Country] Split read serialization group
  [Currency] Split read serialization group
  [Address] Split read serialization group
  [Adjustment] Split read serialization group
  [AdminUser] Split read serialization group
  [AvatarImage] Split read serialization group
  [Promotion] Split read serialization group
  [Channel] Split read serialization group
  [ChannelPriceHistoryConfig] Split read serialization group
  [Customer] Split read serialization group
  [ExchangeRate] Split read serialization group
  [Locale] Split read serialization group
  [Order] Split read serialization group
  [Payment] Split read serialization group
  [Product] Split read serialization group
  [Shipment] Split read serialization group
  [Tax] Split read serialization group
  [Taxon] Split read serialization group
  [Zone] Split read serialization group
  • Loading branch information
jakubtobiasz committed Jan 31, 2024
2 parents 59ceb61 + ef05d36 commit d4cf3b5
Show file tree
Hide file tree
Showing 118 changed files with 1,554 additions and 1,014 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<attribute name="method">GET</attribute>
<attribute name="path">/shop/addresses</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:address:read</attribute>
<attribute name="groups">shop:address:index</attribute>
</attribute>
</collectionOperation>

Expand All @@ -30,7 +30,7 @@
<attribute name="groups">shop:address:create</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:address:read</attribute>
<attribute name="groups">shop:address:show</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
Expand All @@ -41,7 +41,7 @@
<attribute name="path">/admin/addresses/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">
<attribute>admin:address:read</attribute>
<attribute>admin:address:show</attribute>
</attribute>
</attribute>
</itemOperation>
Expand All @@ -56,7 +56,7 @@
</attribute>
<attribute name="normalization_context">
<attribute name="groups">
<attribute>admin:address:read</attribute>
<attribute>admin:address:show</attribute>
</attribute>
</attribute>
</itemOperation>
Expand All @@ -66,7 +66,7 @@
<attribute name="path">/admin/addresses/{id}/log-entries</attribute>
<attribute name="controller">Sylius\Bundle\ApiBundle\Controller\GetAddressLogEntryCollectionAction</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:address:log_entry:read</attribute>
<attribute name="groups">admin:address:log_entry:show</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Retrieves the collection of AddressLogEntry resources.</attribute>
Expand All @@ -78,7 +78,7 @@
<attribute name="method">GET</attribute>
<attribute name="path">/shop/addresses/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:address:read</attribute>
<attribute name="groups">shop:address:show</attribute>
</attribute>
</itemOperation>

Expand All @@ -94,7 +94,7 @@
<attribute name="groups">shop:address:update</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:address:read</attribute>
<attribute name="groups">shop:address:show</attribute>
</attribute>
</itemOperation>
</itemOperations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<attribute>sylius.api.order_token_filter</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:adjustment:read</attribute>
<attribute name="groups">admin:adjustment:index</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
Expand All @@ -34,28 +34,28 @@
<attribute name="method">GET</attribute>
<attribute name="path">/admin/adjustments/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:adjustment:read</attribute>
<attribute name="groups">admin:adjustment:show</attribute>
</attribute>
</itemOperation>

<itemOperation name="shop_get">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/adjustments/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:adjustment:read</attribute>
<attribute name="groups">shop:adjustment:show</attribute>
</attribute>
</itemOperation>
</itemOperations>

<subresourceOperations>
<subresourceOperation name="api_orders_adjustments_get_subresource">
<attribute name="normalization_context">
<attribute name="groups">shop:cart:read</attribute>
<attribute name="groups">shop:cart:show</attribute>
</attribute>
</subresourceOperation>
<subresourceOperation name="api_orders_items_adjustments_get_subresource">
<attribute name="normalization_context">
<attribute name="groups">shop:cart:read</attribute>
<attribute name="groups">shop:cart:show</attribute>
</attribute>
</subresourceOperation>
</subresourceOperations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<collectionOperation name="admin_get">
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:admin_user:read</attribute>
<attribute name="groups">admin:admin_user:index</attribute>
</attribute>
</collectionOperation>

Expand All @@ -38,7 +38,7 @@
<attribute name="groups">admin:admin_user:create</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:admin_user:read</attribute>
<attribute name="groups">admin:admin_user:show</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
Expand All @@ -47,7 +47,7 @@
<itemOperation name="admin_get">
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:admin_user:read</attribute>
<attribute name="groups">admin:admin_user:show</attribute>
</attribute>
</itemOperation>

Expand All @@ -57,7 +57,7 @@
<attribute name="groups">admin:admin_user:update</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:admin_user:read</attribute>
<attribute name="groups">admin:admin_user:show</attribute>
</attribute>
</itemOperation>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:avatar_image:read</attribute>
<attribute name="groups">admin:avatar_image:show</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
Expand All @@ -54,7 +54,7 @@
<itemOperation name="admin_get">
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:avatar_image:read</attribute>
<attribute name="groups">admin:avatar_image:show</attribute>
</attribute>
</itemOperation>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<attribute>sylius.api.order_filter.priority</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:catalog_promotion:read</attribute>
<attribute name="groups">admin:catalog_promotion:index</attribute>
</attribute>
</collectionOperation>

Expand All @@ -47,7 +47,7 @@
<attribute name="groups">admin:catalog_promotion:create</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:catalog_promotion:read</attribute>
<attribute name="groups">admin:catalog_promotion:show</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="description">
Expand Down Expand Up @@ -84,15 +84,15 @@ Example configuration for `percentage_discount` action type:
<attribute name="path">/admin/catalog-promotions/{code}</attribute>
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:catalog_promotion:read</attribute>
<attribute name="groups">admin:catalog_promotion:show</attribute>
</attribute>
</itemOperation>

<itemOperation name="shop_get">
<attribute name="path">/shop/catalog-promotions/{code}</attribute>
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:catalog_promotion:read</attribute>
<attribute name="groups">shop:catalog_promotion:show</attribute>
</attribute>
</itemOperation>

Expand All @@ -103,7 +103,7 @@ Example configuration for `percentage_discount` action type:
<attribute name="groups">admin:catalog_promotion:update</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:catalog_promotion:read</attribute>
<attribute name="groups">admin:catalog_promotion:show</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="description">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<attribute name="method">GET</attribute>
<attribute name="path">/admin/catalog-promotion-translations/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:catalog_promotion:read</attribute>
<attribute name="groups">admin:catalog_promotion:show</attribute>
</attribute>
</itemOperation>
</itemOperations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
<attribute name="method">GET</attribute>
<attribute name="path">/admin/channels</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:channel:read</attribute>
<attribute name="groups">admin:channel:index</attribute>
</attribute>
</collectionOperation>

<collectionOperation name="shop_get">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/channels</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:channel:read</attribute>
<attribute name="groups">shop:channel:index</attribute>
</attribute>
</collectionOperation>

Expand All @@ -40,7 +40,7 @@
<attribute name="groups">admin:channel:create</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:channel:read</attribute>
<attribute name="groups">admin:channel:show</attribute>
</attribute>
<attribute name="validation_groups">sylius</attribute>
</collectionOperation>
Expand All @@ -54,15 +54,15 @@
<attribute name="summary">Use $code to retrieve a channel resource.</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:channel:read</attribute>
<attribute name="groups">admin:channel:show</attribute>
</attribute>
</itemOperation>

<itemOperation name="shop_get">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/channels/{code}</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:channel:read</attribute>
<attribute name="groups">shop:channel:show</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Use $code to retrieve a channel resource.</attribute>
Expand All @@ -76,7 +76,7 @@
<attribute name="groups">admin:channel:update</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:channel:read</attribute>
<attribute name="groups">admin:channel:show</attribute>
</attribute>
<attribute name="validation_groups">sylius</attribute>
</itemOperation>
Expand All @@ -92,7 +92,7 @@
<attribute name="method">GET</attribute>
<attribute name="path">/admin/channels/{code}/shop-billing-data</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:shop_billing_data:read</attribute>
<attribute name="groups">admin:shop_billing_data:show</attribute>
</attribute>
</subresourceOperation>
</subresourceOperations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<itemOperation name="admin_get">
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:channel_price_history_config:read</attribute>
<attribute name="groups">admin:channel_price_history_config:show</attribute>
</attribute>
</itemOperation>
<itemOperation name="admin_put">
Expand All @@ -34,7 +34,7 @@
<attribute name="groups">admin:channel_price_history_config:update</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:channel_price_history_config:read</attribute>
<attribute name="groups">admin:channel_price_history_config:show</attribute>
</attribute>
</itemOperation>
</itemOperations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<attribute name="method">GET</attribute>
<attribute name="path">/admin/channel-pricing-log-entries</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:channel_pricing_log_entry:read</attribute>
<attribute name="groups">admin:channel_pricing_log_entry:index</attribute>
</attribute>
<attribute name="filters">
<attribute>sylius.api.channel_pricing_channel_filter</attribute>
Expand All @@ -38,7 +38,7 @@
<attribute name="method">GET</attribute>
<attribute name="path">/admin/channel-pricing-log-entries/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:channel_pricing_log_entry:read</attribute>
<attribute name="groups">admin:channel_pricing_log_entry:show</attribute>
</attribute>
</itemOperation>
</itemOperations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
<attribute name="method">GET</attribute>
<attribute name="path">/admin/countries</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:country:read</attribute>
<attribute name="groups">admin:country:index</attribute>
</attribute>
</collectionOperation>

<collectionOperation name="shop_get">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/countries</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:country:read</attribute>
<attribute name="groups">shop:country:index</attribute>
</attribute>
</collectionOperation>

Expand All @@ -42,7 +42,7 @@
<attribute name="groups">admin:country:create</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:country:read</attribute>
<attribute name="groups">admin:country:show</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
Expand All @@ -52,14 +52,14 @@
<attribute name="method">GET</attribute>
<attribute name="path">/admin/countries/{code}</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:country:read</attribute>
<attribute name="groups">admin:country:show</attribute>
</attribute>
</itemOperation>
<itemOperation name="shop_get">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/countries/{code}</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:country:read</attribute>
<attribute name="groups">shop:country:show</attribute>
</attribute>
</itemOperation>

Expand All @@ -70,7 +70,7 @@
<attribute name="groups">admin:country:update</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:country:read</attribute>
<attribute name="groups">admin:country:show</attribute>
</attribute>
</itemOperation>
</itemOperations>
Expand Down
Loading

0 comments on commit d4cf3b5

Please sign in to comment.