<?php

namespace Modules\Contrat\Rules;

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

class CentreAutorise
{
    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 centreEmetteur(): bool
    {
        $id = $this->request->getAttribute('idacc');
        return $this->main->contractCreatEditAccessCreator($id);
    }

    public function centreLivraison(): bool
    {
        $id = $this->request->getAttribute('idacc');
        return $this->main->contractCreatEditAccessCreator($id);
    }

    public function modifierCentre(): bool
    {
        $id = $this->request->getAttribute('idacc');
        return $this->main->contractCreatEditAccessCreator($id);
    }

    public function modifierCentreLivraison(): bool
    {
        $id = $this->request->getAttribute('idacc');
        return $this->main->contractCreatEditAccessCreator($id);
    }

    public function exportCentreAutorise(): bool
    {
        $id = $this->request->getAttribute('idacc');
        return $this->main->contractCreatEditAccessCreator($id);
    }

    public function gestionAutorisationCentreEmetteur(): bool
    {
        $id = $this->request->getAttribute('idacc');
        return $this->main->contractCreatEditAccessCreator($id);
    }

    public function gestionAutorisationCentreLivraison(): bool
    {
        $id = $this->request->getAttribute('idacc');
        return $this->main->contractCreatEditAccessCreator($id);
    }
}
