<?php

namespace Modules\Contrat\Rules;

use Psr\Http\Message\ServerRequestInterface;

class AccordCadre
{
    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 creation(): bool
    {
        if (!$this->main->contractCreatEditAccess()) {
            return false;
        }

        return true;
    }

    public function modification(): bool
    {
        if (!$this->main->contractCreatEditAccess()) {
            return false;
        }

        return true;
    }

    public function dupliquer(): bool
    {
        if (!$this->main->contractCreatEditAccess()) {
            return false;
        }

        return true;
    }

    public function popupCreationAvenant(): bool
    {
        if (!$this->main->contractCreatEditAccess()) {
            return false;
        }

        return true;
    }

    public function popupCommentaire(): bool
    {
        if (!$this->main->contractCreatEditAccess()) {
            return false;
        }

        return true;
    }

    public function ajaxDupliquer(): bool
    {
        if (!$this->main->contractCreatEditAccess()) {
            return false;
        }

        return true;
    }

    public function suppresionAvenant(): bool
    {
        if (!$this->main->contractCreatEditAccess()) {
            return false;
        }

        return true;
    }
}
