sylius_admin_customer:
    resource: |
        alias: sylius.customer
        section: admin
        templates: "@SyliusAdmin\\Crud"
        except: ['show', 'delete']
        redirect: update
        grid: sylius_admin_customer
        permission: true
        vars:
            all:
                subheader: sylius.ui.manage_your_customers
                templates:
                    form: "@SyliusAdmin/Customer/_form.html.twig"
            index:
                icon: users
    type: sylius.resource

sylius_admin_customer_show:
    path: /customers/{id}
    defaults:
        _controller: sylius.controller.customer::showAction
        _sylius:
            section: admin
            template: "@SyliusAdmin/Customer/show.html.twig"
            permission: true

sylius_admin_customer_order_index:
    path: /customers/{id}/orders
    methods: [GET]
    defaults:
        _controller: sylius.controller.order::indexAction
        _sylius:
            section: admin
            permission: true
            template: "@SyliusAdmin/Crud/index.html.twig"
            grid: sylius_admin_customer_order
            vars:
                route:
                    parameters:
                        $customerId: $id
                templates:
                    breadcrumb: '@SyliusAdmin/Customer/Order/Index/_breadcrumb.html.twig'
                    header_title: '@SyliusAdmin/Customer/Order/Index/_headerTitle.html.twig'
                subheader: sylius.ui.process_your_orders
                icon: cart

sylius_admin_customer_orders_statistics:
    path: /orders-statistics
    methods: [GET]
    defaults:
        _controller: sylius.controller.customer_statistics::renderAction
        _sylius:
            section: admin
            permission: true
