sylius_grid:
    grids:
        sylius_admin_promotion:
            driver:
                name: doctrine/orm
                options:
                    class: "%sylius.model.promotion.class%"
            sorting:
                priority: desc
            fields:
                priority:
                    type: twig
                    label: sylius.ui.priority
                    sortable: ~
                    options:
                        template: "@SyliusUi/Grid/Field/position.html.twig"
                code:
                    type: string
                    label: sylius.ui.code
                    sortable: ~
                name:
                    type: twig
                    label: sylius.ui.name
                    path: .
                    sortable: ~
                    options:
                        template: "@SyliusUi/Grid/Field/nameAndDescription.html.twig"
                couponBased:
                    type: twig
                    label: sylius.ui.coupons
                    options:
                        template: "@SyliusUi/Grid/Field/yesNo.html.twig"
                usage:
                    type: twig
                    label: sylius.ui.usage
                    path: .
                    sortable: used
                    options:
                        template: "@SyliusAdmin/Promotion/Grid/Field/usage.html.twig"
            filters:
                search:
                    type: string
                    label: sylius.ui.search
                    options:
                        fields: [code, name]
                couponBased:
                    type: boolean
                    label: sylius.ui.coupon_based
                coupon_code:
                    type: string
                    label: sylius.ui.coupon
                    options:
                        fields: [coupons.code]
                archival:
                    type: exists
                    label: sylius.ui.archival
                    options:
                        field: archivedAt
                    default_value: false
            actions:
                main:
                    create:
                        type: create
                item:
                    coupons:
                        type: links
                        label: sylius.ui.manage_coupons
                        options:
                            visible: resource.couponBased
                            icon: ticket
                            links:
                                index:
                                    label: sylius.ui.list_coupons
                                    icon: list
                                    route: sylius_admin_promotion_coupon_index
                                    parameters:
                                        promotionId: resource.id
                                create:
                                    label: sylius.ui.create
                                    icon: plus
                                    route: sylius_admin_promotion_coupon_create
                                    parameters:
                                        promotionId: resource.id
                                generate:
                                    label: sylius.ui.generate
                                    icon: random
                                    route: sylius_admin_promotion_coupon_generate
                                    parameters:
                                        promotionId: resource.id
                    update:
                        type: update
                    delete:
                        type: delete
                    archive:
                        type: archive
                bulk:
                    delete:
                        type: delete
