sylius_admin_partial_order_latest:
    path: /latest/{count}
    methods: [GET]
    defaults:
        _controller: sylius.controller.order::indexAction
        _sylius:
            repository:
                method: findLatest
                arguments:
                    - '!!int $count'
            template: $template
            permission: true

sylius_admin_partial_order_latest_in_channel:
    path: /latest/{channelCode}/{count}
    methods: [GET]
    defaults:
        _controller: sylius.controller.order::indexAction
        _sylius:
            repository:
                method: findLatestInChannel
                arguments:
                    count: '!!int $count'
                    channel: expr:notFoundOnNull(service('sylius.repository.channel').findOneByCode($channelCode))
            template: $template
            permission: true
