<?php

declare(strict_types=1);

namespace App\Administration\Domain\Exception;

use App\Administration\Domain\Model\Import\StudentImportField;
use App\Administration\Domain\Model\Import\TeacherImportField;
use DomainException;

use function sprintf;

final class MappingIncompletException extends DomainException
{
    public static function champManquant(StudentImportField|TeacherImportField $champ): self
    {
        return new self(sprintf(
            'Le champ obligatoire "%s" (%s) n\'est pas mappé.',
            $champ->label(),
            $champ->value,
        ));
    }
}
