<?php

declare(strict_types=1);

namespace App\Administration\Domain\Event;

use App\Administration\Domain\Model\Import\ImportBatchId;
use App\Shared\Domain\DomainEvent;
use App\Shared\Domain\Tenant\TenantId;
use DateTimeImmutable;
use Override;
use Ramsey\Uuid\UuidInterface;

/**
 * Événement émis lorsqu'un import d'enseignants échoue.
 */
final readonly class ImportEnseignantsEchoue implements DomainEvent
{
    public function __construct(
        public ImportBatchId $batchId,
        public TenantId $tenantId,
        public int $errorCount,
        private DateTimeImmutable $occurredOn,
    ) {
    }

    #[Override]
    public function occurredOn(): DateTimeImmutable
    {
        return $this->occurredOn;
    }

    #[Override]
    public function aggregateId(): UuidInterface
    {
        return $this->batchId->value;
    }
}
