sylius_grid:
    grids:
        sylius_admin_payment:
            driver:
                name: doctrine/orm
                options:
                    class: "%sylius.model.payment.class%"
                    repository:
                        method: createListQueryBuilder
            sorting:
                createdAt: desc
            fields:
                createdAt:
                    type: twig
                    label: sylius.ui.date
                    sortable: ~
                    options:
                        template: "@SyliusAdmin/shared/grid/field/date.html.twig"
                        vars:
                            th_class: "w-1 text-center"
                number:
                    type: twig
                    label: sylius.ui.order
                    path: order
                    options:
                        template: "@SyliusAdmin/shared/grid/field/order_number.html.twig"
                        vars:
                            th_class: "w-1"
                customer:
                    type: twig
                    label: sylius.ui.customer
                    path: order.customer
                    options:
                        template: "@SyliusAdmin/shared/grid/field/customer.html.twig"
                        vars:
                            th_class: "w-100"
                channel:
                    type: twig
                    label: sylius.ui.channel
                    path: order.channel
                    options:
                        template: "@SyliusAdmin/shared/grid/field/channel.html.twig"
                state:
                    type: twig
                    label: sylius.ui.state
                    options:
                        template: "@SyliusAdmin/shared/grid/field/payment_state.html.twig"
                        vars:
                            th_class: "w-1 text-center"
                            td_class: "text-center"
            filters:
                state:
                    type: select
                    label: sylius.ui.state
                    form_options:
                        choices:
                            sylius.ui.cancelled: cancelled
                            sylius.ui.completed: completed
                            sylius.ui.failed: failed
                            sylius.ui.new: new
                            sylius.ui.processing: processing
                            sylius.ui.refunded: refunded
                channel:
                    type: entity
                    label: sylius.ui.channel
                    options:
                        fields: [order.channel]
                    form_options:
                        class: "%sylius.model.channel.class%"
            actions:
                item:
                    list_payment_requests:
                        type: show
                        icon: "tabler:list-letters"
                        label: sylius.ui.list_payment_requests
                        options:
                            link:
                                route: sylius_admin_payment_request_index
                                parameters:
                                    paymentId: resource.id
                    complete:
                        type: apply_transition
                        label: sylius.ui.complete
                        icon: "tabler:credit-card-pay"
                        options:
                            link:
                                route: sylius_admin_payment_complete
                                parameters:
                                    id: resource.id
                            class: teal
                            transition: complete
                            graph: sylius_payment
