Les établissements ont besoin de protéger les élèves et familles des devoirs de dernière minute. Cette configuration au niveau tenant permet de définir des règles de timing (délai minimum, pas de devoir pour lundi après une heure limite) et un mode d'application (avertissement, blocage ou désactivé). Le service de validation est prêt pour être branché dans le flux de création de devoirs (Stories 5.4/5.5). L'historique des changements assure la traçabilité des modifications de configuration.
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Administration\Infrastructure\Api\Resource;
|
|
|
|
use ApiPlatform\Metadata\ApiProperty;
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\GetCollection;
|
|
use App\Administration\Infrastructure\Api\Provider\HomeworkRulesHistoryProvider;
|
|
|
|
/**
|
|
* DTO représentant une entrée d'historique des règles de devoirs.
|
|
*/
|
|
#[ApiResource(
|
|
shortName: 'HomeworkRulesHistory',
|
|
operations: [
|
|
new GetCollection(
|
|
uriTemplate: '/settings/homework-rules/history',
|
|
provider: HomeworkRulesHistoryProvider::class,
|
|
name: 'get_homework_rules_history',
|
|
),
|
|
],
|
|
)]
|
|
final class HomeworkRulesHistoryResource
|
|
{
|
|
#[ApiProperty(identifier: true)]
|
|
public ?string $id = null;
|
|
|
|
/** @var array<int, array{type: string, params: array<string, mixed>}>|null */
|
|
public ?array $previousRules = null;
|
|
|
|
/** @var array<int, array{type: string, params: array<string, mixed>}> */
|
|
public array $newRules = [];
|
|
|
|
public string $enforcementMode = '';
|
|
|
|
public bool $enabled = true;
|
|
|
|
public string $changedBy = '';
|
|
|
|
public string $changedAt = '';
|
|
}
|