[#FER-19] Ajouter le healthCheck du pont bascule (!58)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|                  |                 |

## Description de la PR

## Modification du .env

## Check list

- [x] Pas de régression
- [x] TU/TI/TF rédigée
- [x] TU/TI/TF OK
- [x] CHANGELOG modifié

Reviewed-on: #58
Co-authored-by: tristan <tristan@yuno.malio.fr>
Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #58.
This commit is contained in:
2026-05-21 12:38:32 +00:00
committed by Autin
parent 16ebede557
commit fd6aed8ae0
13 changed files with 1229 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace App\State;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProviderInterface;
use App\ApiResource\PontBasculeHealthCheck;
use App\Service\PontBasculeService;
final readonly class PontBasculeHealthProvider implements ProviderInterface
{
public function __construct(
private PontBasculeService $pontBasculeService,
) {}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): PontBasculeHealthCheck
{
$health = $this->pontBasculeService->checkHealth();
$resource = new PontBasculeHealthCheck();
$resource->healthy = $health->isHealthy();
$resource->ok = $health->isOk();
$resource->busy = $health->isBusy();
$resource->portConnected = $health->isPortConnected();
$resource->portError = $health->getPortError();
$resource->hostname = $health->getHostname();
return $resource;
}
}