<?php

namespace Modules\Stock\MenuContextuel;

use Helpers\Outil\MenuContextuel;
use Helpers\Trad\ITrad;
use Modules\Stock\Interface\MenuContextuelInterface;
use Modules\Stock\Trait\MenuContextuelTrait;
use PDO;
use Skeleton\Router;

class IndisponibiliteContextuel extends MenuContextuel implements MenuContextuelInterface
{
    use MenuContextuelTrait;

    /**
     * @var array<string,mixed>
     */
    public array $droit = [];

    public function __construct(PDO $pdo, Router $router, ITrad $trad)
    {
        parent::__construct($pdo, $router, $trad);
    }

    /**
     * @param array<string,string|int> $entity
     * @return array<string, array<int,array<string, mixed>>>
     */
    public function generate(array $entity): array
    {
        return [
            'listeSecondaire' => [
                [
                    'libelle' => $this->trad->t('Remise en disponibilité'),
                    'lien' => $this->router->generateUri('Stock.Indisponibilite.remiseEnDisponibiliteForm', ['noIndisp' => $entity['NO_INDISP']]),
                ],
            ]
        ];
    }
}
