<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Model\Competency;

use App\Scolarite\Domain\Model\Evaluation\EvaluationId;

final class CompetencyEvaluation
{
    private function __construct(
        public private(set) CompetencyEvaluationId $id,
        public private(set) EvaluationId $evaluationId,
        public private(set) CompetencyId $competencyId,
    ) {
    }

    public static function creer(
        EvaluationId $evaluationId,
        CompetencyId $competencyId,
    ): self {
        return new self(
            id: CompetencyEvaluationId::generate(),
            evaluationId: $evaluationId,
            competencyId: $competencyId,
        );
    }

    /**
     * @internal Pour usage Infrastructure uniquement
     */
    public static function reconstitute(
        CompetencyEvaluationId $id,
        EvaluationId $evaluationId,
        CompetencyId $competencyId,
    ): self {
        return new self(
            id: $id,
            evaluationId: $evaluationId,
            competencyId: $competencyId,
        );
    }
}
