<?php
namespace Modules\Additional\Specifique\Client163\Modules\Parametrage\Controller;

use GuzzleHttp\Psr7\Response;
use Helpers\Fichier\Fichier;
use Helpers\Trad\Trad;
use Modules\Additional\Specifique\Client163\Modules\Parametrage\Repository\ParametrageFulll;
use Skeleton\Controller\Controller;

class ParametrageController extends Controller
{
    protected ParametrageFulll $paramFullRepository;
    
    /**
     * fulllAction
     *
     * @return string
     */
    public function fulllAction()
    {
        $trad = $this->getTranslationService();
        $paramsGet = $this->request->getQueryParams();
        $this->paramFullRepository = new ParametrageFulll($this->pdo);
        $this->paramFullRepository->updateParam(
            [
                'ALPHA5' => $paramsGet['code'],
                'ALPHA6' => $paramsGet['company']
            ],
            [
                'TYPEDICO' => 'DICOEXTERNE',
                'ID4' => 'FULL',
            ]
        );
        
        Fichier::deleteFichierPj('PAR_CO_FULL_refreshToken.txt');

        \Helpers\Ariane\Ariane::generate(1, $trad->t('Paramétrage Fulll'));

        return $this->renderer->render('@specifique163Parametrage/parametrageFulll', [
            'menuActive' => 'Facture',
            'menuLeft' => 'menuLeftQualityReview'
        ]);
    }
}
