<?php

declare(strict_types=1);

namespace App\Support\BackupQuality;

final readonly class BackupQualitySummary
{
    /**
     * @param  list<string>  $degradationFamilies
     * @param  list<string>  $qualityHighlights
     */
    public function __construct(
        public string $kind,
        public string $snapshotMode,
        public int $totalItems,
        public int $degradedItemCount,
        public int $metadataOnlyCount,
        public int $assignmentIssueCount,
        public int $orphanedAssignmentCount,
        public int $integrityWarningCount,
        public int $unknownQualityCount,
        public bool $hasAssignmentIssues,
        public bool $hasOrphanedAssignments,
        public ?string $assignmentCaptureReason,
        public ?string $integrityWarning,
        public array $degradationFamilies,
        public array $qualityHighlights,
        public string $compactSummary,
        public string $summaryMessage,
        public string $nextAction,
        public string $positiveClaimBoundary,
    ) {}

    public function hasDegradations(): bool
    {
        return $this->degradationFamilies !== [];
    }

    public function hasIntegrityWarning(): bool
    {
        return $this->integrityWarning !== null;
    }
}
