<?php

declare(strict_types=1);

namespace App\Administration\Domain\Exception;

use App\Administration\Domain\Model\Invitation\InvitationCode;
use App\Administration\Domain\Model\Invitation\ParentInvitationId;
use DomainException;

use function sprintf;

final class ParentInvitationNotFoundException extends DomainException
{
    public static function withId(ParentInvitationId $id): self
    {
        return new self(sprintf(
            'Invitation parent "%s" introuvable.',
            $id,
        ));
    }

    public static function withCode(InvitationCode $code): self
    {
        return new self('Invitation parent introuvable pour le code fourni.');
    }
}
