feat(central) : ajoute le pilotage de maintenance et le deploiement prod

This commit is contained in:
2026-04-03 11:34:48 +02:00
parent 8e59f59679
commit 4234efdb50
45 changed files with 29298 additions and 30 deletions

View File

@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
namespace App\ApiResource;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use App\State\ManagedApplicationProvider;
use App\State\MaintenanceToggleProcessor;
use Symfony\Component\Serializer\Attribute\Groups;
#[ApiResource(
operations: [
new GetCollection(
uriTemplate: '/applications',
normalizationContext: ['groups' => ['app:read']],
security: "is_granted('ROLE_ADMIN')",
provider: ManagedApplicationProvider::class,
),
new Get(
uriTemplate: '/applications/{slug}',
normalizationContext: ['groups' => ['app:read']],
security: "is_granted('ROLE_ADMIN')",
provider: ManagedApplicationProvider::class,
),
new Post(
uriTemplate: '/applications/{slug}/maintenance',
normalizationContext: ['groups' => ['app:read']],
denormalizationContext: ['groups' => ['app:write']],
security: "is_granted('ROLE_ADMIN')",
provider: ManagedApplicationProvider::class,
processor: MaintenanceToggleProcessor::class,
),
],
)]
final class ManagedApplication
{
#[ApiProperty(identifier: true)]
#[Groups(['app:read'])]
public string $slug = '';
#[Groups(['app:read'])]
public string $name = '';
#[Groups(['app:read', 'app:write'])]
public bool $maintenance = false;
}