sylius_admin_zone:
    resource: |
        alias: sylius.zone
        section: admin
        templates: "@SyliusAdmin\\Crud"
        except: ['show', 'create']
        redirect: update
        grid: sylius_admin_zone
        permission: true
        vars:
            all:
                subheader: sylius.ui.manage_geographical_zones
                templates:
                    form: "@SyliusAdmin/Zone/_form.html.twig"
            index:
                icon: world
    type: sylius.resource

sylius_admin_zone_create:
    path: /zones/{type}/new
    methods: [GET, POST]
    defaults:
        _controller: sylius.controller.zone::createAction
        _sylius:
            section: admin
            factory:
                method: createTyped
                arguments:
                    type: $type
            template: "@SyliusAdmin/Crud/create.html.twig"
            redirect: sylius_admin_zone_update
            permission: true
            vars:
                subheader: sylius.ui.manage_geographical_zones
                templates:
                    form: "@SyliusAdmin/Zone/_form.html.twig"
                route:
                    parameters:
                        type: $type
    requirements:
        type: country|province|zone
