app_book:
    resource: |
        alias: app.book
    type: sylius.resource_api

app_gedmo:
    resource: |
        alias: app.gedmo
    type: sylius.resource_api

app_book_sortable_index:
    path: /sortable-books/
    methods: [GET]
    defaults:
        _controller: App\Controller\BookController:indexAction
        _sylius:
            sortable: true

app_book_filterable_index:
    path: /filterable-books/
    methods: [GET]
    defaults:
        _controller: app.controller.book:indexAction
        _sylius:
            filterable: true

app_versioned_book:
    resource: "versioned_routing.yaml"
    prefix: /v{version}

app_create_book_with_custom_factory:
    path: /create-custom-book
    methods: [POST]
    defaults:
        _controller: app.controller.book:createAction
        _sylius:
            factory:
                method: ["expr:service('test.custom_book_factory')", "createCustom"]

app_index_books_with_custom_repository:
    path: /find-custom-books
    methods: [GET]
    defaults:
        _controller: app.controller.book:indexAction
        _sylius:
            repository:
                method: ["expr:service('test.custom_book_repository')", "findCustomBooks"]

app_show_book_with_custom_repository:
    path: /find-custom-book
    methods: [GET]
    defaults:
        _controller: app.controller.book:showAction
        _sylius:
            repository:
                method: ["expr:service('test.custom_book_repository')", "findCustomBook"]
                arguments: ["J.R.R. Tolkien"]
