Skip to content

Commit

Permalink
OP-289: Reformat configs for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
hmfilar committed Aug 22, 2024
1 parent 208659e commit 98c92f3
Show file tree
Hide file tree
Showing 73 changed files with 466 additions and 432 deletions.
47 changes: 26 additions & 21 deletions src/Resources/config/api_resources/Order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
<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>
<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">
Expand Down Expand Up @@ -137,7 +140,9 @@
<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 name="summary">Addresses cart to given location, logged in Customer does not have to
provide an email
</attribute>
</attribute>
</itemOperation>

Expand Down Expand Up @@ -414,33 +419,33 @@
</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="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%" />
<subresource resourceClass="%sylius.model.shipment.class%"/>
</property>
<property name="payments" writable="false">
<subresource resourceClass="%sylius.model.payment.class%" />
<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="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%" />
<subresource resourceClass="%sylius.model.order_item.class%"/>
</property>
<property name="notes" writable="true" />
<property name="itemsTotal" readable="true" />
<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%" />
<subresource resourceClass="%sylius.model.adjustment.class%"/>
</property>
<property name="billingAddress" writable="false" />
<property name="shippingAddress" writable="false" />
<property name="localeCode" writable="true" />
<property name="billingAddress" writable="false"/>
<property name="shippingAddress" writable="false"/>
<property name="localeCode" writable="true"/>
</resource>
</resources>
26 changes: 13 additions & 13 deletions src/Resources/config/api_resources/Product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@
</subresourceOperation>
</subresourceOperations>

<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="id" identifier="false" writable="false"/>
<property name="code" identifier="true" required="true"/>
<property name="createdAt" writable="false"/>
<property name="updatedAt" writable="false"/>
<property name="translations" readable="true" writable="true">
<attribute name="openapi_context">
<attribute name="type">object</attribute>
Expand All @@ -115,17 +115,17 @@
</attribute>
</attribute>
</property>
<property name="productTaxons" readable="true" writable="true" />
<property name="reviews" required="false" />
<property name="options" required="false" />
<property name="channels" required="false" />
<property name="images" required="false" />
<property name="mainTaxon" required="false" />
<property name="productTaxons" readable="true" writable="true"/>
<property name="reviews" required="false"/>
<property name="options" required="false"/>
<property name="channels" required="false"/>
<property name="images" required="false"/>
<property name="mainTaxon" required="false"/>
<property name="variants" readable="true"/>
<property name="averageRating" readable="true" />
<property name="averageRating" readable="true"/>
<property name="productBundle" writable="false">
<subresource resourceClass="%bitbag_sylius_product_bundle.model.product_bundle.class%" collection="false" />
<subresource resourceClass="%bitbag_sylius_product_bundle.model.product_bundle.class%" collection="false"/>
</property>
<property name="bundle" writable="false" />
<property name="bundle" writable="false"/>
</resource>
</resources>
3 changes: 2 additions & 1 deletion src/Resources/config/api_resources/ProductBundle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
<attribute name="path">/shop/product-bundles/{id}/add-to-cart</attribute>
<attribute name="status">200</attribute>
<attribute name="messenger">input</attribute>
<attribute name="input">BitBag\SyliusProductBundlePlugin\Command\AddProductBundleToCartCommand</attribute>
<attribute name="input">BitBag\SyliusProductBundlePlugin\Command\AddProductBundleToCartCommand
</attribute>
<attribute name="output">false</attribute>
<attribute name="denormalization_context">
<attribute name="groups">
Expand Down
12 changes: 6 additions & 6 deletions src/Resources/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
imports:
- { resource: resources.yml }
- { resource: grids.yml }
- { resource: services.xml }
- { resource: resources.yml }
- { resource: grids.yml }
- { resource: services.xml }

