feat: Calculer automatiquement les moyennes après chaque saisie de notes
Some checks failed
CI / Backend Tests (push) Has been cancelled
CI / Frontend Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Naming Conventions (push) Has been cancelled
CI / Build Check (push) Has been cancelled

Les enseignants ont besoin de moyennes à jour immédiatement après la
publication ou modification des notes, sans attendre un batch nocturne.

Le système recalcule via Domain Events synchrones : statistiques
d'évaluation (min/max/moyenne/médiane), moyennes matières pondérées
(normalisation /20), et moyenne générale par élève. Les résultats sont
stockés dans des tables dénormalisées avec cache Redis (TTL 5 min).

Trois endpoints API exposent les données avec contrôle d'accès par rôle.
Une commande console permet le backfill des données historiques au
déploiement.
This commit is contained in:
2026-03-30 06:22:03 +02:00
parent b70d5ec2ad
commit b7dc27f2a5
786 changed files with 118783 additions and 316 deletions

View File

@@ -61,7 +61,7 @@ test.describe('Admin Class Detail Page [P1]', () => {
await page.locator('#email').fill(ADMIN_EMAIL);
await page.locator('#password').fill(ADMIN_PASSWORD);
await Promise.all([
page.waitForURL(/\/dashboard/, { timeout: 30000 }),
page.waitForURL(/\/dashboard/, { timeout: 60000 }),
page.getByRole('button', { name: /se connecter/i }).click()
]);
}
@@ -151,8 +151,16 @@ test.describe('Admin Class Detail Page [P1]', () => {
await page.getByRole('button', { name: /créer la classe/i }).click();
await expect(page.getByRole('dialog')).not.toBeVisible({ timeout: 10000 });
// Search for the newly created class to handle pagination
const searchModify = page.locator('input[type="search"]');
if (await searchModify.isVisible()) {
await searchModify.fill(originalName);
await page.waitForLoadState('networkidle');
}
// Navigate to edit page
const classCard = page.locator('.class-card', { hasText: originalName });
await expect(classCard).toBeVisible({ timeout: 15000 });
await classCard.getByRole('button', { name: /modifier/i }).click();
await expect(page).toHaveURL(/\/admin\/classes\/[\w-]+/);
@@ -168,13 +176,13 @@ test.describe('Admin Class Detail Page [P1]', () => {
// Go back to list and verify the new name appears (use search for pagination)
await page.goto(`${ALPHA_URL}/admin/classes`);
await page.waitForLoadState('networkidle');
const searchInput = page.locator('input[type="search"]');
if (await searchInput.isVisible()) {
await searchInput.fill(newName);
await page.waitForTimeout(500);
await page.waitForLoadState('networkidle');
}
await expect(page.getByText(newName)).toBeVisible({ timeout: 10000 });
await expect(page.getByText(newName)).toBeVisible({ timeout: 15000 });
});
// ============================================================================
@@ -233,8 +241,16 @@ test.describe('Admin Class Detail Page [P1]', () => {
await page.getByRole('button', { name: /créer la classe/i }).click();
await expect(page.getByRole('dialog')).not.toBeVisible({ timeout: 10000 });
// Search for the newly created class to handle pagination
const searchCancel = page.locator('input[type="search"]');
if (await searchCancel.isVisible()) {
await searchCancel.fill(originalName);
await page.waitForLoadState('networkidle');
}
// Navigate to edit page
const classCard = page.locator('.class-card', { hasText: originalName });
await expect(classCard).toBeVisible({ timeout: 15000 });
await classCard.getByRole('button', { name: /modifier/i }).click();
await expect(page).toHaveURL(/\/admin\/classes\/[\w-]+/);
@@ -246,10 +262,17 @@ test.describe('Admin Class Detail Page [P1]', () => {
await page.getByRole('button', { name: /annuler/i }).click();
// Should go back to the classes list
await expect(page).toHaveURL(/\/admin\/classes$/);
await expect(page).toHaveURL(/\/admin\/classes$/, { timeout: 10000 });
// Search for the class to handle pagination
const searchAfterCancel = page.locator('input[type="search"]');
if (await searchAfterCancel.isVisible()) {
await searchAfterCancel.fill(originalName);
await page.waitForLoadState('networkidle');
}
// The original name should still be visible, modified name should not
await expect(page.getByText(originalName)).toBeVisible();
await expect(page.getByText(originalName)).toBeVisible({ timeout: 10000 });
await expect(page.getByText('Should-Not-Persist')).not.toBeVisible();
});