<?php

namespace Modules\Stock\Repository;

use Exception;
use Helpers\QueryBuilder\AbsRepository;
use Modules\Stock\Enum\CodeParametreVracEnum;
use Modules\Stock\Enum\TypeParametreVracEnum;

class ParavracRepo extends AbsRepository
{
    /**
     * @return array<string,mixed>
     * @throws Exception
     */
    public function findComputeQteDispoWithQteReserveeParametre(): array
    {
        $req = "SELECT * FROM PARAVRAC WHERE TYPEPARV = :typeParv AND CODEPARV = :codeParv";

        return $this->fetchAssocOne($req, [
            'typeParv' => TypeParametreVracEnum::PARAMSTO->name,
            'codeParv' => CodeParametreVracEnum::ST_STONEGINTERDIT_SANSRESA->name
        ]);
    }
}
