sylius_mollie_admin_mollie_subscription:
    resource: |
        alias: sylius_mollie.mollie_subscription
        section: admin
        path: /mollie/subscription
        permission: true
        templates: "@SyliusAdmin\\shared\\crud"
        only: ['index', 'show']
        redirect: update
        grid: sylius_mollie_plugin_mollie_subscription
        vars:
            all:
                hook_prefix: 'sylius_mollie.admin.subscription'
    type: sylius.resource

sylius_mollie_admin_mollie_subscription_cancel:
    path: /mollie/subscription/{id}/cancel
    methods: [PUT]
    defaults:
        _controller: sylius_mollie.controller.admin.mollie_subscription::applyStateMachineTransitionAction
        _sylius:
            permission: true
            state_machine:
                graph: mollie_subscription_payment_graph_manual
                transition: cancel
            redirect: referer

sylius_mollie_admin_mollie_subscription_pause:
    path: /mollie/subscription/{id}/pause
    methods: [PUT]
    defaults:
        _controller: sylius_mollie.controller.admin.mollie_subscription::applyStateMachineTransitionAction
        _sylius:
            permission: true
            state_machine:
                graph: mollie_subscription_payment_graph_manual
                transition: pause
            redirect: referer

sylius_mollie_admin_mollie_subscription_resume:
    path: /mollie/subscription/{id}/resume
    methods: [PUT]
    defaults:
        _controller: sylius_mollie.controller.admin.mollie_subscription::applyStateMachineTransitionAction
        _sylius:
            permission: true
            state_machine:
                graph: mollie_subscription_payment_graph_manual
                transition: resume
            redirect: referer