framework:
messenger:
buses:
bitbag_sylius_product_bundle.command_bus: ~
messenger:
buses:
bitbag_sylius_product_bundle.command_bus: ~
6 changes: 3 additions & 3 deletions src/Resources/config/resources.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
imports:
- { resource: resources/product_bundle.yml }
- { resource: resources/product_bundle_item.yml }
- { resource: resources/product_bundle_order_item.yml }
- { resource: resources/product_bundle.yml }
- { resource: resources/product_bundle_item.yml }
- { resource: resources/product_bundle_order_item.yml }
16 changes: 8 additions & 8 deletions src/Resources/config/resources/product_bundle.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sylius_resource:
resources:
bitbag_sylius_product_bundle.product_bundle:
driver: doctrine/orm
classes:
model: BitBag\SyliusProductBundlePlugin\Entity\ProductBundle
interface: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleInterface
form: BitBag\SyliusProductBundlePlugin\Form\Type\ProductBundleType
repository: BitBag\SyliusProductBundlePlugin\Repository\ProductBundleRepository
resources:
bitbag_sylius_product_bundle.product_bundle:
driver: doctrine/orm
classes:
model: BitBag\SyliusProductBundlePlugin\Entity\ProductBundle
interface: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleInterface
form: BitBag\SyliusProductBundlePlugin\Form\Type\ProductBundleType
repository: BitBag\SyliusProductBundlePlugin\Repository\ProductBundleRepository
14 changes: 7 additions & 7 deletions src/Resources/config/resources/product_bundle_item.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sylius_resource:
resources:
bitbag_sylius_product_bundle.product_bundle_item:
driver: doctrine/orm
classes:
model: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleItem
interface: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleItemInterface
form: BitBag\SyliusProductBundlePlugin\Form\Type\ProductBundleItemType
resources:
bitbag_sylius_product_bundle.product_bundle_item:
driver: doctrine/orm
classes:
model: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleItem
interface: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleItemInterface
form: BitBag\SyliusProductBundlePlugin\Form\Type\ProductBundleItemType
12 changes: 6 additions & 6 deletions src/Resources/config/resources/product_bundle_order_item.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sylius_resource:
resources:
bitbag_sylius_product_bundle.product_bundle_order_item:
driver: doctrine/orm
classes:
model: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItem
interface: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface
resources:
bitbag_sylius_product_bundle.product_bundle_order_item:
driver: doctrine/orm
classes:
model: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItem
interface: BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface
8 changes: 4 additions & 4 deletions src/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bitbag_sylius_product_bundle_admin:
resource: routing/admin.yml
prefix: /admin
resource: routing/admin.yml
prefix: /admin

bitbag_sylius_product_bundle_shop:
resource: routing/shop.yml
prefix: /{_locale}
resource: routing/shop.yml
prefix: /{_locale}
92 changes: 46 additions & 46 deletions src/Resources/config/routing/admin.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
bitbag_product_bundle_admin_product_create_bundle:
path: /products/new/bundle
methods: [GET, POST]
defaults:
_controller: sylius.controller.product::createAction
_sylius:
section: admin
permission: true
factory:
method: createWithVariantAndBundle
template: "@SyliusAdmin/Crud/create.html.twig"
redirect: sylius_admin_product_update
form:
options:
validation_groups:
- sylius
- bitbag_sylius_product_bundle
vars:
subheader: sylius.ui.manage_your_product_catalog
templates:
form: "@SyliusAdmin/Product/_form.html.twig"
route:
name: bitbag_product_bundle_admin_product_create_bundle
path: /products/new/bundle
methods: [ GET, POST ]
defaults:
_controller: sylius.controller.product::createAction
_sylius:
section: admin
permission: true
factory:
method: createWithVariantAndBundle
template: "@SyliusAdmin/Crud/create.html.twig"
redirect: sylius_admin_product_update
form:
options:
validation_groups:
- sylius
- bitbag_sylius_product_bundle
vars:
subheader: sylius.ui.manage_your_product_catalog
templates:
form: "@SyliusAdmin/Product/_form.html.twig"
route:
name: bitbag_product_bundle_admin_product_create_bundle

