<?php

declare(strict_types=1);

namespace ImovelZapAi\Publishing\Connectors\GroupOlx\Application\Data;

use DateTimeImmutable;
use ImovelZapAi\Publishing\Connectors\GroupOlx\Domain\Enums\FeedStorageDriver;

/**
 * Metadados de uma versão persistida do feed VRSync.
 */
final readonly class FeedStorageVersionData
{
    public function __construct(
        public string $tenantId,
        public string $version,
        public string $hash,
        public DateTimeImmutable $storedAt,
        public string $path,
        public string $currentPath,
        public FeedStorageDriver $driver,
        public ?string $xml = null,
    ) {}

    public function etag(): string
    {
        return '"'.$this->hash.'"';
    }
}
