<?php

declare(strict_types=1);

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

use ImovelZapAi\Properties\Infrastructure\Persistence\Eloquent\PropertyModel;
use ImovelZapAi\Publishing\Application\Mappers\ListingMapper;
use ImovelZapAi\Publishing\Connectors\GroupOlx\Application\Ports\GroupOlxListingNormalizerInterface;
use ImovelZapAi\Publishing\Domain\Canonical\NormalizedListing;

final class GroupOlxListingNormalizer implements GroupOlxListingNormalizerInterface
{
    public function __construct(
        private readonly ListingMapper $listingMapper,
    ) {}

    public function toNormalized(PropertyModel $property): NormalizedListing
    {
        return $this->listingMapper->toNormalized($property);
    }
}
