sylius_admin_product_review:
    resource: |
        alias: sylius.product_review
        section: admin
        permission: true
        templates: "@SyliusAdmin\\shared\\crud"
        except: ['show', 'create']
        redirect: update
        grid: sylius_admin_product_review
        form:
            type: Sylius\Bundle\AdminBundle\Form\Type\ProductReviewType
    type: sylius.resource

sylius_admin_product_review_accept:
    path: /product-review/{id}/accept
    methods: [PUT]
    defaults:
        _controller: sylius.controller.product_review::applyStateMachineTransitionAction
        _sylius:
            permission: true
            state_machine:
                graph: sylius_product_review
                transition: accept
            redirect: sylius_admin_product_review_index
            flash: sylius.review.accept

sylius_admin_product_review_reject:
    path: /product-review/{id}/reject
    methods: [PUT]
    defaults:
        _controller: sylius.controller.product_review::applyStateMachineTransitionAction
        _sylius:
            permission: true
            state_machine:
                graph: sylius_product_review
                transition: reject
            redirect: sylius_admin_product_review_index
            flash: sylius.review.reject
