sylius_invoicing_plugin_invoice:
    resource: |
        alias: sylius_invoicing_plugin.invoice
        section: admin
        templates: "@SyliusAdmin\\Crud"
        only: ['index']
        grid: sylius_invoicing_plugin_invoice
        permission: true
        vars:
            all:
                subheader: sylius_invoicing_plugin.ui.manage_invoices
            index:
                icon: inbox
    type: sylius.resource

sylius_invoicing_plugin_admin_invoice_show:
    path: /invoices/{id}
    methods: [GET]
    defaults:
        _controller: sylius_invoicing_plugin.controller.invoice::showAction
        _sylius:
            section: admin
            permission: true
            template: "@SyliusInvoicingPlugin/Invoice/show.html.twig"

sylius_invoicing_plugin_admin_invoice_download:
    path: /invoices/{id}/download
    methods: [GET]
    defaults:
        _controller: sylius_invoicing_plugin.ui.action.download_invoice

sylius_invoicing_plugin_admin_invoice_resend:
    path: /invoices/{id}/resend
    methods: [GET]
    defaults:
        _controller: sylius_invoicing_plugin.ui.action.resend_invoice

sylius_invoicing_plugin_admin_order_invoices_partial:
    path: /_partial/invoices/{orderNumber}/
    methods: [GET]
    defaults:
        _controller: sylius_invoicing_plugin.controller.invoice::indexAction
        _sylius:
            template: $template
            repository:
                method: findByOrderNumber
                arguments: $orderNumber

sylius_invoicing_admin_order_show_by_number:
    path: /orders/by-number/{number}
    methods: [GET]
    defaults:
        _controller: Sylius\InvoicingPlugin\Ui\RedirectToOrderShowAction
        _sylius:
            section: admin
            permission: true
            alias: invoicing_plugin
