feat: Provisionner automatiquement un nouvel établissement
Lorsqu'un super-admin crée un établissement via l'interface, le système doit automatiquement créer la base tenant, exécuter les migrations, créer le premier utilisateur admin et envoyer l'invitation — le tout de manière asynchrone pour ne pas bloquer la réponse HTTP. Ce mécanisme rend chaque établissement opérationnel dès sa création sans intervention manuelle sur l'infrastructure.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Scolarite\Infrastructure\Api\Resource;
|
||||
|
||||
use ApiPlatform\Metadata\ApiProperty;
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Get;
|
||||
use App\Scolarite\Infrastructure\Api\Provider\StudentProgressionProvider;
|
||||
|
||||
#[ApiResource(
|
||||
shortName: 'StudentProgression',
|
||||
operations: [
|
||||
new Get(
|
||||
uriTemplate: '/me/statistics/students/{studentId}',
|
||||
provider: StudentProgressionProvider::class,
|
||||
name: 'get_student_progression',
|
||||
),
|
||||
],
|
||||
)]
|
||||
final class StudentProgressionResource
|
||||
{
|
||||
#[ApiProperty(identifier: true)]
|
||||
public ?string $studentId = null;
|
||||
|
||||
public ?string $subjectId = null;
|
||||
|
||||
public ?string $classId = null;
|
||||
|
||||
/** @var list<array{date: string, value: float, evaluationTitle: string}> */
|
||||
public array $grades = [];
|
||||
|
||||
/** @var array{slope: float, intercept: float}|null */
|
||||
public ?array $trendLine = null;
|
||||
}
|
||||
Reference in New Issue
Block a user