<?php

it('exposes an explicit collected-invoice transfer queue run route instead of ticking read endpoints', function (): void {
    $content = file_get_contents(app_path('routes/orderInvoicesRoute.php'));

    expect($content)->not->toBeFalse();
    expect($content)->toContain("\$this->get('/collected-invoices/economic/queue'");
    expect($content)->toContain("\$this->get('/collected-invoices/economic/queue/status'");
    expect($content)->toContain("\$this->post('/collected-invoices/economic/queue/run'");
    expect($content)->toContain('$queue->processPendingByTransferType(');
    expect($content)->not->toContain("\$this->processEconomicTransferQueueTick(5);");
    expect($content)->not->toContain("\$this->processEconomicTransferQueueTick(1);");
});

it('keeps order transfer queue status routes read-only', function (): void {
    $content = file_get_contents(app_path('routes/economicInvoiceRoute.php'));

    expect($content)->not->toBeFalse();
    expect($content)->toContain("\$this->get('/economic/invoice/draft/export/status'");
    expect($content)->toContain("\$this->get('/economic/invoice/export/status'");
    expect($content)->not->toContain("\$this->processEconomicTransferQueueTick(1);");
    expect($content)->not->toContain('private function processEconomicTransferQueueTick(int $limit = 1): void');
});
