# This file is part of the Sylius package.
# (c) Sylius Sp. z o.o.

sylius_shop_partial_taxon_show_by_slug:
    path: /by-slug/{slug}
    methods: [GET]
    defaults:
        _controller: sylius.controller.taxon::showAction
        _sylius:
            template: $template
            repository:
                method: findOneBySlug
                arguments:
                    - $slug
                    - "expr:service('sylius.context.locale').getLocaleCode()"
    requirements:
        slug: .+

sylius_shop_partial_taxon_index_by_code:
    path: /by-code/{code}
    methods: [GET]
    defaults:
        _controller: sylius.controller.taxon::indexAction
        _sylius:
            template: $template
            repository:
                method: findChildren
                arguments:
                    - $code
                    - "expr:service('sylius.context.locale').getLocaleCode()"

sylius_shop_partial_channel_menu_taxon_index:
    path: /by-channel-menu-taxon/
    methods: [GET]
    defaults:
        _controller: sylius.controller.taxon::indexAction
        _sylius:
            template: $template
            repository:
                method: findChildrenByChannelMenuTaxon
                arguments:
                    - "expr:service('sylius.context.channel').getChannel().getMenuTaxon()"
                    - "expr:service('sylius.context.locale').getLocaleCode()"
