toBeFile(); $content = file_get_contents($openApiFile); expect($content)->not->toBeFalse(); $content = (string)$content; expect($content)->toContain('/orders/attachments/content:'); expect($content)->toContain('OrderAttachmentDownloadLinkResponse:'); expect($content)->toContain('InvoicingPeriodResponseEnvelope:'); expect($content)->toContain('InvoicingPeriodInvoiceCollection:'); expect($content)->toContain('enum: [open, closed, economic_draft, economic_booked]'); expect($content)->toContain('available_pdf_type:'); expect($content)->toContain('enum: [draft, booked, none]'); } }); it('documents the exception-first period review contract and workflow queries', function (): void { $content = (string)file_get_contents(app_path('openapi.yaml')); expect($content) ->toContain('- name: reviewState') ->toContain('- name: severity') ->toContain('- name: invoiceState') ->toContain('- name: departmentId') ->toContain('enum: [priority, customer_name, customer_number, total_amount]') ->toContain('InvoicingPeriodReview:') ->toContain('required: [state, severity, reasons, next_action, is_actionable, counts]') ->toContain('enum: [blocked, attention, queued, ready, completed]') ->toContain('InvoicingPeriodPagination:') ->toContain('required: [review_states, severities, invoice_states, department_ids]'); }); it('documents selected-customer object-tree snapshots and actor-bound bulk action fields', function (): void { $content = (string)file_get_contents(app_path('openapi.yaml')); expect($content) ->toContain('/superuser/invoicing/period/tree:') ->toContain('/superuser/invoicing/period/tree-actions/preview:') ->toContain('/superuser/invoicing/period/tree-actions/apply:') ->not->toContain('- name: includeTreeSnapshot') ->toContain('InvoicingPeriodTreeSnapshotEnvelope:') ->toContain('InvoicingPeriodTreeCapabilities:') ->toContain('InvoiceCollectionTreeActionPreviewEnvelope:') ->toContain('InvoiceCollectionTreeActionPreview:') ->toContain('off_period_impact:') ->toContain('date_from: {type: string, format: date}') ->toContain('complete_order_count') ->toContain('period_total_net_amount') ->toContain('snapshot_revision:') ->toContain('customer_number:') ->toContain('supplied action and selection still match the cached preview'); });