sylius_grid:
    grids:
        sylius_admin_promotion_coupon:
            driver:
                name: doctrine/orm
                options:
                    class: "%sylius.model.promotion_coupon.class%"
                    repository:
                        method: createQueryBuilderByPromotionId
                        arguments:
                            promotionId: $promotionId
            sorting:
                used: desc
            fields:
                code:
                    type: string
                    label: sylius.ui.code
                    sortable: ~
                usageLimit:
                    type: string
                    label: sylius.ui.usage_limit
                    sortable: ~
                perCustomerUsageLimit:
                    type: string
                    label: sylius.ui.per_customer_usage_limit
                    sortable: ~
                used:
                    type: twig
                    label: sylius.ui.used
                    path: .
                    sortable: ~
                    options:
                        template: "@SyliusAdmin/promotion_coupon/grid/field/used.html.twig"
                expiresAt:
                    type: datetime
                    label: sylius.ui.expires_at
                    sortable: ~
                    options:
                        format: d-m-Y
            filters:
                code:
                    type: string
                    label: sylius.ui.code
            actions:
                main:
                    generate:
                        type: default
                        label: sylius.ui.generate
                        icon: "tabler:arrows-split"
                        options:
                            link:
                                route: sylius_admin_promotion_coupon_generate
                                parameters:
                                    promotionId: $promotionId
                    create:
                        type: create
                        options:
                            link:
                                parameters:
                                    promotionId: $promotionId
                item:
                    update:
                        type: update
                        options:
                            link:
                                parameters:
                                    id: resource.id
                                    promotionId: $promotionId
                    delete:
                        type: delete
                        options:
                            link:
                                parameters:
                                    id: resource.id
                                    promotionId: $promotionId
                bulk:
                    delete:
                        type: delete
                        options:
                            link:
                                parameters:
                                    promotionId: $promotionId
