<?php

namespace Modules\Panier\Rules;

use Helpers\Outil\Roles;
use Psr\Http\Message\ServerRequestInterface;

class Panier
{
    protected ServerRequestInterface $request;
    protected \PDO $pdo;
    
    /**
     * __construct
     *
     * @param  ServerRequestInterface $request
     * @return void
     */
    public function __construct(ServerRequestInterface  $request, \PDO $pdo)
    {
        $this->request  = $request;
        $this->pdo      = $pdo;
    }
    
    /**
     * init
     *
     * @return bool
     */
    public function init() : bool
    {
        if ($_SESSION['IS_STE_VALIDE'] || Roles::droitsUtilisateur($this->pdo, 'HA_DA_CRE') || Roles::GetALL()) {
            return true;
        }
        return false;
    }


    /**
     * @return bool
     */
    public function index(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function ajaxChargeEclatementImpu(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function ajaxAjoutLigneImputation(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function ajaxDeleteLigneImputation(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function popupBonnePratique(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function updateValue(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function soumission(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function ajaxDownloadDoc(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function ajaxLoadArticle(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function nouveauPanier(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    // @phpcs:ignore
    public function waitingSoumission(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    // @phpcs:ignore
    public function transferePanier(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    // @phpcs:ignore
    public function popupSavePanier(): bool
    {
        return true;
    }
}
