sylius_grid:
    grids:
        sylius_admin_catalog_promotion:
            driver:
                name: doctrine/orm
                options:
                    class: "%sylius.model.catalog_promotion.class%"
            sorting:
                code: asc
            fields:
                priority:
                    type: twig
                    label: sylius.ui.priority
                    sortable: ~
                    options:
                        template: "@SyliusAdmin/catalog_promotion/grid/field/priority.html.twig"
                        vars:
                            th_class: "w-1 text-center"
                            td_class: "text-center"
                name:
                    type: twig
                    label: sylius.ui.name
                    sortable: ~
                    options:
                        template: "@SyliusAdmin/shared/grid/field/name.html.twig"
                code:
                    type: twig
                    label: sylius.ui.code
                    sortable: ~
                    options:
                        template: "@SyliusAdmin/shared/grid/field/code.html.twig"
                channels:
                    type: twig
                    label: sylius.ui.channels
                    options:
                        template: "@SyliusAdmin/shared/grid/field/channels.html.twig"
                        vars:
                            th_class: "w-1 text-center"
                startDate:
                    type: twig
                    label: sylius.ui.start_date
                    sortable: ~
                    options:
                        template: "@SyliusAdmin/catalog_promotion/grid/field/date.html.twig"
                        vars:
                            th_class: "text-center"
                endDate:
                    type: twig
                    label: sylius.ui.end_date
                    sortable: ~
                    options:
                        template: "@SyliusAdmin/catalog_promotion/grid/field/date.html.twig"
                        vars:
                            th_class: "text-center"
                state:
                    type: twig
                    label: sylius.ui.state
                    path: state
                    options:
                        template: "@SyliusAdmin/catalog_promotion/grid/field/state.html.twig"
                        vars:
                            th_class: "w-1 text-center"
                            td_class: "text-center"
                enabled:
                    type: twig
                    label: sylius.ui.enabled
                    sortable: ~
                    options:
                        template: "@SyliusAdmin/shared/grid/field/boolean.html.twig"
                        vars:
                            th_class: "w-1 text-center"
                            td_class: "text-center"
            filters:
                search:
                    type: string
                    label: sylius.ui.search
                    form_options:
                        type: contains
                    options:
                        fields: [name, code]
                channel:
                    type: entity
                    label: sylius.ui.channel
                    form_options:
                        class: "%sylius.model.channel.class%"
                    options:
                        fields: [channels.id]
                startDate:
                    type: date
                    label: sylius.ui.start_date
                    options:
                        inclusive_to: true
                endDate:
                    type: date
                    label: sylius.ui.end_date
                    options:
                        inclusive_to: true
                enabled:
                    type: boolean
                    label: sylius.ui.enabled
                state:
                    type: select
                    label: sylius.ui.state
                    form_options:
                        choices:
                            sylius.ui.active: !php/const Sylius\Component\Promotion\Model\CatalogPromotionStates::STATE_ACTIVE
                            sylius.ui.inactive: !php/const Sylius\Component\Promotion\Model\CatalogPromotionStates::STATE_INACTIVE
            actions:
                main:
                    create:
                        type: create
                item:
                    show:
                        type: show
                    show_variants:
                        type: show
                        icon: "tabler:list-letters"
                        label: sylius.ui.list_variants
                        options:
                            link:
                                route: sylius_admin_catalog_promotion_product_variant_index
                                parameters:
                                    id: resource.id
                    update:
                        type: update
                    delete:
                        type: delete_catalog_promotion
                        options:
                            link:
                                route: sylius_admin_catalog_promotion_delete
                                parameters:
                                    code: resource.code
                            state: resource.state
