← Code-Übersicht

IngestResult.php

Pfad: src/Application/Rechnung/IngestResult.php

Ext: php

Größe: 1256 Bytes

Geändert: 2026-07-16T14:10:52+02:00

Frühere Version vom 2026-07-16T14:10:52+02:00 · zur aktuellen Fassung

<?php
declare(strict_types=1);

namespace Demo\Application\Rechnung;

/**
 * Zusammenfassung eines Ausfuehrungsdurchlaufs.
 */
final class IngestResult
{
    /**
     * @param string $runId      Laufkennung.
     * @param string $status     Gesamtstatus.
     * @param int    $discovered Gefundene Rechnungen.
     * @param int    $processed  Erfolgreich verbuchte Rechnungen.
     * @param int    $skipped    Uebersprungen (bereits POSTED).
     * @param int    $errors     Laufende Fehler.
     */
    public function __construct(
        public readonly string $runId,
        public readonly string $status,
        public readonly int $discovered,
        public readonly int $processed,
        public readonly int $skipped,
        public readonly int $errors,
        public readonly array $stats = []
    ) {
    }

    /**
     * @return array<string,mixed> Ergebnisobjekt.
     */
    public function toArray(): array
    {
        return [
            'runId' => $this->runId,
            'status' => $this->status,
            'discovered' => $this->discovered,
            'processed' => $this->processed,
            'skipped' => $this->skipped,
            'errors' => $this->errors,
            'stats' => $this->stats,
        ];
    }
}