<?php

declare(strict_types=1);

namespace App\Administration\Application\Query\ValidateHomeworkDueDate;

final readonly class DueDateValidationResult
{
    /**
     * @param string[] $warnings
     */
    public function __construct(
        public bool $valid,
        public ?string $reason = null,
        public array $warnings = [],
    ) {
    }

    public static function ok(string ...$warnings): self
    {
        return new self(valid: true, warnings: $warnings);
    }

    public static function invalide(string $reason): self
    {
        return new self(valid: false, reason: $reason);
    }
}
