<?php
namespace Modules\API\APIExterne\MagicRelais;

use Modules\Consultation\Controller\ExportComparatifController;
use Modules\Consultation\Service\ExportComparatifService;

class ConsultExportComparatif extends ExportComparatifController
{
    /**
     * @param array<mixed> $paramDico
     */
    public function traitement(array $paramDico):string
    {
        $filePath = (new ExportComparatifService($this->pdo, $this->getTranslationService()))->exportComparatifExcel($paramDico['ALPHA1']);

        return '<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
            <Relais_HTTP_Out>
                <Statut>O</Statut>
                <File>'.htmlspecialchars(basename($filePath)).'</File>
            </Relais_HTTP_Out>';
    }
}
