<?php

namespace Modules\Facture\Rules;

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

class GestionFacture
{
    protected ServerRequestInterface $request;
    protected \PDO $pdo;
    protected Main $main;

    public function __construct(ServerRequestInterface $request, \PDO $pdo)
    {
        $this->request    = $request;
        $this->pdo        = $pdo;
        $this->main       = new Main($this->request, $this->pdo);
    }

    public function editionImage(): bool
    {
        return $this->main->printingEditingInvoiceAccess();
    }

    public function impressionFacture(): bool
    {
        return $this->main->printingEditingInvoiceAccess();
    }

    public function index() : bool
    {
        return Roles::droitsUtilisateur($this->pdo, 'HA_FA_VISU') && Roles::droitsUtilisateur($this->pdo, 'U8zXaa77yt');
    }

    public function detail() : bool
    {
        return Roles::droitsUtilisateur($this->pdo, 'HA_FA_VISU') && Roles::droitsUtilisateur($this->pdo, 'U8zXaa77yt');
    }

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

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

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

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

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

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

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

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

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