<?php
declare(strict_types=1);

namespace Itdatex\EInvoiceCore;

/**
 * Einzelner Validierungsbefund.
 * severity: 'error' | 'warning' | 'info'
 * source:   'xml' | 'xsd' | 'field' | 'parse' | 'format'
 */
final class ValidationIssue
{
    public function __construct(
        public readonly string $source,
        public readonly string $severity,
        public readonly string $message,
    ) {}

    public function toArray(): array
    {
        return [
            'source'   => $this->source,
            'severity' => $this->severity,
            'message'  => $this->message,
        ];
    }
}
