<?php

namespace Modules\Commande\Rules;

use Helpers\Outil\Roles;
use Modules\GlobalApplication\Repository\LicenceOxalys;
use Psr\Http\Message\ServerRequestInterface;

class NotationCommande
{
    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
    {
        return (new LicenceOxalys($this->pdo))->noteFourActive();
    }

    public function activate() :bool
    {
        return Roles::droitsUtilisateur($this->pdo, 'HA_NOT_NM') == 1;
    }


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

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

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

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

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

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

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