Akeneo permet de configurer des règles de devoirs en mode Hard qui bloquent totalement la création. Or certains cas légitimes (sorties scolaires, événements exceptionnels) nécessitent de passer outre ces règles. Sans mécanisme d'exception, l'enseignant est bloqué et doit contacter manuellement la direction. Cette implémentation ajoute un flux complet d'exception : l'enseignant justifie sa demande (min 20 caractères), le devoir est créé immédiatement, et la direction est notifiée par email. Le handler vérifie côté serveur que les règles sont réellement bloquantes avant d'accepter l'exception, empêchant toute fabrication de fausses exceptions via l'API. La direction dispose d'un rapport filtrable par période, enseignant et type de règle.
28 lines
814 B
PHP
28 lines
814 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Scolarite\Domain\Repository;
|
|
|
|
use App\Scolarite\Domain\Model\Homework\HomeworkId;
|
|
use App\Scolarite\Domain\Model\Homework\HomeworkRuleException;
|
|
use App\Shared\Domain\Tenant\TenantId;
|
|
|
|
interface HomeworkRuleExceptionRepository
|
|
{
|
|
public function save(HomeworkRuleException $exception): void;
|
|
|
|
/** @return array<HomeworkRuleException> */
|
|
public function findByHomework(HomeworkId $homeworkId, TenantId $tenantId): array;
|
|
|
|
/** @return array<HomeworkRuleException> */
|
|
public function findByTenant(TenantId $tenantId): array;
|
|
|
|
/**
|
|
* Returns the set of homework IDs that have at least one exception.
|
|
*
|
|
* @return array<string> Homework IDs as strings
|
|
*/
|
|
public function homeworkIdsWithExceptions(TenantId $tenantId): array;
|
|
}
|