<?php

declare(strict_types=1);

namespace App\Framework\EventSourcing;

use App\Framework\Core\ValueObjects\Timestamp;

final readonly class AggregateEnvelope
{
    public function __construct(
        public AggregateId $aggregateId,
        public object      $event,
        public int         $version,
        public Timestamp   $recordedAt,
        public EventMetadata $metadata,
    ) {
    }

    public function eventName(): string
    {
        return get_class($this->event);
    }
}
