<?php

declare(strict_types=1);

namespace ImovelZapAi\Publishing\Application\Data;

use Carbon\CarbonInterface;

final readonly class PublishingDashboardMetricsData
{
    public function __construct(
        public int $publishedProperties,
        public int $pendingProperties,
        public int $errorProperties,
        public ?CarbonInterface $lastSyncedAt,
    ) {}

    public function lastSyncedAtLabel(): ?string
    {
        return $this->lastSyncedAt?->timezone(config('app.timezone'))->format('d/m/Y H:i');
    }
}
