<?php

declare(strict_types=1);

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

use ImovelZapAi\Publishing\Connectors\GroupOlx\Application\Data\GroupOlxFeedBuildResultData;
use ImovelZapAi\Publishing\Connectors\GroupOlx\Application\Data\GroupOlxFeedValidationResult;
use ImovelZapAi\Publishing\Connectors\GroupOlx\Application\Data\GroupOlxMappedListingData;
use ImovelZapAi\Publishing\Domain\Feeds\VrSync\ListingDataFeed;
use ImovelZapAi\Publishing\Domain\Feeds\VrSync\ListingDataFeedHeader;

/**
 * Valida o feed no formato esperado pelo Grupo OLX (VRSync).
 *
 * Erros de validação retornam lista — nunca Exception.
 */
interface GroupOlxFeedValidatorInterface
{
    public function validateXml(string $xml): GroupOlxFeedValidationResult;

    public function validateFeed(ListingDataFeed $feed): GroupOlxFeedValidationResult;

    public function validateBuild(GroupOlxFeedBuildResultData $build): GroupOlxFeedValidationResult;

    public function validateMapped(GroupOlxMappedListingData $mapped): GroupOlxFeedValidationResult;

    /**
     * @param  list<GroupOlxMappedListingData>  $listings
     */
    public function validateMappedFeed(ListingDataFeedHeader $header, array $listings): GroupOlxFeedValidationResult;
}
