← Code-Übersicht

PostingResult.php

Pfad: src/Domain/Rechnung/PostingResult.php

Ext: php

Größe: 826 Bytes

Geändert: 2026-07-16 14:10:20+02

<?php
declare(strict_types=1);

namespace Demo\Domain\Rechnung;

/**
 * Ergebnis der Buha-API-Buchung.
 */
final class PostingResult
{
    /**
     * @param string      $voucherId     ID der Buchung/Belege.
     * @param string      $postStatus    Rueckgabestatus.
     * @param string|null $externalRef   Optionaler externer Referenzwert.
     */
    public function __construct(
        public readonly string $voucherId,
        public readonly string $postStatus,
        public readonly ?string $externalRef = null
    ) {
    }

    /**
     * @return array<string,mixed> Serialisierte Form.
     */
    public function toArray(): array
    {
        return [
            'voucherId' => $this->voucherId,
            'postStatus' => $this->postStatus,
            'externalRef' => $this->externalRef,
        ];
    }
}