bitbag_product_bundle_admin_ajax_product_variants_by_phrase:
path: /ajax/product-variants/search-by-phrase
methods: [GET]
defaults:
_controller: sylius.controller.product_variant::indexAction
_format: json
_sylius:
serialization_groups: [Autocomplete]
permission: true
repository:
method: findByPhrase
arguments:
phrase: $phrase
locale: expr:service('sylius.context.locale').getLocaleCode()
path: /ajax/product-variants/search-by-phrase
methods: [ GET ]
defaults:
_controller: sylius.controller.product_variant::indexAction
_format: json
_sylius:
serialization_groups: [ Autocomplete ]
permission: true
repository:
method: findByPhrase
arguments:
phrase: $phrase
locale: expr:service('sylius.context.locale').getLocaleCode()

bitbag_product_bundle_admin_ajax_product_variants_by_codes:
path: /ajax/product-variants/by-codes
methods: [GET]
defaults:
_controller: sylius.controller.product_variant::indexAction
_format: json
_sylius:
serialization_groups: [Autocomplete]
permission: true
repository:
method: findByCodes
arguments: [$code]
path: /ajax/product-variants/by-codes
methods: [ GET ]
defaults:
_controller: sylius.controller.product_variant::indexAction
_format: json
_sylius:
serialization_groups: [ Autocomplete ]
permission: true
repository:
method: findByCodes
arguments: [ $code ]
66 changes: 33 additions & 33 deletions src/Resources/config/routing/shop.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
bitbag_sylius_product_bundle_shop_ajax_cart_add_product_bundle:
path: /ajax/cart/product-bundle/add
methods: [POST]
defaults:
_controller: bitbag_sylius_product_bundle.controller.order_item::addProductBundleAction
_format: json
_sylius:
factory:
method: createForProduct
arguments: [expr:notFoundOnNull(service('sylius.repository.product').find($productId))]
form:
type: BitBag\SyliusProductBundlePlugin\Form\Type\AddProductBundleToCartType
options:
product: expr:notFoundOnNull(service('sylius.repository.product').find($productId))
redirect:
route: sylius_shop_cart_summary
parameters: {}
flash: sylius.cart.add_item
path: /ajax/cart/product-bundle/add
methods: [ POST ]
defaults:
_controller: bitbag_sylius_product_bundle.controller.order_item::addProductBundleAction
_format: json
_sylius:
factory:
method: createForProduct
arguments: [ expr:notFoundOnNull(service('sylius.repository.product').find($productId)) ]
form:
type: BitBag\SyliusProductBundlePlugin\Form\Type\AddProductBundleToCartType
options:
product: expr:notFoundOnNull(service('sylius.repository.product').find($productId))
redirect:
route: sylius_shop_cart_summary
parameters: { }
flash: sylius.cart.add_item

bitbag_sylius_product_bundle_shop_partial_cart_add_product_bundle:
path: /_partial/cart/product-bundle/add
methods: [GET]
defaults:
_controller: bitbag_sylius_product_bundle.controller.order_item::addProductBundleAction
_sylius:
template: $template
factory:
method: createForProduct
arguments: [expr:notFoundOnNull(service('sylius.repository.product').find($productId))]
form:
type: BitBag\SyliusProductBundlePlugin\Form\Type\AddProductBundleToCartType
options:
product: expr:notFoundOnNull(service('sylius.repository.product').find($productId))
redirect:
route: sylius_shop_cart_summary
parameters: {}
path: /_partial/cart/product-bundle/add
methods: [ GET ]
defaults:
_controller: bitbag_sylius_product_bundle.controller.order_item::addProductBundleAction
_sylius:
template: $template
factory:
method: createForProduct
arguments: [ expr:notFoundOnNull(service('sylius.repository.product').find($productId)) ]
form:
type: BitBag\SyliusProductBundlePlugin\Form\Type\AddProductBundleToCartType
options:
product: expr:notFoundOnNull(service('sylius.repository.product').find($productId))
redirect:
route: sylius_shop_cart_summary
parameters: { }
3 changes: 2 additions & 1 deletion src/Resources/config/services.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<imports>
<import resource="services/form.xml"/>
<import resource="services/menu.xml"/>
Expand Down
Loading

0 comments on commit 98c92f3

Please sign in to comment.